]> git.joonet.de Git - adminer.git/commitdiff
SQLite: Handle error in altering table (bug #697)
authorJakub Vrana <jakub@vrana.cz>
Wed, 21 Aug 2019 09:21:17 +0000 (11:21 +0200)
committerJakub Vrana <jakub@vrana.cz>
Wed, 21 Aug 2019 09:21:17 +0000 (11:21 +0200)
adminer/drivers/sqlite.inc.php
changes.txt

index ecb64c5e452b2b0aa549caf03af2424fcedd3574..28f5735e5a25385effd530ea205e3b986bdf627e 100644 (file)
@@ -591,11 +591,10 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
                                $trigger = trigger($trigger_name);
                                $triggers[] = "CREATE TRIGGER " . idf_escape($trigger_name) . " " . implode(" ", $timing_event) . " ON " . table($name) . "\n$trigger[Statement]";
                        }
-                       if (!queries("DROP TABLE " . table($table))) { // drop before creating indexes and triggers to allow using old names
-                               return false;
-                       }
-                       queries("ALTER TABLE " . table("adminer_$name") . " RENAME TO " . table($name));
-                       if (!alter_indexes($name, $indexes)) {
+                       if (!queries("DROP TABLE " . table($table)) // drop before creating indexes and triggers to allow using old names
+                               || !queries("ALTER TABLE " . table("adminer_$name") . " RENAME TO " . table($name))
+                               || !alter_indexes($name, $indexes)
+                       ) {
                                return false;
                        }
                        foreach ($triggers as $trigger) {
index f016e81df2a399ccd376dc4e8af25a4f744887a0..f9614402a158571c86887f9600e017a30ce01c8f 100644 (file)
@@ -3,6 +3,7 @@ MySQL: Speed up displaying tables in large databases (bug #700)
 MySQL: Allow editing rows identified by negative floats (bug #695)
 MySQL: Skip editing generated columns
 SQLite: Quote strings stored in integer columns in export (bug #696)
+SQLite: Handle error in altering table (bug #697)
 
 Adminer 4.7.2 (released 2019-07-18):
 Do not attempt logging in without password (bug #676)