Merge remote-tracking branch 'origin/master'

This commit is contained in:
Michal Čihař 2012-04-08 16:56:18 +02:00
commit 88ec480dbb
6 changed files with 48 additions and 48 deletions

View File

@ -24,7 +24,7 @@ PMA_checkParameters(array('db', 'table'));
* Defining global variables, in case this script is included by a function.
* This is necessary because this script can be included by libraries/header.inc.php.
*/
global $showtable, $tbl_is_view, $tbl_type, $show_comment, $tbl_collation,
global $showtable, $tbl_is_view, $tbl_storage_engine, $show_comment, $tbl_collation,
$table_info_num_rows, $auto_increment;
/**
@ -52,16 +52,16 @@ $GLOBALS['showtable'] = PMA_Table::sGetStatusInfo($GLOBALS['db'], $GLOBALS['tabl
// need this test because when we are creating a table, we get 0 rows
// from the SHOW TABLE query
// and we don't want to mess up the $tbl_type coming from the form
// and we don't want to mess up the $tbl_storage_engine coming from the form
if ($showtable) {
if (PMA_Table::isView($GLOBALS['db'], $GLOBALS['table'])) {
$tbl_is_view = true;
$tbl_type = __('View');
$tbl_storage_engine = __('View');
$show_comment = null;
} else {
$tbl_is_view = false;
$tbl_type = isset($showtable['Engine'])
$tbl_storage_engine = isset($showtable['Engine'])
? strtoupper($showtable['Engine'])
: '';
// a new comment could be coming from tbl_operations.php

View File

@ -669,8 +669,8 @@ if ($action == 'tbl_create.php') {
<td width="25">&nbsp;</td>
<td>
<?php
echo PMA_StorageEngine::getHtmlSelect('tbl_type', null,
(isset($_REQUEST['tbl_type']) ? $_REQUEST['tbl_type'] : null));
echo PMA_StorageEngine::getHtmlSelect('tbl_storage_engine', null,
(isset($_REQUEST['tbl_storage_engine']) ? $_REQUEST['tbl_storage_engine'] : null));
?>
</td>
<td width="25">&nbsp;</td>

View File

@ -186,8 +186,8 @@ if (isset($_REQUEST['do_save_data'])) {
. ' (' . $sql_query . ')';
// Adds table type, character set, comments and partition definition
if (!empty($_REQUEST['tbl_type']) && ($_REQUEST['tbl_type'] != 'Default')) {
$sql_query .= ' ENGINE = ' . $_REQUEST['tbl_type'];
if (!empty($_REQUEST['tbl_storage_engine']) && ($_REQUEST['tbl_storage_engine'] != 'Default')) {
$sql_query .= ' ENGINE = ' . $_REQUEST['tbl_storage_engine'];
}
if (!empty($_REQUEST['tbl_collation'])) {
$sql_query .= PMA_generateCharsetQueryPart($_REQUEST['tbl_collation']);

View File

@ -52,7 +52,7 @@ require 'libraries/tbl_info.inc.php';
// define some globals here, for improved syntax in the conditionals
$is_myisam_or_aria = $is_isam = $is_innodb = $is_berkeleydb = $is_aria = $is_pbxt = false;
// set initial value of these globals, based on the current table engine
PMA_set_global_variables_for_engine($tbl_type);
PMA_set_global_variables_for_engine($tbl_storage_engine);
if ($is_aria) {
// the value for transactional can be implicit
@ -104,12 +104,12 @@ if (isset($_REQUEST['submitoptions'])) {
&& urldecode($_REQUEST['prev_comment']) !== $_REQUEST['comment']) {
$table_alters[] = 'COMMENT = \'' . PMA_sqlAddSlashes($_REQUEST['comment']) . '\'';
}
if (! empty($_REQUEST['new_tbl_type'])
&& strtolower($_REQUEST['new_tbl_type']) !== strtolower($tbl_type)) {
$table_alters[] = 'ENGINE = ' . $_REQUEST['new_tbl_type'];
$tbl_type = $_REQUEST['new_tbl_type'];
if (! empty($_REQUEST['new_tbl_storage_engine'])
&& strtolower($_REQUEST['new_tbl_storage_engine']) !== strtolower($tbl_storage_engine)) {
$table_alters[] = 'ENGINE = ' . $_REQUEST['new_tbl_storage_engine'];
$tbl_storage_engine = $_REQUEST['new_tbl_storage_engine'];
// reset the globals for the new engine
PMA_set_global_variables_for_engine($tbl_type);
PMA_set_global_variables_for_engine($tbl_storage_engine);
if ($is_aria) {
$transactional = (isset($transactional) && $transactional == '0') ? '0' : '1';
$page_checksum = (isset($page_checksum)) ? $page_checksum : '';
@ -178,7 +178,7 @@ if (isset($_REQUEST['submitoptions'])) {
// should not be reported with a Level of Error, so here
// I just ignore it. But there are other 1478 messages
// that it's better to show.
if (! ($_REQUEST['new_tbl_type'] == 'MyISAM' && $warning['Code'] == '1478' && $warning['Level'] == 'Error')) {
if (! ($_REQUEST['new_tbl_storage_engine'] == 'MyISAM' && $warning['Code'] == '1478' && $warning['Level'] == 'Error')) {
$warning_messages[] = $warning['Level'] . ': #' . $warning['Code']
. ' ' . $warning['Message'];
}
@ -374,7 +374,7 @@ if (strstr($show_comment, '; InnoDB free') === false) {
<tr><td><?php echo __('Storage Engine'); ?>
<?php echo PMA_showMySQLDocu('Storage_engines', 'Storage_engines'); ?>
</td>
<td><?php echo PMA_StorageEngine::getHtmlSelect('new_tbl_type', null, $tbl_type); ?>
<td><?php echo PMA_StorageEngine::getHtmlSelect('new_tbl_storage_engine', null, $tbl_storage_engine); ?>
</td>
</tr>
@ -509,11 +509,11 @@ unset($innodb_engine_plugin, $innodb_plugin_version, $innodb_file_format);
// does not return a warning
// (if the table was compressed, it can be seen on the Structure page)
if (isset($possible_row_formats[$tbl_type])) {
if (isset($possible_row_formats[$tbl_storage_engine])) {
$current_row_format = strtoupper($showtable['Row_format']);
echo '<tr><td><label for="new_row_format">ROW_FORMAT</label></td>';
echo '<td>';
echo PMA_generate_html_dropdown('new_row_format', $possible_row_formats[$tbl_type], $current_row_format, 'new_row_format');
echo PMA_generate_html_dropdown('new_row_format', $possible_row_formats[$tbl_storage_engine], $current_row_format, 'new_row_format');
unset($possible_row_formats, $current_row_format);
echo '</td>';
echo '</tr>';
@ -859,21 +859,21 @@ if ($cfgRelation['relwork'] && ! $is_innodb) {
require 'libraries/footer.inc.php';
function PMA_set_global_variables_for_engine($tbl_type)
function PMA_set_global_variables_for_engine($tbl_storage_engine)
{
global $is_myisam_or_aria, $is_innodb, $is_isam, $is_berkeleydb, $is_aria, $is_pbxt;
$is_myisam_or_aria = $is_isam = $is_innodb = $is_berkeleydb = $is_aria = $is_pbxt = false;
$upper_tbl_type = strtoupper($tbl_type);
$upper_tbl_storage_engine = strtoupper($tbl_storage_engine);
//Options that apply to MYISAM usually apply to ARIA
$is_myisam_or_aria = ($upper_tbl_type == 'MYISAM' || $upper_tbl_type == 'ARIA' || $upper_tbl_type == 'MARIA');
$is_aria = ($upper_tbl_type == 'ARIA');
$is_myisam_or_aria = ($upper_tbl_storage_engine == 'MYISAM' || $upper_tbl_storage_engine == 'ARIA' || $upper_tbl_storage_engine == 'MARIA');
$is_aria = ($upper_tbl_storage_engine == 'ARIA');
$is_isam = ($upper_tbl_type == 'ISAM');
$is_innodb = ($upper_tbl_type == 'INNODB');
$is_berkeleydb = ($upper_tbl_type == 'BERKELEYDB');
$is_pbxt = ($upper_tbl_type == 'PBXT');
$is_isam = ($upper_tbl_storage_engine == 'ISAM');
$is_innodb = ($upper_tbl_storage_engine == 'INNODB');
$is_berkeleydb = ($upper_tbl_storage_engine == 'BERKELEYDB');
$is_pbxt = ($upper_tbl_storage_engine == 'PBXT');
}
?>

View File

@ -132,7 +132,7 @@ $cfgRelation = PMA_getRelationsParam();
if ($cfgRelation['relwork']) {
$existrel = PMA_getForeigners($db, $table, '', 'internal');
}
if (PMA_foreignkey_supported($tbl_type)) {
if (PMA_foreignkey_supported($tbl_storage_engine)) {
$existrel_foreign = PMA_getForeigners($db, $table, '', 'foreign');
}
if ($cfgRelation['displaywork']) {
@ -336,7 +336,7 @@ if ($cfgRelation['displaywork'] && isset($display_field)) {
if (isset($destination) && $cfgRelation['relwork']) {
$existrel = PMA_getForeigners($db, $table, '', 'internal');
}
if (isset($destination_foreign) && PMA_foreignkey_supported($tbl_type)) {
if (isset($destination_foreign) && PMA_foreignkey_supported($tbl_storage_engine)) {
$existrel_foreign = PMA_getForeigners($db, $table, '', 'foreign');
}
@ -356,13 +356,13 @@ echo PMA_generate_common_hidden_inputs($db, $table);
// relations
if ($cfgRelation['relwork'] || PMA_foreignkey_supported($tbl_type)) {
if ($cfgRelation['relwork'] || PMA_foreignkey_supported($tbl_storage_engine)) {
// To choose relations we first need all tables names in current db
// and if the main table supports foreign keys
// we use SHOW TABLE STATUS because we need to find other tables of the
// same engine.
if (PMA_foreignkey_supported($tbl_type)) {
if (PMA_foreignkey_supported($tbl_storage_engine)) {
$tab_query = 'SHOW TABLE STATUS FROM ' . PMA_backquote($db);
// [0] of the row is the name
// [1] is the type
@ -383,9 +383,9 @@ if ($cfgRelation['relwork'] || PMA_foreignkey_supported($tbl_type)) {
// if foreign keys are supported, collect all keys from other
// tables of the same engine
if (PMA_foreignkey_supported($tbl_type)
if (PMA_foreignkey_supported($tbl_storage_engine)
&& isset($curr_table[1])
&& strtoupper($curr_table[1]) == $tbl_type
&& strtoupper($curr_table[1]) == $tbl_storage_engine
) {
// explicitely ask for non-quoted list of indexed columns
// need to obtain backquoted values to support dots inside values
@ -412,14 +412,14 @@ if (count($columns) > 0) {
<?php
if ($cfgRelation['relwork']) {
echo '<th>' . __('Internal relation');
if (PMA_foreignkey_supported($tbl_type)) {
if (PMA_foreignkey_supported($tbl_storage_engine)) {
echo PMA_showHint(__('An internal relation is not necessary when a corresponding FOREIGN KEY relation exists.'));
}
echo '</th>';
}
if (PMA_foreignkey_supported($tbl_type)) {
if (PMA_foreignkey_supported($tbl_storage_engine)) {
// this does not have to be translated, it's part of the MySQL syntax
echo '<th colspan="2">' . __('Foreign key constraint') . ' (' . $tbl_type . ')';
echo '<th colspan="2">' . __('Foreign key constraint') . ' (' . $tbl_storage_engine . ')';
echo '</th>';
}
?>
@ -476,7 +476,7 @@ if (count($columns) > 0) {
<?php
} // end if (internal relations)
if (PMA_foreignkey_supported($tbl_type)) {
if (PMA_foreignkey_supported($tbl_storage_engine)) {
echo '<td>';
if (!empty($save_row[$i]['Key'])) {
?>

View File

@ -374,7 +374,7 @@ foreach ($fields as $row) {
</td>
<td class="replaced_by_more center">
<?php
if ($type == 'text' || $type == 'blob' || 'ARCHIVE' == $tbl_type || ($primary && $primary->hasColumn($field_name))) {
if ($type == 'text' || $type == 'blob' || 'ARCHIVE' == $tbl_storage_engine || ($primary && $primary->hasColumn($field_name))) {
echo $titles['NoPrimary'] . "\n";
$primary_enabled = false;
} else {
@ -389,7 +389,7 @@ foreach ($fields as $row) {
</td>
<td class="replaced_by_more center">
<?php
if ($type == 'text' || $type == 'blob' || 'ARCHIVE' == $tbl_type || isset($columns_with_unique_index[$field_name])) {
if ($type == 'text' || $type == 'blob' || 'ARCHIVE' == $tbl_storage_engine || isset($columns_with_unique_index[$field_name])) {
echo $titles['NoUnique'] . "\n";
$unique_enabled = false;
} else {
@ -404,7 +404,7 @@ foreach ($fields as $row) {
</td>
<td class="replaced_by_more center">
<?php
if ($type == 'text' || $type == 'blob' || 'ARCHIVE' == $tbl_type) {
if ($type == 'text' || $type == 'blob' || 'ARCHIVE' == $tbl_storage_engine) {
echo $titles['NoIndex'] . "\n";
$index_enabled = false;
} else {
@ -424,7 +424,7 @@ foreach ($fields as $row) {
'geometry', 'point', 'linestring', 'polygon', 'multipoint',
'multilinestring', 'multipolygon', 'geomtrycollection'
);
if (! in_array($type, $spatial_types) || 'MYISAM' != $tbl_type) {
if (! in_array($type, $spatial_types) || 'MYISAM' != $tbl_storage_engine) {
echo $titles['NoSpatial'] . "\n";
$spatial_enabled = false;
} else {
@ -439,7 +439,7 @@ foreach ($fields as $row) {
?>
</td>
<?php
if (! empty($tbl_type) && ($tbl_type == 'MYISAM' || $tbl_type == 'ARIA' || $tbl_type == 'MARIA' || ($tbl_type == 'INNODB' && PMA_MYSQL_INT_VERSION >= 50604))
if (! empty($tbl_storage_engine) && ($tbl_storage_engine == 'MYISAM' || $tbl_storage_engine == 'ARIA' || $tbl_storage_engine == 'MARIA' || ($tbl_storage_engine == 'INNODB' && PMA_MYSQL_INT_VERSION >= 50604))
// FULLTEXT is possible on TEXT, CHAR and VARCHAR
&& (strpos(' ' . $type, 'text') || strpos(' ' . $type, 'char'))) {
echo "\n";
@ -571,16 +571,16 @@ PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_browse', __('Browse
if (! $tbl_is_view && ! $db_is_information_schema) {
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_change', __('Change'), 'b_edit.png', 'change');
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_drop', __('Drop'), 'b_drop.png', 'drop');
if ('ARCHIVE' != $tbl_type) {
if ('ARCHIVE' != $tbl_storage_engine) {
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_primary', __('Primary'), 'b_primary.png', 'primary');
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_unique', __('Unique'), 'b_unique.png', 'unique');
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_index', __('Index'), 'b_index.png', 'index');
}
if (! empty($tbl_type) && $tbl_type == 'MYISAM') {
if (! empty($tbl_storage_engine) && $tbl_storage_engine == 'MYISAM') {
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_spatial', __('Spatial'), 'b_spatial.png', 'spatial');
}
if (! empty($tbl_type) && ($tbl_type == 'MYISAM' || $tbl_type == 'ARIA' || $tbl_type == 'MARIA')) {
if (! empty($tbl_storage_engine) && ($tbl_storage_engine == 'MYISAM' || $tbl_storage_engine == 'ARIA' || $tbl_storage_engine == 'MARIA')) {
PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_fulltext', __('Fulltext'), 'b_ftext.png', 'ftext');
}
}
@ -617,8 +617,8 @@ echo PMA_getIcon('b_print.png', __('Print view'), true);
if (! $tbl_is_view && ! $db_is_information_schema) {
// if internal relations are available, or foreign keys are supported
// ($tbl_type comes from libraries/tbl_info.inc.php)
if ($cfgRelation['relwork'] || PMA_foreignkey_supported($tbl_type)) {
// ($tbl_storage_engine comes from libraries/tbl_info.inc.php)
if ($cfgRelation['relwork'] || PMA_foreignkey_supported($tbl_storage_engine)) {
?>
<a href="tbl_relation.php?<?php echo $url_query; ?>"><?php
echo PMA_getIcon('b_relations.png', __('Relation view'), true);
@ -689,7 +689,7 @@ if (count($fields) > 20) {
* Displays indexes
*/
if (! $tbl_is_view && ! $db_is_information_schema && 'ARCHIVE' != $tbl_type) {
if (! $tbl_is_view && ! $db_is_information_schema && 'ARCHIVE' != $tbl_storage_engine) {
PMA_generate_slider_effect('indexes', __('Indexes'));
/**
* Display indexes
@ -808,7 +808,7 @@ if ($cfg['ShowStats']) {
<?php
}
// Optimize link if overhead
if (isset($free_size) && !PMA_DRIZZLE && ($tbl_type == 'MYISAM' || $tbl_type == 'ARIA' || $tbl_type == 'MARIA' || $tbl_type == 'BDB')) {
if (isset($free_size) && !PMA_DRIZZLE && ($tbl_storage_engine == 'MYISAM' || $tbl_storage_engine == 'ARIA' || $tbl_storage_engine == 'MARIA' || $tbl_storage_engine == 'BDB')) {
?>
<tr class="tblFooters">
<td colspan="3" class="center">