Fixes issue #11399.

- Also some changes were made to prevent same kind of bug from occuring again

Signed-off-by: Jason <jason.daurus@gmail.com>
This commit is contained in:
Jason 2015-08-21 01:41:44 +08:00 committed by Marc Delisle
parent 88132a7fc6
commit fb2fb18dcd
5 changed files with 10 additions and 12 deletions

View File

@ -165,8 +165,8 @@ class PMA_Menu
private function _getBreadcrumbs()
{
$retval = '';
$table = new PMA_Table($this->_table, $this->_db);
$tbl_is_view = $table->isView();
$tbl_is_view = $GLOBALS['dbi']->getTable($this->_db, $this->_table)
->isView();
$server_info = ! empty($GLOBALS['cfg']['Server']['verbose'])
? $GLOBALS['cfg']['Server']['verbose']
: $GLOBALS['cfg']['Server']['host'];
@ -299,8 +299,8 @@ class PMA_Menu
private function _getTableTabs()
{
$db_is_system_schema = $GLOBALS['dbi']->isSystemSchema($this->_db);
$table = new PMA_Table($this->_table, $this->_db);
$tbl_is_view = $table->isView();
$tbl_is_view = $GLOBALS['dbi']->getTable($this->_db, $this->_table)
->isView();
$is_superuser = $GLOBALS['dbi']->isSuperuser();
$isCreateOrGrantUser = $GLOBALS['dbi']->isUserType('grant')
|| $GLOBALS['dbi']->isUserType('create');

View File

@ -850,10 +850,9 @@ function PMA_exportTable(
// If this is an export of a single view, we have to export data;
// for example, a PDF report
// if it is a merge table, no data is exported
$table = new PMA_Table($table, $db);
if (($whatStrucOrData == 'data'
|| $whatStrucOrData == 'structure_and_data')
&& ! $table->isMerge()
&& ! $GLOBALS['dbi']->getTable($db, $table)->isMerge()
) {
if (! empty($sql_query)) {
// only preg_replace if needed

View File

@ -467,8 +467,7 @@ function PMA_copyTables($tables_full, $move, $db)
// do not copy the data from a Merge table
// note: on the calling FORM, 'data' means 'structure and data'
$table = new PMA_Table($each_table, $db);
if ($table->isMerge()) {
if ($GLOBALS['dbi']->getTable($db, $each_table)->isMerge()) {
if ($this_what == 'data') {
$this_what = 'structure';
}

View File

@ -239,8 +239,8 @@ for ($columnNumber = 0; $columnNumber < $num_fields; $columnNumber++) {
'VIRTUAL', 'PERSISTENT', 'VIRTUAL GENERATED', 'STORED GENERATED'
);
if (in_array($columnMeta['Extra'], $virtual)) {
$table = new PMA_Table($GLOBALS['table'], $GLOBALS['db']);
$expressions = $table->getColumnGenerationExpression(
$tableObj = new PMA_Table($GLOBALS['table'], $GLOBALS['db']);
$expressions = $tableObj->getColumnGenerationExpression(
$columnMeta['Field']
);
$columnMeta['Expression'] = $expressions[$columnMeta['Field']];

View File

@ -192,8 +192,8 @@ if ($last_version > 0) {
);
}
$table = new PMA_Table($GLOBALS['table'], $GLOBALS['db']);
$type = $table->isView() ? 'view' : 'table';
$type = $GLOBALS['dbi']->getTable($GLOBALS['db'], $GLOBALS['table'])
->isView() ? 'view' : 'table';
$html .= PMA_getHtmlForDataDefinitionAndManipulationStatements(
'tbl_tracking.php' . $url_query,
$last_version,