diff options
author | unknown <sanja@mysql.com> | 2008-09-28 21:32:59 +0300 |
---|---|---|
committer | unknown <sanja@mysql.com> | 2008-09-28 21:32:59 +0300 |
commit | 48e6036ca7fb1ee3f23805c18dc189cbe43a9f2a (patch) | |
tree | 92bff3106f3387a528db21b436ac74fcd327347e | |
parent | 1134257023c4e47e4c45756b51eb5c7b8d804165 (diff) | |
download | mariadb-git-48e6036ca7fb1ee3f23805c18dc189cbe43a9f2a.tar.gz |
Comparison of tables during altering fixed. (BUG#39399)
mysql-test/r/maria.result:
Test suite of BUG#39399.
mysql-test/t/maria.test:
Test suite of BUG#39399.
storage/maria/ha_maria.cc:
Comparison of tables during altering fixed. (BUG#39399)
Unused function parameter removed.
-rw-r--r-- | mysql-test/r/maria.result | 6 | ||||
-rw-r--r-- | mysql-test/t/maria.test | 11 | ||||
-rw-r--r-- | storage/maria/ha_maria.cc | 13 |
3 files changed, 23 insertions, 7 deletions
diff --git a/mysql-test/r/maria.result b/mysql-test/r/maria.result index fb8537551c8..2cfc21a5778 100644 --- a/mysql-test/r/maria.result +++ b/mysql-test/r/maria.result @@ -2284,3 +2284,9 @@ insert into v1 (f1) values (3) on duplicate key update f1= f3 + 10; insert into v1 (f1) values (3) on duplicate key update f1= f3 + 10; drop table t1,t2; drop view v1; +CREATE TABLE t1 (id int, c varchar(10)) engine=maria; +INSERT INTO t1 VALUES (1,"1"); +ALTER TABLE t1 CHANGE c d varchar(10); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +drop table t1; diff --git a/mysql-test/t/maria.test b/mysql-test/t/maria.test index e35276f698d..c21dfd43bd3 100644 --- a/mysql-test/t/maria.test +++ b/mysql-test/t/maria.test @@ -1575,3 +1575,14 @@ insert into v1 (f1) values (3) on duplicate key update f1= f3 + 10; insert into v1 (f1) values (3) on duplicate key update f1= f3 + 10; drop table t1,t2; drop view v1; + +# +# BUG#39399 ALTER TABLE renaming column: affected_rows > 0 +# + +CREATE TABLE t1 (id int, c varchar(10)) engine=maria; +INSERT INTO t1 VALUES (1,"1"); +--enable_info +ALTER TABLE t1 CHANGE c d varchar(10); +--disable_info +drop table t1; diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 62a813415b7..64e5746cc4c 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -2605,10 +2605,9 @@ enum row_type ha_maria::get_row_type() const } -static enum data_file_type maria_row_type(HA_CREATE_INFO *info, - my_bool ignore_transactional) +static enum data_file_type maria_row_type(HA_CREATE_INFO *info) { - if (info->transactional == HA_CHOICE_YES && ! ignore_transactional) + if (info->transactional == HA_CHOICE_YES) return BLOCK_RECORD; switch (info->row_type) { case ROW_TYPE_FIXED: return STATIC_RECORD; @@ -2641,7 +2640,7 @@ int ha_maria::create(const char *name, register TABLE *table_arg, } } /* Note: BLOCK_RECORD is used if table is transactional */ - row_type= maria_row_type(ha_create_info, 0); + row_type= maria_row_type(ha_create_info); if (ha_create_info->transactional == HA_CHOICE_YES && ha_create_info->row_type != ROW_TYPE_PAGE && ha_create_info->row_type != ROW_TYPE_NOT_USED && @@ -2825,15 +2824,15 @@ bool ha_maria::check_if_incompatible_data(HA_CREATE_INFO *create_info, if (create_info->auto_increment_value != stats.auto_increment_value || create_info->data_file_name != data_file_name || create_info->index_file_name != index_file_name || - (maria_row_type(create_info, 1) != data_file_type && + (maria_row_type(create_info) != data_file_type && create_info->row_type != ROW_TYPE_DEFAULT) || table_changes == IS_EQUAL_NO || table_changes & IS_EQUAL_PACK_LENGTH) // Not implemented yet return COMPATIBLE_DATA_NO; - if ((options & (HA_OPTION_PACK_RECORD | HA_OPTION_CHECKSUM | + if ((options & (HA_OPTION_CHECKSUM | HA_OPTION_DELAY_KEY_WRITE)) != - (create_info->table_options & (HA_OPTION_PACK_RECORD | HA_OPTION_CHECKSUM | + (create_info->table_options & (HA_OPTION_CHECKSUM | HA_OPTION_DELAY_KEY_WRITE))) return COMPATIBLE_DATA_NO; return COMPATIBLE_DATA_YES; |