Allow work on temporary tables (bug #864984).

This commit is contained in:
Michal Čihař
2004-10-19 19:51:54 +00:00
parent 535387e736
commit 5e5fb8af45
2 changed files with 16 additions and 2 deletions

View File

@@ -35,6 +35,8 @@ $Source$
* libraries/zip.lib.php: Drop unneed part of header which causes troubles * libraries/zip.lib.php: Drop unneed part of header which causes troubles
to some programs (bug #1037737). to some programs (bug #1037737).
* index.php: Add frame spacing (RFE #1036013). * index.php: Add frame spacing (RFE #1036013).
* libraries/db_table_exists.lib.php: Allow work on temporary tables (bug
#864984).
2004-10-17 Marc Delisle <lem9@users.sourceforge.net> 2004-10-17 Marc Delisle <lem9@users.sourceforge.net>
* lang/turkish update, thanks to boralioglu. * lang/turkish update, thanks to boralioglu.

View File

@@ -25,10 +25,22 @@ if (!isset($is_table) || !$is_table) {
} }
if (empty($table) if (empty($table)
|| !($is_table && @PMA_DBI_num_rows($is_table))) { || !($is_table && @PMA_DBI_num_rows($is_table))) {
$redirect = TRUE;
if (!isset($is_transformation_wrapper)) { if (!isset($is_transformation_wrapper)) {
PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . 'db_details.php?' . PMA_generate_common_url($db, '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); $redirect = TRUE;
if (!empty($table)) {
PMA_DBI_free_result($is_table);
// SHOW TABLES doesn't show temporary tables, so try select (as it can happen just in case temporary table, it should be fast):
$is_table2 = PMA_DBI_try_query('SELECT COUNT(*) FROM `' . PMA_sqlAddslashes($table, TRUE) . '`;', NULL, PMA_DBI_QUERY_STORE);
$redirect = !($is_table2 && @PMA_DBI_num_rows($is_table2));
PMA_DBI_free_result($is_table2);
}
if ($redirect) {
PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . 'db_details.php?' . PMA_generate_common_url($db, '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
}
} }
exit; if ($redirect) exit;
} else if (isset($is_table)) { } else if (isset($is_table)) {
PMA_DBI_free_result($is_table); PMA_DBI_free_result($is_table);
} }