Commit 35533dc0 authored by Aleksey Midenkov's avatar Aleksey Midenkov

MDEV-29727 ALTER and CREATE with default partitioning

	   differently react to SQL_MODE => unusable SHOW CREATE

Use abort_on_warning dependent on strict mode over create new table
like it is done for copy data and inplace alter.
parent f291c3df
set @old_sql_mode= @@sql_mode;
set @@sql_mode= '';
alter table mysql.plugin engine=myisam;
Warnings:
Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TRANSACTIONAL=1'
set @@sql_mode= @old_sql_mode;
set @old_dbug=@@debug_dbug;
call mtr.add_suppression("Index for table.*mysql.plugin.MYI");
call mtr.add_suppression("Index for table 'plugin' is corrupt; try to repair it");
......
......@@ -5,7 +5,10 @@ if (!$ADT_NULL_SO) {
skip No NULL_AUDIT plugin;
}
set @old_sql_mode= @@sql_mode;
set @@sql_mode= '';
alter table mysql.plugin engine=myisam;
set @@sql_mode= @old_sql_mode;
set @old_dbug=@@debug_dbug;
call mtr.add_suppression("Index for table.*mysql.plugin.MYI");
......
......@@ -1781,6 +1781,16 @@ t1 CREATE TABLE `t1` (
PARTITION `pn` CURRENT ENGINE = DEFAULT_ENGINE)
drop tables t1;
#
# MDEV-29727 ALTER and CREATE with default partitioning
# differently react to SQL_MODE => unusable SHOW CREATE
#
create table t (a int) with system versioning;
alter table t partition by system_time partitions 3;
ERROR HY000: Maybe missing parameters: no rotation condition for multiple HISTORY partitions.
drop table t;
create table t (a int) with system versioning partition by system_time partitions 3;
ERROR HY000: Maybe missing parameters: no rotation condition for multiple HISTORY partitions.
#
# End of 10.5 tests
#
set global innodb_stats_persistent= @save_persistent;
......@@ -1548,6 +1548,17 @@ show create table t1;
drop tables t1;
--echo #
--echo # MDEV-29727 ALTER and CREATE with default partitioning
--echo # differently react to SQL_MODE => unusable SHOW CREATE
--echo #
create table t (a int) with system versioning;
--error WARN_VERS_PARAMETERS
alter table t partition by system_time partitions 3;
drop table t;
--error WARN_VERS_PARAMETERS
create table t (a int) with system versioning partition by system_time partitions 3;
--echo #
--echo # End of 10.5 tests
--echo #
......
......@@ -10792,6 +10792,7 @@ do_continue:;
else
alter_info->flags|= ALTER_INDEX_ORDER;
create_info->alias= alter_ctx.table_name;
thd->abort_on_warning= !ignore && thd->is_strict_mode();
/*
Partitioning: part_info is passed via thd->work_part_info
*/
......@@ -10801,6 +10802,7 @@ do_continue:;
thd->lex->create_info, create_info, alter_info,
C_ALTER_TABLE_FRM_ONLY, NULL,
&key_info, &key_count, &frm);
thd->abort_on_warning= false;
reenable_binlog(thd);
if (unlikely(error))
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment