diff options
author | Vlad Lesin <vlad_lesin@mail.ru> | 2020-06-15 13:40:50 +0300 |
---|---|---|
committer | Vlad Lesin <vlad_lesin@mail.ru> | 2020-06-15 19:41:04 +0300 |
commit | 676e532d6c59b1b8935a32117396056fa0de63ba (patch) | |
tree | 4a2567bb78694b85abcc76eeb728e3ed08a4621a | |
parent | c9f5cb97af6d3ef853f84a19602efea715016734 (diff) | |
download | mariadb-git-bb-10.5-MDEV-22726-aria-non-trans-log.tar.gz |
MDEV-22726: Add check that one can't change general or slow log to abb-10.5-MDEV-22726-aria-non-trans-log
transactional engine
-rw-r--r-- | mysql-test/main/log_tables.result | 6 | ||||
-rw-r--r-- | mysql-test/main/log_tables.test | 8 | ||||
-rw-r--r-- | sql/share/errmsg-utf8.txt | 2 | ||||
-rw-r--r-- | sql/sql_table.cc | 7 |
4 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/main/log_tables.result b/mysql-test/main/log_tables.result index 43f44c90b06..151ea366d9f 100644 --- a/mysql-test/main/log_tables.result +++ b/mysql-test/main/log_tables.result @@ -259,6 +259,12 @@ Warning 1286 Unknown storage engine 'NonExistentEngine' alter table mysql.slow_log engine=memory; ERROR HY000: Storage engine MEMORY cannot be used for log tables set default_storage_engine= @save_storage_engine; +ALTER TABLE mysql.general_log ENGINE=Aria; +ERROR HY000: Only non-transactional Aria table can be used for logging +ALTER TABLE mysql.general_log ENGINE=Aria transactional = 0; +ALTER TABLE mysql.slow_log ENGINE=Aria; +ERROR HY000: Only non-transactional Aria table can be used for logging +ALTER TABLE mysql.slow_log ENGINE=Aria transactional = 0; drop table mysql.slow_log; drop table mysql.general_log; drop table mysql.general_log; diff --git a/mysql-test/main/log_tables.test b/mysql-test/main/log_tables.test index 4622b09079f..c266f70312b 100644 --- a/mysql-test/main/log_tables.test +++ b/mysql-test/main/log_tables.test @@ -269,6 +269,14 @@ alter table mysql.slow_log engine=memory; #alter table mysql.slow_log engine=blackhole; set default_storage_engine= @save_storage_engine; +# Make sure only non-transactional Aria table can be used for logging +--error ER_TRANSACTIONAL_ARIA_LOG_ENGINE +ALTER TABLE mysql.general_log ENGINE=Aria; +ALTER TABLE mysql.general_log ENGINE=Aria transactional = 0; +--error ER_TRANSACTIONAL_ARIA_LOG_ENGINE +ALTER TABLE mysql.slow_log ENGINE=Aria; +ALTER TABLE mysql.slow_log ENGINE=Aria transactional = 0; + drop table mysql.slow_log; drop table mysql.general_log; diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 49cabec9916..befdc5287d8 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -7965,3 +7965,5 @@ ER_NOT_ALLOWED_IN_THIS_CONTEXT eng "'%-.128s' is not allowed in this context" ER_DATA_WAS_COMMITED_UNDER_ROLLBACK eng "Engine %s does not support rollback. Changes where commited during rollback call" +ER_TRANSACTIONAL_ARIA_LOG_ENGINE + eng "Only non-transactional Aria table can be used for logging" diff --git a/sql/sql_table.cc b/sql/sql_table.cc index e51ead077be..c25ef917d36 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -9849,6 +9849,13 @@ bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db, DBUG_RETURN(true); } + if (create_info->db_type == maria_hton && + create_info->transactional != HA_CHOICE_NO) + { + my_error(ER_TRANSACTIONAL_ARIA_LOG_ENGINE, MYF(0)); + DBUG_RETURN(true); + } + #ifdef WITH_PARTITION_STORAGE_ENGINE if (alter_info->partition_flags & ALTER_PARTITION_INFO) { |