Commit 84943773 by Scott

Merge branch '1.8' into dev

parents f547f428 e731787d
...@@ -555,7 +555,7 @@ function qa_array_to_keys($array) ...@@ -555,7 +555,7 @@ function qa_array_to_keys($array)
*/ */
function qa_db_missing_tables($definitions) function qa_db_missing_tables($definitions)
{ {
$keydbtables = qa_array_to_keys(qa_db_list_tables()); $keydbtables = qa_array_to_keys(qa_db_list_tables(true));
$missing = array(); $missing = array();
...@@ -776,7 +776,7 @@ function qa_db_upgrade_tables() ...@@ -776,7 +776,7 @@ function qa_db_upgrade_tables()
// Write-lock all Q2A tables before we start so no one can read or write anything // Write-lock all Q2A tables before we start so no one can read or write anything
$keydbtables = qa_array_to_keys(qa_db_list_tables()); $keydbtables = qa_array_to_keys(qa_db_list_tables(true));
foreach ($definitions as $rawname => $definition) foreach ($definitions as $rawname => $definition)
if (isset($keydbtables[qa_db_add_table_prefix($rawname)])) if (isset($keydbtables[qa_db_add_table_prefix($rawname)]))
......
...@@ -448,10 +448,19 @@ function qa_db_list_tables_lc() ...@@ -448,10 +448,19 @@ function qa_db_list_tables_lc()
/** /**
* Return an array of the names of all tables in the Q2A database. * Return an array of the names of all tables in the Q2A database.
*
* @param bool $onlyTablesWithPrefix Determine if the result should only include tables with the
* QA_MYSQL_TABLE_PREFIX or if it should include all tables in the database.
*/ */
function qa_db_list_tables() function qa_db_list_tables($onlyTablesWithPrefix = false)
{ {
return qa_db_read_all_values(qa_db_query_raw('SHOW TABLES')); $query = 'SHOW TABLES';
if ($onlyTablesWithPrefix) {
$query .= ' LIKE "' . QA_MYSQL_TABLE_PREFIX . '%"';
}
return qa_db_read_all_values(qa_db_query_raw($query));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment