diff --git a/ChangeLog b/ChangeLog index 50333a6d7..87f5c09c3 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - Changelog $Id$ $Source$ +2004-08-01 Marc Delisle + * tbl_change.php, libraries/relation.lib.php: bug 1001159, Commands + out of sync on Insert + 2004-07-31 Alexander M. Turek * tbl_change.php, tbl_replace.php, libraries/relation.lib.php: Small optimizations, freed some results (thanks to Marc for the one in diff --git a/libraries/relation.lib.php b/libraries/relation.lib.php index 8fc63e38d..d474b0aa1 100644 --- a/libraries/relation.lib.php +++ b/libraries/relation.lib.php @@ -6,7 +6,6 @@ error_reporting(E_ALL); * Set of functions used with the relation and pdf feature */ - /** * Executes a query as controluser if possible, otherwise as normal user * @@ -293,6 +292,8 @@ function PMA_getForeigners($db, $table, $column = '', $source = 'both') { $foreign[$field]['foreign_field'] = $relrow['foreign_field']; $i++; } // end while + PMA_DBI_free_result($relations); + unset($relations); } if (($source == 'both' || $source == 'innodb') && !empty($table)) { @@ -300,7 +301,8 @@ function PMA_getForeigners($db, $table, $column = '', $source = 'both') { . PMA_backquote($db) . '.' . PMA_backquote($table); $show_create_table_res = PMA_DBI_query($show_create_table_query); list(,$show_create_table) = PMA_DBI_fetch_row($show_create_table_res); - + PMA_DBI_free_result($show_create_table_res); + unset($show_create_table_res); $analyzed_sql = PMA_SQP_analyze(PMA_SQP_parse($show_create_table)); foreach ($analyzed_sql[0]['foreign_keys'] AS $one_key) { diff --git a/tbl_change.php b/tbl_change.php index c8668cfbe..520a7bbd2 100644 --- a/tbl_change.php +++ b/tbl_change.php @@ -90,7 +90,7 @@ if (isset($primary_key)) { $result = array(); foreach ($primary_key_array AS $rowcount => $primary_key) { $local_query = 'SELECT * FROM ' . PMA_backquote($table) . ' WHERE ' . $primary_key . ';'; - $result[$rowcount] = PMA_DBI_query($local_query); + $result[$rowcount] = PMA_DBI_query($local_query, NULL, PMA_DBI_QUERY_STORE); $row[$rowcount] = PMA_DBI_fetch_assoc($result[$rowcount]); PMA_DBI_free_result($result[$rowcount]); $primary_keys[$rowcount] = $primary_key; @@ -121,7 +121,7 @@ if (isset($primary_key)) { } // end if (no record returned) } } else { - $result = PMA_DBI_query('SELECT * FROM ' . PMA_backquote($table) . ' LIMIT 1;'); + $result = PMA_DBI_query('SELECT * FROM ' . PMA_backquote($table) . ' LIMIT 1;', NULL, PMA_DBI_QUERY_STORE); unset($row); }