diff options
-rw-r--r-- | mysql-test/suite/maria/maria-ucs2.result | 1 | ||||
-rw-r--r-- | mysql-test/suite/maria/maria3.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/maria/maria3.test | 2 | ||||
-rw-r--r-- | sql/handler.h | 1 | ||||
-rw-r--r-- | sql/sql_table.cc | 24 | ||||
-rw-r--r-- | storage/maria/ha_maria.cc | 9 |
6 files changed, 21 insertions, 18 deletions
diff --git a/mysql-test/suite/maria/maria-ucs2.result b/mysql-test/suite/maria/maria-ucs2.result index e7258f21d4f..fab640f703a 100644 --- a/mysql-test/suite/maria/maria-ucs2.result +++ b/mysql-test/suite/maria/maria-ucs2.result @@ -17,7 +17,6 @@ test.t1 check status OK ALTER TABLE t1 MODIFY a VARCHAR(800) CHARSET `ucs2`; Warnings: Warning 1071 Specified key was too long; max key length is 1000 bytes -Warning 1071 Specified key was too long; max key length is 1000 bytes CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK diff --git a/mysql-test/suite/maria/maria3.result b/mysql-test/suite/maria/maria3.result index 27d72b75930..84ba81aae4d 100644 --- a/mysql-test/suite/maria/maria3.result +++ b/mysql-test/suite/maria/maria3.result @@ -460,7 +460,7 @@ id f1 1 test1 2 test2 drop table t1; -SET SQL_MODE = 'TRADITIONAL'; +SET SQL_MODE = ''; create table t1 (n int not null primary key auto_increment, c char(1), unique(c)); insert into t1 values(100, "a"); insert into t1 values(300, "b"); diff --git a/mysql-test/suite/maria/maria3.test b/mysql-test/suite/maria/maria3.test index f1d95a15ba5..b4e3e30d63f 100644 --- a/mysql-test/suite/maria/maria3.test +++ b/mysql-test/suite/maria/maria3.test @@ -364,7 +364,7 @@ INSERT IGNORE INTO t1 (f1) VALUES ("test1"); INSERT IGNORE INTO t1 (f1) VALUES ("test2"); SELECT * FROM t1; drop table t1; -SET SQL_MODE = 'TRADITIONAL'; +SET SQL_MODE = ''; create table t1 (n int not null primary key auto_increment, c char(1), unique(c)); insert into t1 values(100, "a"); diff --git a/sql/handler.h b/sql/handler.h index dc202ad9525..0a9933cd028 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -401,7 +401,6 @@ enum legacy_db_type enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED, ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED, ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT, - /** Unused. Reserved for future versions. */ ROW_TYPE_PAGE }; /* Specifies data storage format for individual columns */ diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 9a3db12dc4b..313366c7792 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4023,6 +4023,18 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, } } + /* Give warnings for not supported table options */ +#if defined(WITH_ARIA_STORAGE_ENGINE) + extern handlerton *maria_hton; + if (file->ht != maria_hton) +#endif + if (create_info->transactional) + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_ILLEGAL_HA_CREATE_OPTION, + ER(ER_ILLEGAL_HA_CREATE_OPTION), + file->engine_name()->str, + "TRANSACTIONAL=1"); + if (parse_option_list(thd, &create_info->option_struct, create_info->option_list, file->partition_ht()->table_options, FALSE, @@ -4506,18 +4518,6 @@ bool create_table_impl(THD *thd, goto err; } - /* Give warnings for not supported table options */ -#if defined(WITH_ARIA_STORAGE_ENGINE) - extern handlerton *maria_hton; - if (file->ht != maria_hton) -#endif - if (create_info->transactional) - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_ILLEGAL_HA_CREATE_OPTION, - ER(ER_ILLEGAL_HA_CREATE_OPTION), - file->engine_name()->str, - "TRANSACTIONAL=1"); - if (!internal_tmp_table && !(create_info->options & HA_LEX_CREATE_TMP_TABLE)) { char frm_name[FN_REFLEN+1]; diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index b17c1dd7907..24a6eb2ba80 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -2954,9 +2954,12 @@ void ha_maria::update_create_info(HA_CREATE_INFO *create_info) } create_info->data_file_name= data_file_name; create_info->index_file_name= index_file_name; - /* We need to restore the row type as Maria can change it */ + /* + Keep user-specified row_type for ALTER, + but show the actually used one in SHOW + */ if (create_info->row_type != ROW_TYPE_DEFAULT && - !(create_info->used_fields & HA_CREATE_USED_ROW_FORMAT)) + !(thd_sql_command(ha_thd()) == SQLCOM_ALTER_TABLE)) create_info->row_type= get_row_type(); /* Show always page checksums, as this can be forced with @@ -3211,6 +3214,8 @@ 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 || + create_info->page_checksum != table->s->page_checksum || + create_info->transactional != table->s->transactional || (maria_row_type(create_info) != data_file_type && create_info->row_type != ROW_TYPE_DEFAULT) || table_changes == IS_EQUAL_NO || |