MARIA: TRANSACTIONAL create option (in Operations)
This commit is contained in:
@@ -657,6 +657,7 @@ $PMA_SQPdata_reserved_word = array (
|
|||||||
'THEN',
|
'THEN',
|
||||||
'TO',
|
'TO',
|
||||||
'TRAILING',
|
'TRAILING',
|
||||||
|
'TRANSACTIONAL', // 5.1 ?
|
||||||
'TRUNCATE',
|
'TRUNCATE',
|
||||||
'TYPE',
|
'TYPE',
|
||||||
'TYPES',
|
'TYPES',
|
||||||
@@ -684,7 +685,7 @@ $PMA_SQPdata_reserved_word = array (
|
|||||||
*
|
*
|
||||||
* @global integer MySQL reserved words count
|
* @global integer MySQL reserved words count
|
||||||
*/
|
*/
|
||||||
$PMA_SQPdata_reserved_word_cnt = 282;
|
$PMA_SQPdata_reserved_word_cnt = 283;
|
||||||
/**
|
/**
|
||||||
* The previous array must be sorted so that the binary search work.
|
* The previous array must be sorted so that the binary search work.
|
||||||
* Sometimes a word is not added in the correct order, so
|
* Sometimes a word is not added in the correct order, so
|
||||||
|
@@ -88,7 +88,7 @@ if ($table_info_result && PMA_DBI_num_rows($table_info_result) > 0) {
|
|||||||
? explode(' ', $showtable['Create_options'])
|
? explode(' ', $showtable['Create_options'])
|
||||||
: array();
|
: array();
|
||||||
|
|
||||||
// export create options by its name as variables into gloabel namespace
|
// export create options by its name as variables into global namespace
|
||||||
// f.e. pack_keys=1 becomes available as $pack_keys with value of '1'
|
// f.e. pack_keys=1 becomes available as $pack_keys with value of '1'
|
||||||
unset($pack_keys);
|
unset($pack_keys);
|
||||||
foreach ($create_options as $each_create_option) {
|
foreach ($create_options as $each_create_option) {
|
||||||
|
@@ -48,10 +48,19 @@ PMA_DBI_select_db($GLOBALS['db']);
|
|||||||
require './libraries/tbl_info.inc.php';
|
require './libraries/tbl_info.inc.php';
|
||||||
|
|
||||||
// define some globals here, for improved syntax in the conditionals
|
// define some globals here, for improved syntax in the conditionals
|
||||||
$is_myisam_or_maria = $is_isam = $is_innodb = $is_berkeleydb = false;
|
$is_myisam_or_maria = $is_isam = $is_innodb = $is_berkeleydb = $is_maria = false;
|
||||||
// set initial value of these globals, based on the current table engine
|
// 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_type);
|
||||||
|
|
||||||
|
if ($is_maria) {
|
||||||
|
// the value for transactional can be implicit
|
||||||
|
// (no create option found, in this case it means 1)
|
||||||
|
// or explicit (option found with a value of 0 or 1)
|
||||||
|
// ($transactional may have been set by libraries/tbl_info.inc.php,
|
||||||
|
// from the $create_options)
|
||||||
|
$transactional = (isset($transactional) && $transactional == '0') ? '0' : '1';
|
||||||
|
}
|
||||||
|
|
||||||
$reread_info = false;
|
$reread_info = false;
|
||||||
$table_alters = array();
|
$table_alters = array();
|
||||||
|
|
||||||
@@ -102,6 +111,12 @@ if (isset($_REQUEST['submitoptions'])) {
|
|||||||
$table_alters[] = 'checksum = ' . $_REQUEST['new_checksum'];
|
$table_alters[] = 'checksum = ' . $_REQUEST['new_checksum'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$_REQUEST['new_transactional'] = empty($_REQUEST['new_transactional']) ? '0' : '1';
|
||||||
|
if ($is_maria
|
||||||
|
&& $_REQUEST['new_transactional'] !== $transactional) {
|
||||||
|
$table_alters[] = 'TRANSACTIONAL = ' . $_REQUEST['new_transactional'];
|
||||||
|
}
|
||||||
|
|
||||||
$delay_key_write = empty($delay_key_write) ? '0' : '1';
|
$delay_key_write = empty($delay_key_write) ? '0' : '1';
|
||||||
$_REQUEST['new_delay_key_write'] = empty($_REQUEST['new_delay_key_write']) ? '0' : '1';
|
$_REQUEST['new_delay_key_write'] = empty($_REQUEST['new_delay_key_write']) ? '0' : '1';
|
||||||
if ($is_myisam_or_maria
|
if ($is_myisam_or_maria
|
||||||
@@ -347,10 +362,24 @@ if ($is_myisam_or_maria) {
|
|||||||
<?php
|
<?php
|
||||||
} // end if (MYISAM)
|
} // end if (MYISAM)
|
||||||
|
|
||||||
|
if ($is_maria) {
|
||||||
|
?>
|
||||||
|
<tr><td><label for="new_transactional">TRANSACTIONAL</label></td>
|
||||||
|
<td><input type="checkbox" name="new_transactional" id="new_transactional"
|
||||||
|
value="1"
|
||||||
|
<?php echo (isset($transactional) && $transactional == 1)
|
||||||
|
? ' checked="checked"'
|
||||||
|
: ''; ?> />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
} // end if (MARIA)
|
||||||
|
|
||||||
if (isset($auto_increment) && strlen($auto_increment) > 0
|
if (isset($auto_increment) && strlen($auto_increment) > 0
|
||||||
&& ($is_myisam_or_maria || $is_innodb)) {
|
&& ($is_myisam_or_maria || $is_innodb)) {
|
||||||
?>
|
?>
|
||||||
<tr><td><label for="auto_increment_opt">auto_increment</label></td>
|
<tr><td><label for="auto_increment_opt">AUTO_INCREMENT</label></td>
|
||||||
<td><input type="text" name="new_auto_increment" id="auto_increment_opt"
|
<td><input type="text" name="new_auto_increment" id="auto_increment_opt"
|
||||||
value="<?php echo $auto_increment; ?>" /></td>
|
value="<?php echo $auto_increment; ?>" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -614,13 +643,14 @@ require_once './libraries/footer.inc.php';
|
|||||||
|
|
||||||
function PMA_set_global_variables_for_engine($tbl_type)
|
function PMA_set_global_variables_for_engine($tbl_type)
|
||||||
{
|
{
|
||||||
global $is_myisam_or_maria, $is_innodb, $is_isam, $is_berkeleydb;
|
global $is_myisam_or_maria, $is_innodb, $is_isam, $is_berkeleydb, $is_maria;
|
||||||
|
|
||||||
$is_myisam_or_maria = $is_isam = $is_innodb = $is_berkeleydb = false;
|
$is_myisam_or_maria = $is_isam = $is_innodb = $is_berkeleydb = $is_maria = false;
|
||||||
$upper_tbl_type = strtoupper($tbl_type);
|
$upper_tbl_type = strtoupper($tbl_type);
|
||||||
|
|
||||||
//Options that apply to MYISAM usually apply to MARIA
|
//Options that apply to MYISAM usually apply to MARIA
|
||||||
$is_myisam_or_maria = ($upper_tbl_type == 'MYISAM' || $upper_tbl_type == 'MARIA');
|
$is_myisam_or_maria = ($upper_tbl_type == 'MYISAM' || $upper_tbl_type == 'MARIA');
|
||||||
|
$is_maria = ($upper_tbl_type == 'MARIA');
|
||||||
|
|
||||||
$is_isam = ($upper_tbl_type == 'ISAM');
|
$is_isam = ($upper_tbl_type == 'ISAM');
|
||||||
$is_innodb = ($upper_tbl_type == 'INNODB');
|
$is_innodb = ($upper_tbl_type == 'INNODB');
|
||||||
|
Reference in New Issue
Block a user