SQLite: Handle error in altering table (bug #697)

This commit is contained in:
Jakub Vrana 2019-08-21 11:21:17 +02:00
parent 788d383609
commit 1b33729110
2 changed files with 5 additions and 5 deletions

View 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) {

View 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)