From c64564baf77a99fc944560e6898b57214262062d Mon Sep 17 00:00:00 2001 From: Piotr Przybylski Date: Fri, 5 Aug 2011 00:49:31 +0200 Subject: [PATCH 1/3] Server synchronize: fix PMA_get_table_indexes to return null when there are no indexes instead of false Synchronize code depends on this behavior --- libraries/server_synchronize.lib.php | 5 ++--- server_synchronize.php | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php index 513e7e95d9..5ddd07a8d3 100644 --- a/libraries/server_synchronize.lib.php +++ b/libraries/server_synchronize.lib.php @@ -1378,13 +1378,12 @@ function PMA_get_column_values($database, $table, $column, $link = null) */ function PMA_get_table_indexes($database, $table, $link = null) { - $indexes = PMA_DBI_fetch_result( 'SHOW INDEXES FROM ' .PMA_backquote($database) . '.' . PMA_backquote($table), null, null, $link); - if (! is_array($indexes) || count($indexes) < 1) { - return false; + if (!is_array($indexes) || count($indexes) == 0) { + return null; } return $indexes; } diff --git a/server_synchronize.php b/server_synchronize.php index 89e50d8282..4b4322cfc4 100644 --- a/server_synchronize.php +++ b/server_synchronize.php @@ -210,6 +210,7 @@ if ((isset($_REQUEST['submit_connect']))) { */ PMA_dataDiffInUncommonTables($source_tables_uncommon, $src_db, $src_link, $j, $row_count); } + /** * Storing all arrays in session for use when page is reloaded for each button press */ From 6fe137e68dc1a5ed97dafd2864e8e2fda5937a96 Mon Sep 17 00:00:00 2001 From: Piotr Przybylski Date: Fri, 5 Aug 2011 01:15:37 +0200 Subject: [PATCH 2/3] PMA_DBI_get_columns - return null when there are no columns (server synchronize depends on this behavior) --- libraries/database_interface.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index 4490a2c481..54b4af385d 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -841,8 +841,8 @@ function PMA_DBI_get_columns($database, $table, $full = false, $link = null) 'SHOW ' . ($full ? 'FULL' : '') . ' COLUMNS FROM ' . PMA_backquote($database) . '.' . PMA_backquote($table), 'Field', null, $link); - if (! is_array($fields) || count($fields) < 1) { - return false; + if (! is_array($fields) || count($fields) == 0) { + return null; } return $fields; } From 49658988032278d3321d862cd0ec907e2c39fd1b Mon Sep 17 00:00:00 2001 From: Piotr Przybylski Date: Fri, 5 Aug 2011 01:16:02 +0200 Subject: [PATCH 3/3] Always get full information here --- tbl_structure.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tbl_structure.php b/tbl_structure.php index 077603c51b..1b39340c96 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -123,7 +123,7 @@ foreach (PMA_Index::getFromTable($table, $db) as $index) { unset($index, $columns, $column_name, $dummy); // 3. Get fields -$fields = PMA_DBI_get_columns($db, $table, !PMA_DRIZZLE); +$fields = PMA_DBI_get_columns($db, $table, true); $fields_cnt = count($fields); // Get more complete field information