From 11d1ac7285221ab4df7d9ef7cc8ee949b01c9b32 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Wed, 4 Jun 2025 15:16:54 +1000 Subject: [PATCH] MDEV-35856 Remove error code introduced to 10.11 in MDEV-36032 Two new error codes ER_SEQUENCE_TABLE_HAS_TOO_FEW_ROWS and ER_SEQUENCE_TABLE_HAS_TOO_MANY_ROWS were introduced in MDEV-36032 in both 10.11 and, as part of MDEV-22491, 12.0. Here we remove them from 10.11, but they should remain in 12.0. --- mysql-test/suite/sql_sequence/alter.result | 8 ++++---- mysql-test/suite/sql_sequence/alter.test | 8 ++++---- sql/share/errmsg-utf8.txt | 4 ---- sql/sql_table.cc | 8 ++++---- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/mysql-test/suite/sql_sequence/alter.result b/mysql-test/suite/sql_sequence/alter.result index eb419609823..6f040764418 100644 --- a/mysql-test/suite/sql_sequence/alter.result +++ b/mysql-test/suite/sql_sequence/alter.result @@ -426,7 +426,7 @@ create sequence s; alter table s sequence=0; insert into s values (3,1,9223372036854775806,1,1,1000,0,0); alter table s sequence=1; -ERROR HY000: More than one row in the table +ERROR HY000: Internal error: More than one row in the table drop table s; create sequence s; alter table s sequence=0; @@ -475,17 +475,17 @@ CREATE TABLE `s1` ( `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' ) ENGINE=innodb; alter table s1 sequence=1; -ERROR HY000: Fewer than one row in the table +ERROR HY000: Internal error: Fewer than one row in the table alter table s1 sequence=0; insert into s1 values (1,1,9223372036854775806,1,1,1000,0,0); alter table s1 sequence=1; alter table s1 sequence=0; insert into s1 values (2,1,9223372036854775806,1,1,1000,0,0); alter table s1 sequence=1; -ERROR HY000: More than one row in the table +ERROR HY000: Internal error: More than one row in the table alter table s1 sequence=0; insert into s1 values (3,1,9223372036854775806,1,1,1000,0,0); alter table s1 sequence=1; -ERROR HY000: More than one row in the table +ERROR HY000: Internal error: More than one row in the table drop table s1; # End of 10.11 tests diff --git a/mysql-test/suite/sql_sequence/alter.test b/mysql-test/suite/sql_sequence/alter.test index 2bb2e1f62af..b79f83ffd76 100644 --- a/mysql-test/suite/sql_sequence/alter.test +++ b/mysql-test/suite/sql_sequence/alter.test @@ -304,7 +304,7 @@ DROP SEQUENCE s2; create sequence s; alter table s sequence=0; insert into s values (3,1,9223372036854775806,1,1,1000,0,0); ---error ER_SEQUENCE_TABLE_HAS_TOO_MANY_ROWS +--error ER_INTERNAL_ERROR alter table s sequence=1; drop table s; @@ -355,7 +355,7 @@ CREATE TABLE `s1` ( `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' ) ENGINE=innodb; ---error ER_SEQUENCE_TABLE_HAS_TOO_FEW_ROWS +--error ER_INTERNAL_ERROR alter table s1 sequence=1; # (for coverage) alter a non sequence table with sequence=0 alter table s1 sequence=0; @@ -364,13 +364,13 @@ alter table s1 sequence=1; alter table s1 sequence=0; insert into s1 values (2,1,9223372036854775806,1,1,1000,0,0); ---error ER_SEQUENCE_TABLE_HAS_TOO_MANY_ROWS +--error ER_INTERNAL_ERROR alter table s1 sequence=1; # (for coverage) alter a non sequence table with sequence=0 alter table s1 sequence=0; insert into s1 values (3,1,9223372036854775806,1,1,1000,0,0); ---error ER_SEQUENCE_TABLE_HAS_TOO_MANY_ROWS +--error ER_INTERNAL_ERROR alter table s1 sequence=1; drop table s1; diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 93224d9c1b3..e7cbb87824c 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -10758,7 +10758,3 @@ ER_CM_OPTION_MISSING_REQUIREMENT eng "CHANGE MASTER TO option '%s=%s' is missing requirement %s" ER_SLAVE_STATEMENT_TIMEOUT 70100 eng "Slave log event execution was interrupted (slave_max_statement_time exceeded)" -ER_SEQUENCE_TABLE_HAS_TOO_FEW_ROWS - eng "Fewer than one row in the table" -ER_SEQUENCE_TABLE_HAS_TOO_MANY_ROWS - eng "More than one row in the table" diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 9f61dd13cf7..2451209f0c1 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -12159,9 +12159,9 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, bool ignore, from->file->stats.records != 1) { if (from->file->stats.records > 1) - my_error(ER_SEQUENCE_TABLE_HAS_TOO_MANY_ROWS, MYF(0)); + my_error(ER_INTERNAL_ERROR, MYF(0), "More than one row in the table"); else - my_error(ER_SEQUENCE_TABLE_HAS_TOO_FEW_ROWS, MYF(0)); + my_error(ER_INTERNAL_ERROR, MYF(0), "Fewer than one row in the table"); goto err; } for (Field **ptr=to->field ; *ptr ; ptr++) @@ -12349,7 +12349,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, bool ignore, } if (to->s->table_type == TABLE_TYPE_SEQUENCE && found_count == 1) { - my_error(ER_SEQUENCE_TABLE_HAS_TOO_MANY_ROWS, MYF(0)); + my_error(ER_INTERNAL_ERROR, MYF(0), "More than one row in the table"); error= 1; break; } @@ -12374,7 +12374,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, bool ignore, if (to->s->table_type == TABLE_TYPE_SEQUENCE && found_count == 0) { - my_error(ER_SEQUENCE_TABLE_HAS_TOO_FEW_ROWS, MYF(0)); + my_error(ER_INTERNAL_ERROR, MYF(0), "Fewer than one row in the table"); error= 1; }