From 713355f1dc929ff2c5ae3d65d33f867c8c6fdfbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 25 Oct 2005 21:47:09 +0000 Subject: [PATCH] Allow to change auto_increment for InnoDB, supported since MySQL 5.0.3 (bug #1337873). --- ChangeLog | 2 ++ tbl_properties_operations.php | 31 +++++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 15a8fbefe..44b8bcfd4 100755 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ $Source$ 2005-10-25 Michal Čihař * lang/english: "Log in" is correct naming for action (RFE #945440). + * tbl_properties_operations.php: Allow to change auto_increment for + InnoDB, supported since MySQL 5.0.3 (bug #1337873). 2005-10-24 Michal Čihař * tbl_properties_operations.php: Fix changing table attributes, reread new diff --git a/tbl_properties_operations.php b/tbl_properties_operations.php index e1fe363ff..5fcb3d643 100644 --- a/tbl_properties_operations.php +++ b/tbl_properties_operations.php @@ -52,11 +52,17 @@ if (isset($submitcollation)) { unset($tbl_collation); } if (isset($submitoptions)) { - $sql_query = 'ALTER TABLE ' . PMA_backquote($table) - . (isset($new_pack_keys) ? ' pack_keys=1': ' pack_keys=0') - . (isset($new_checksum) ? ' checksum=1': ' checksum=0') - . (isset($new_delay_key_write) ? ' delay_key_write=1': ' delay_key_write=0') - . (!empty($new_auto_increment) ? ' auto_increment=' . PMA_sqlAddslashes($new_auto_increment) : ''); + $sql_query = 'ALTER TABLE ' . PMA_backquote($table); + if ($tbl_type == 'MYISAM' || $tbl_type == 'ISAM') { + $sql_query .= isset($new_pack_keys) ? ' pack_keys=1': ' pack_keys=0'; + } + if ($tbl_type == 'MYISAM') { + $sql_query .= (isset($new_checksum) ? ' checksum=1': ' checksum=0') + . (isset($new_delay_key_write) ? ' delay_key_write=1': ' delay_key_write=0'); + } + if ($tbl_type == 'MYISAM' ||($tbl_type == 'INNODB' && PMA_MYSQL_INT_VERSION >= 50003)) { + $sql_query .= !empty($new_auto_increment) ? ' auto_increment=' . PMA_sqlAddslashes($new_auto_increment) : ''; + } $result = PMA_DBI_query($sql_query); $message = $strSuccess; require('./tbl_properties_table_info.php'); @@ -361,9 +367,10 @@ for ($i = 0; $i < $num_dbs; $i++) { . ' ' . "\n"; } // PACK_KEYS: MyISAM or ISAM - // DELAY_KEY_WRITE, CHECKSUM, AUTO_INCREMENT: MyISAM only + // DELAY_KEY_WRITE, CHECKSUM, : MyISAM only + // AUTO_INCREMENT: MyISAM and InnoDB since 5.0.3 - if ($tbl_type == 'MYISAM' || $tbl_type == 'ISAM') { + if ($tbl_type == 'MYISAM' || $tbl_type == 'ISAM' || ($tbl_type == 'INNODB' && PMA_MYSQL_INT_VERSION >= 50003)) { ?>
@@ -375,9 +382,13 @@ for ($i = 0; $i < $num_dbs; $i++) { + style="vertical-align: middle" />
style="vertical-align: middle" />
+ = 50003)) { + ?> style="width: 30px; vertical-align: middle" />