diff --git a/libraries/Table.class.php b/libraries/Table.class.php index c55bf4703..3d1da42d3 100644 --- a/libraries/Table.class.php +++ b/libraries/Table.class.php @@ -255,9 +255,9 @@ class PMA_Table . ' (' . PMA_Table::countRecords($db, $table, true) . ')'; } - static public function sGetStatusInfo($db, $table, $info = null) + static public function sGetStatusInfo($db, $table, $info = null, $force_read = false) { - if (! isset(PMA_Table::$cache[$db][$table])) { + if (! isset(PMA_Table::$cache[$db][$table]) || $force_read) { PMA_Table::$cache[$db][$table] = PMA_DBI_fetch_single_row('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . $table . '\''); } @@ -265,7 +265,7 @@ class PMA_Table return PMA_Table::$cache[$db][$table]; } - if (! isset(PMA_Table::$cache[$db][$table][$info])) { + if (! isset(PMA_Table::$cache[$db][$table][$info]) || $force_read) { PMA_Table::$cache[$db][$table] = PMA_DBI_fetch_single_row('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . $table . '\''); } return PMA_Table::$cache[$db][$table][$info]; diff --git a/libraries/tbl_info.inc.php b/libraries/tbl_info.inc.php index dad487033..8fea9d818 100644 --- a/libraries/tbl_info.inc.php +++ b/libraries/tbl_info.inc.php @@ -36,7 +36,11 @@ global $showtable, $tbl_is_view, $tbl_type, $show_comment, $tbl_collation, // otherwise error #1046, no database selected PMA_DBI_select_db($GLOBALS['db']); -$showtable = PMA_Table::sGetStatusInfo($GLOBALS['db'], $GLOBALS['table']); +// PMA_Table::sGetStatusInfo() does caching by default, but here +// we force reading of the current table status +// if $reread_info is true (for example, coming from tbl_operations.php +// and we just changed the table's storage engine) +$showtable = PMA_Table::sGetStatusInfo($GLOBALS['db'], $GLOBALS['table'], null, (isset($reread_info) && $reread_info ? true : false)); // need this test because when we are creating a table, we get 0 rows // from the SHOW TABLE query