Skip to content
Extraits de code Groupes Projets
Valider c41b723e rédigé par Kubat's avatar Kubat
Parcourir les fichiers

Merge branch 'fix-insert' into 'master'

Moving queue_tmp to permanent table to fix the __queue_reorder crash

See merge request !113
parents 1d6ed7d9 397db002
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!113Moving queue_tmp to permanent table to fix the __queue_reorder crash
Pipeline #1870 réussi
...@@ -22,3 +22,6 @@ cscope.files ...@@ -22,3 +22,6 @@ cscope.files
cscope.out cscope.out
tags tags
!*.inc !*.inc
*.zst
config.log
autom4te.cache
# Maintainer: Maël 'Kubat' MARTIN <mael.martin31@gmail.com> # Maintainer: Maël 'Kubat' MARTIN <mael.martin31@gmail.com>
pkgname=lektor pkgname=lektor
pkgver=mk7.1036.462cf03 pkgver=mk7.1044.1d6ed7d
pkgrel=1 pkgrel=1
pkgdesc="The lektor kara player, from the Bakaclub" pkgdesc="The lektor kara player, from the Bakaclub"
arch=(x86_64 i686) arch=(x86_64 i686)
......
...@@ -77,6 +77,13 @@ CREATE TABLE IF NOT EXISTS queue ...@@ -77,6 +77,13 @@ CREATE TABLE IF NOT EXISTS queue
, priority INTEGER NOT NULL DEFAULT 1 CHECK(priority > 0 AND priority < 6) , priority INTEGER NOT NULL DEFAULT 1 CHECK(priority > 0 AND priority < 6)
); );
-- Temporary queue table used when reordering the queue (for inserts)
CREATE TABLE IF NOT EXISTS queue_tmp
( position INTEGER PRIMARY KEY AUTOINCREMENT CHECK(position > 0)
, kara_id INTEGER
, priority INTEGER NOT NULL DEFAULT 1 CHECK(priority > 0 AND priority < 6)
);
-- The user table -- The user table
-- Used for the [password {passwd}] MPD command. The documentation can be found -- Used for the [password {passwd}] MPD command. The documentation can be found
......
...@@ -132,12 +132,6 @@ __queue_reorder(volatile sqlite3 *db) ...@@ -132,12 +132,6 @@ __queue_reorder(volatile sqlite3 *db)
"(SELECT CASE WHEN (SELECT current FROM queue_state) IS NULL THEN 0" \ "(SELECT CASE WHEN (SELECT current FROM queue_state) IS NULL THEN 0" \
" ELSE (SELECT current FROM queue_state) END AS val LIMIT 1)" " ELSE (SELECT current FROM queue_state) END AS val LIMIT 1)"
static const char *SQL_REORDER = static const char *SQL_REORDER =
/* Create temporary tables */
"CREATE TEMPORARY TABLE queue_tmp IF NOT EXISTS"
" ( position INTEGER PRIMARY KEY AUTOINCREMENT CHECK(position > 0)"
" , kara_id INTEGER"
" , priority INTEGER NOT NULL DEFAULT 1 CHECK(priority > 0 AND priority < 6)"
" );"
/* Separate karas that are after the current one */ /* Separate karas that are after the current one */
"INSERT INTO queue_tmp (kara_id, priority)" "INSERT INTO queue_tmp (kara_id, priority)"
" SELECT kara_id, priority FROM queue WHERE position > " CURRENT_POS_OR_0 " SELECT kara_id, priority FROM queue WHERE position > " CURRENT_POS_OR_0
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter