do not try to display a tab that was not built
This commit is contained in:
@@ -17,8 +17,8 @@ if (! defined('PHPMYADMIN')) {
|
||||
define('PMA_DBI_QUERY_STORE', 1); // Force STORE_RESULT method, ignored by classic MySQL.
|
||||
define('PMA_DBI_QUERY_UNBUFFERED', 2); // Do not read whole query
|
||||
// PMA_DBI_get_variable()
|
||||
define('PMA_DBI_GETVAR_SESSION', 1);
|
||||
define('PMA_DBI_GETVAR_GLOBAL', 2);
|
||||
define('PMA_DBI_GETVAR_SESSION', 1);
|
||||
define('PMA_DBI_GETVAR_GLOBAL', 2);
|
||||
|
||||
/**
|
||||
* Checks one of the mysql extensions
|
||||
@@ -33,7 +33,6 @@ function PMA_DBI_checkMysqlExtension($extension = 'mysql') {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* check for requested extension
|
||||
*/
|
||||
@@ -616,8 +615,13 @@ function PMA_DBI_get_databases_full($database = null, $force_stats = false,
|
||||
+= $row['Max_data_length'];
|
||||
$databases[$database_name]['SCHEMA_INDEX_LENGTH']
|
||||
+= $row['Index_length'];
|
||||
$databases[$database_name]['SCHEMA_DATA_FREE']
|
||||
+= $row['Data_free'];
|
||||
|
||||
// for InnoDB, this does not contain the number of
|
||||
// overhead bytes but the total free space
|
||||
if ('InnoDB' != $row['Engine']) {
|
||||
$databases[$database_name]['SCHEMA_DATA_FREE']
|
||||
+= $row['Data_free'];
|
||||
}
|
||||
$databases[$database_name]['SCHEMA_LENGTH']
|
||||
+= $row['Data_length'] + $row['Index_length'];
|
||||
}
|
||||
@@ -1330,13 +1334,35 @@ function PMA_DBI_get_triggers($db, $table)
|
||||
$one_result['action_timing'] = $trigger['ACTION_TIMING'];
|
||||
$one_result['event_manipulation'] = $trigger['EVENT_MANIPULATION'];
|
||||
|
||||
$one_result['full_trigger_name'] = PMA_backquote($trigger['TRIGGER_SCHEMA']) . '.' . PMA_backquote($trigger['TRIGGER_NAME']);
|
||||
// do not prepend the schema name; this way, importing the
|
||||
// definition into another schema will work
|
||||
$one_result['full_trigger_name'] = PMA_backquote($trigger['TRIGGER_NAME']);
|
||||
$one_result['drop'] = 'DROP TRIGGER IF EXISTS ' . $one_result['full_trigger_name'];
|
||||
$one_result['create'] = 'CREATE TRIGGER ' . $one_result['full_trigger_name'] . ' ' . $trigger['ACTION_TIMING']. ' ' . $trigger['EVENT_MANIPULATION'] . ' ON ' . PMA_backquote($trigger['EVENT_OBJECT_SCHEMA']) . '.' . PMA_backquote($trigger['EVENT_OBJECT_TABLE']) . "\n" . ' FOR EACH ROW ' . $trigger['ACTION_STATEMENT'] . "\n" . $delimiter . "\n";
|
||||
$one_result['create'] = 'CREATE TRIGGER ' . $one_result['full_trigger_name'] . ' ' . $trigger['ACTION_TIMING']. ' ' . $trigger['EVENT_MANIPULATION'] . ' ON ' . PMA_backquote($trigger['EVENT_OBJECT_TABLE']) . "\n" . ' FOR EACH ROW ' . $trigger['ACTION_STATEMENT'] . "\n" . $delimiter . "\n";
|
||||
|
||||
$result[] = $one_result;
|
||||
}
|
||||
}
|
||||
return($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns TRUE if $db.$view_name is a view, FALSE if not
|
||||
*
|
||||
* @uses PMA_DBI_fetch_result()
|
||||
* @param string $db database name
|
||||
* @param string $view_name view/table name
|
||||
*
|
||||
* @return bool TRUE if $db.$view_name is a view, FALSE if not
|
||||
*/
|
||||
function PMA_isView($db, $view_name)
|
||||
{
|
||||
$result = PMA_DBI_fetch_result("SELECT TABLE_NAME FROM information_schema.VIEWS WHERE TABLE_SCHEMA = '".$db."' and TABLE_NAME = '".$view_name."';");
|
||||
|
||||
if ($result) {
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user