Skip to content

Commit

Permalink
MDEV-22178 Assertion `info->alias.str' failed in partition_info::chec…
Browse files Browse the repository at this point in the history
…k_partition_info instead of ER_VERS_WRONG_PARTS

Assign create_info->alias for ALTER TABLE since it is NULL and later
accessed for printing error message.
  • Loading branch information
midenok committed Dec 22, 2020
1 parent c742346 commit d4258f3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mysql-test/suite/versioning/r/partition.result
Original file line number Diff line number Diff line change
Expand Up @@ -683,4 +683,11 @@ create table t1 (a int) with system versioning partition by system_time
alter table t1 add partition (partition p2);
ERROR HY000: Wrong partitioning type, expected type: `SYSTEM_TIME`
drop table t1;
#
# MDEV-22178 Assertion `info->alias.str' failed in partition_info::check_partition_info instead of ER_VERS_WRONG_PARTS
#
create or replace table t1 (a int) with system versioning;
alter table t1 partition by system_time (partition pn current);
ERROR HY000: Wrong partitions for `t1`: must have at least one HISTORY and exactly one last CURRENT
drop table t1;
# End of 10.3 tests
9 changes: 9 additions & 0 deletions mysql-test/suite/versioning/t/partition.test
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,15 @@ alter table t1 add partition (partition p2);
# Cleanup
drop table t1;

--echo #
--echo # MDEV-22178 Assertion `info->alias.str' failed in partition_info::check_partition_info instead of ER_VERS_WRONG_PARTS
--echo #
create or replace table t1 (a int) with system versioning;
--error ER_VERS_WRONG_PARTS
alter table t1 partition by system_time (partition pn current);
# Cleanup
drop table t1;

--echo # End of 10.3 tests

--source suite/versioning/common_finish.inc
1 change: 1 addition & 0 deletions sql/sql_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9850,6 +9850,7 @@ do_continue:;

tmp_disable_binlog(thd);
create_info->options|=HA_CREATE_TMP_ALTER;
create_info->alias= alter_ctx.table_name;
error= create_table_impl(thd,
&alter_ctx.db, &alter_ctx.table_name,
&alter_ctx.new_db, &alter_ctx.tmp_name,
Expand Down

0 comments on commit d4258f3

Please sign in to comment.