diff --git a/ChangeLog b/ChangeLog index 4c59324be..e734e74ef 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - Changelog $Id$ $Source$ +2004-04-19 Marcel Tschopp + * libraries/export/sql.php, libraries/export/latex.php: Fixed a few + mysqli-specific export-bugs + 2004-04-19 Marc Delisle * sql.php: bug 780516: capitalizing keywords: we no longer put the formatted query into $sql_query, due to better pattern matching diff --git a/libraries/export/latex.php b/libraries/export/latex.php index d4bb91cdc..75ffa2feb 100644 --- a/libraries/export/latex.php +++ b/libraries/export/latex.php @@ -220,6 +220,17 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals { global $cfgRelation; + /** + * Get the unique keys in the table + */ + $keys_query = 'SHOW KEYS FROM ' . PMA_backquote($table) . ' FROM '. PMA_backquote($db); + $keys_result = PMA_DBI_query($keys_query); + $unique_keys = array(); + while($key = PMA_DBI_fetch_assoc($keys_result)) { + if ($key['Non_unique'] == 0) $unique_keys[] = $key['Column_name']; + } + PMA_DBI_free_result($keys_result); + /** * Gets fields properties */ @@ -244,16 +255,6 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals $have_rel = FALSE; } // end if - /** - * Get the unique keys in the table - */ - $keys_query = 'SHOW KEYS FROM ' . PMA_backquote($table) . ' FROM '. PMA_backquote($db); - $keys_result = PMA_DBI_query($keys_query); - $unique_keys = array(); - while($key = PMA_DBI_fetch_assoc($keys_result)) { - if ($key['Non_unique'] == 0) $unique_keys[] = $key['Column_name']; - } - /** * Displays the table structure */ diff --git a/libraries/export/sql.php b/libraries/export/sql.php index 41072638c..d205f0ae8 100644 --- a/libraries/export/sql.php +++ b/libraries/export/sql.php @@ -213,8 +213,8 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false) $schema_create .= $GLOBALS['comment_marker'] . $GLOBALS['strStatCheckTime'] . ': ' . PMA_localisedDate(strtotime($tmpres['Check_time'])) . $crlf; $new_crlf = $GLOBALS['comment_marker'] . $crlf . $crlf; } - PMA_DBI_free_result($result); } + PMA_DBI_free_result($result); } $schema_create .= $new_crlf; @@ -230,7 +230,7 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false) } else { PMA_DBI_query('SET SQL_QUOTE_SHOW_CREATE = 0'); } - $result = PMA_DBI_query('SHOW CREATE TABLE ' . PMA_backquote($db) . '.' . PMA_backquote($table)); + $result = PMA_DBI_query('SHOW CREATE TABLE ' . PMA_backquote($db) . '.' . PMA_backquote($table), NULL, PMA_DBI_QUERY_STORE); if ($result != FALSE && PMA_DBI_num_rows($result) > 0) { $tmpres = PMA_DBI_fetch_row($result); // Fix for case problems with winwin, thanks to