use PMA_Table::sGetStatusInfo() for table information retrieval
This commit is contained in:
@@ -76,11 +76,8 @@ while ($row = PMA_DBI_fetch_assoc($rowset)) {
|
|||||||
* Gets table informations
|
* Gets table informations
|
||||||
*/
|
*/
|
||||||
// The 'show table' statement works correct since 3.23.03
|
// The 'show table' statement works correct since 3.23.03
|
||||||
$showtable = PMA_DBI_get_tables_full($db, $table);
|
$num_rows = PMA_Table::sGetStatusInfo($db, $table, 'TABLE_ROWS');
|
||||||
$num_rows = (isset($showtable[$table]['TABLE_ROWS']) ? $showtable[$table]['TABLE_ROWS'] : 0);
|
$show_comment = PMA_Table::sGetStatusInfo($db, $table, 'TABLE_COMMENT');
|
||||||
$show_comment = (isset($showtable[$table]['TABLE_COMMENT']) ? $showtable[$table]['TABLE_COMMENT'] : '');
|
|
||||||
unset($showtable);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets table keys and retains them
|
* Gets table keys and retains them
|
||||||
|
@@ -632,18 +632,18 @@ class PMA_RT_Table {
|
|||||||
}
|
}
|
||||||
// load fields
|
// load fields
|
||||||
//check to see if it will load all fields or only the foreign keys
|
//check to see if it will load all fields or only the foreign keys
|
||||||
if ($show_keys) {
|
if ($show_keys) {
|
||||||
$indexes = PMA_Index::getFromTable($this->table_name, $db);
|
$indexes = PMA_Index::getFromTable($this->table_name, $db);
|
||||||
$all_columns = array();
|
$all_columns = array();
|
||||||
foreach ($indexes as $index) {
|
foreach ($indexes as $index) {
|
||||||
$all_columns = array_merge($all_columns, array_flip(array_keys($index->getColumns())));
|
$all_columns = array_merge($all_columns, array_flip(array_keys($index->getColumns())));
|
||||||
}
|
}
|
||||||
$this->fields = array_keys($all_columns);
|
$this->fields = array_keys($all_columns);
|
||||||
} else {
|
} else {
|
||||||
while ($row = PMA_DBI_fetch_row($result)) {
|
while ($row = PMA_DBI_fetch_row($result)) {
|
||||||
$this->fields[] = $row[0];
|
$this->fields[] = $row[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// height and width
|
// height and width
|
||||||
$this->PMA_RT_Table_setWidth($ff);
|
$this->PMA_RT_Table_setWidth($ff);
|
||||||
$this->PMA_RT_Table_setHeight();
|
$this->PMA_RT_Table_setHeight();
|
||||||
@@ -1152,16 +1152,12 @@ function PMA_RT_DOC($alltables)
|
|||||||
/**
|
/**
|
||||||
* Gets table informations
|
* Gets table informations
|
||||||
*/
|
*/
|
||||||
$result = PMA_DBI_query('SHOW TABLE STATUS LIKE \'' . PMA_sqlAddslashes($table, true) . '\';', null, PMA_DBI_QUERY_STORE);
|
$showtable = PMA_Table::sGetStatusInfo($db, $table);
|
||||||
$showtable = PMA_DBI_fetch_assoc($result);
|
$num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
|
||||||
$num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
|
|
||||||
$show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
|
$show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
|
||||||
$create_time = (isset($showtable['Create_time']) ? PMA_localisedDate(strtotime($showtable['Create_time'])) : '');
|
$create_time = (isset($showtable['Create_time']) ? PMA_localisedDate(strtotime($showtable['Create_time'])) : '');
|
||||||
$update_time = (isset($showtable['Update_time']) ? PMA_localisedDate(strtotime($showtable['Update_time'])) : '');
|
$update_time = (isset($showtable['Update_time']) ? PMA_localisedDate(strtotime($showtable['Update_time'])) : '');
|
||||||
$check_time = (isset($showtable['Check_time']) ? PMA_localisedDate(strtotime($showtable['Check_time'])) : '');
|
$check_time = (isset($showtable['Check_time']) ? PMA_localisedDate(strtotime($showtable['Check_time'])) : '');
|
||||||
|
|
||||||
PMA_DBI_free_result($result);
|
|
||||||
unset($result);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets table keys and retains them
|
* Gets table keys and retains them
|
||||||
|
@@ -92,12 +92,9 @@ foreach ($the_tables as $key => $table) {
|
|||||||
/**
|
/**
|
||||||
* Gets table informations
|
* Gets table informations
|
||||||
*/
|
*/
|
||||||
$result = PMA_DBI_query(
|
$showtable = PMA_Table::sGetStatusInfo($db, $table);
|
||||||
'SHOW TABLE STATUS LIKE \'' . PMA_sqlAddslashes($table, true) . '\';');
|
|
||||||
$showtable = PMA_DBI_fetch_assoc($result);
|
|
||||||
$num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
|
$num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
|
||||||
$show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
|
$show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
|
||||||
PMA_DBI_free_result($result);
|
|
||||||
|
|
||||||
$tbl_is_view = PMA_Table::isView($db, $table);
|
$tbl_is_view = PMA_Table::isView($db, $table);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user