Skip to content

Commit 66cf3c6

Browse files
committed
MDEV-35612 fix for system-versioning
only ignore fully invisible fields
1 parent c1933b4 commit 66cf3c6

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

mysql-test/main/partition_exchange.result

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,3 +1353,11 @@ ERROR HY000: Tables have different definitions
13531353
create or replace table tp (a int, b text, unique (b), unique(a, b));
13541354
alter table t exchange partition p0 with table tp;
13551355
drop table t, tp;
1356+
create table t (a int, b int) with system versioning partition by list (a) (partition p0 values in (1,2));
1357+
create table tp (a int, b int);
1358+
alter table t exchange partition p0 with table tp;
1359+
ERROR HY000: Tables have different definitions
1360+
create or replace table tp (a int, b int) with system versioning;
1361+
alter table t exchange partition p0 with table tp;
1362+
drop table t, tp;
1363+
# End of 10.5 tests

mysql-test/main/partition_exchange.test

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,9 +594,17 @@ create table t (a int, b text, unique (b), unique(a, b)) partition by list (a) (
594594
create table tp (a int, b text, c int invisible, unique (b), unique(a, b));
595595
--error ER_TABLES_DIFFERENT_METADATA
596596
alter table t exchange partition p0 with table tp;
597-
598597
create or replace table tp (a int, b text, unique (b), unique(a, b));
599598
alter table t exchange partition p0 with table tp;
599+
drop table t, tp;
600600

601-
# cleanup
601+
# same for system versioning:
602+
create table t (a int, b int) with system versioning partition by list (a) (partition p0 values in (1,2));
603+
create table tp (a int, b int); # without system versioning
604+
--error ER_TABLES_DIFFERENT_METADATA
605+
alter table t exchange partition p0 with table tp;
606+
create or replace table tp (a int, b int) with system versioning;
607+
alter table t exchange partition p0 with table tp;
602608
drop table t, tp;
609+
610+
--echo # End of 10.5 tests

sql/sql_table.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7954,10 +7954,10 @@ bool mysql_compare_tables(TABLE *table, Alter_info *alter_info,
79547954
/* Some very basic checks. */
79557955
uint fields= table->s->fields;
79567956

7957-
/* There is no field count on system-invisible fields, count them. */
7957+
/* There is no field count on fully-invisible fields, count them. */
79587958
for (Field **f_ptr= table->field; *f_ptr; f_ptr++)
79597959
{
7960-
if ((*f_ptr)->invisible >= INVISIBLE_SYSTEM)
7960+
if ((*f_ptr)->invisible >= INVISIBLE_FULL)
79617961
fields--;
79627962
}
79637963

0 commit comments

Comments
 (0)