diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2012-12-19 13:35:48 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2012-12-19 13:38:16 +0100 |
commit | f0c780a45359ceb3eb3fe8ab6b0e5f8c0f07e26f (patch) | |
tree | e9fea31144b93769014c1ac33dd33dc18f256aa1 /phpBB | |
parent | a288c4b66bdd82de70ff14750890e9829fa7d9b9 (diff) | |
download | forums-f0c780a45359ceb3eb3fe8ab6b0e5f8c0f07e26f.tar forums-f0c780a45359ceb3eb3fe8ab6b0e5f8c0f07e26f.tar.gz forums-f0c780a45359ceb3eb3fe8ab6b0e5f8c0f07e26f.tar.bz2 forums-f0c780a45359ceb3eb3fe8ab6b0e5f8c0f07e26f.tar.xz forums-f0c780a45359ceb3eb3fe8ab6b0e5f8c0f07e26f.zip |
[ticket/11278] Fix not running queries from db tools in database update
The db_tools class is running in return mode, which means that the queries
are not run, but just returned. Therefor the broken tables were not
removed from the database.
PHPBB3-11278
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/install/database_update.php | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 983b1b46c4..0281aea0b3 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1017,7 +1017,7 @@ function database_update_info() *****************************************************************************/ function change_database_data(&$no_updates, $version) { - global $db, $errored, $error_ary, $config, $phpbb_root_path, $phpEx; + global $db, $db_tools, $errored, $error_ary, $config, $phpbb_root_path, $phpEx; switch ($version) { @@ -1332,8 +1332,6 @@ function change_database_data(&$no_updates, $version) ), ); - global $db_tools; - $statements = $db_tools->perform_schema_changes($changes); foreach ($statements as $sql) @@ -1975,24 +1973,25 @@ function change_database_data(&$no_updates, $version) } $db->sql_freeresult($result); - global $db_tools, $table_prefix; + global $table_prefix; // Recover from potentially broken Q&A CAPTCHA table on firebird // Q&A CAPTCHA was uninstallable, so it's safe to remove these // without data loss if ($db_tools->sql_layer == 'firebird') { - $tables = array( - $table_prefix . 'captcha_questions', - $table_prefix . 'captcha_answers', - $table_prefix . 'qa_confirm', + $changes = array( + 'drop_tables' => array( + $table_prefix . 'captcha_questions', + $table_prefix . 'captcha_answers', + $table_prefix . 'qa_confirm', + ), ); - foreach ($tables as $table) + $statements = $db_tools->perform_schema_changes($changes); + + foreach ($statements as $sql) { - if ($db_tools->sql_table_exists($table)) - { - $db_tools->sql_table_drop($table); - } + _sql($sql, $errored, $error_ary); } } |