diff options
60 files changed, 282 insertions, 251 deletions
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index dfbf1547517..5b55f0641ae 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -92,9 +92,9 @@ if [ "x$warning_mode" != "xpedantic" ]; then # Both C and C++ warnings warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W" warnings="$warnings -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare" - warnings="$warnings -Wwrite-strings" + warnings="$warnings -Wwrite-strings -Wunused-function -Wunused-label -Wunused-value -Wunused-variable -Wshadow" # C warnings - c_warnings="$warnings -Wunused" + c_warnings="$warnings -Wunused-parameter" # C++ warnings cxx_warnings="$warnings -Woverloaded-virtual -Wsign-promo -Wreorder" cxx_warnings="$warnings -Wctor-dtor-privacy -Wnon-virtual-dtor" diff --git a/mysql-test/extra/binlog_tests/insert_select-binlog.test b/mysql-test/extra/binlog_tests/insert_select-binlog.test index 268e9280b32..07da4a1907f 100644 --- a/mysql-test/extra/binlog_tests/insert_select-binlog.test +++ b/mysql-test/extra/binlog_tests/insert_select-binlog.test @@ -13,7 +13,7 @@ insert into t1 values(2); create table t2(a int); insert into t2 values(1),(2); reset master; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 select * from t2; # The above should produce an error, but still be in the binlog; # verify the binlog : @@ -29,7 +29,7 @@ drop table t1, t2; create table t1(a int); insert into t1 values(1),(1); reset master; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME create table t2(unique(a)) select a from t1; # The above should produce an error, *and* not appear in the binlog let $VERSION=`select version()`; diff --git a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test index bdc49573ae5..bb4194bc7a7 100644 --- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test +++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test @@ -273,12 +273,12 @@ set autocommit=0; CREATE TABLE t1 (a int, b int) engine=myisam; reset master; INSERT INTO t1 values (1,1),(1,2); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TABLE t2 (primary key (a)) engine=innodb select * from t1; # This should give warning DROP TABLE if exists t2; INSERT INTO t1 values (3,3); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TEMPORARY TABLE t2 (primary key (a)) engine=innodb select * from t1; ROLLBACK; # This should give warning @@ -286,12 +286,12 @@ DROP TABLE IF EXISTS t2; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb; INSERT INTO t1 VALUES (4,4); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; SELECT * from t2; TRUNCATE table t2; INSERT INTO t1 VALUES (5,5); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO t2 select * from t1; SELECT * FROM t2; DROP TABLE t2; @@ -301,25 +301,25 @@ CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)) engine=innodb ; INSERT INTO t1 values (7,7); ROLLBACK; INSERT INTO t1 values (8,8); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; COMMIT; INSERT INTO t1 values (9,9); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; ROLLBACK; SELECT * from t2; TRUNCATE table t2; INSERT INTO t1 values (10,10); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO t2 select * from t1; SELECT * from t1; INSERT INTO t2 values (100,100); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; COMMIT; INSERT INTO t2 values (101,101); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1; ROLLBACK; SELECT * from t2; diff --git a/mysql-test/extra/rpl_tests/rpl_auto_increment.test b/mysql-test/extra/rpl_tests/rpl_auto_increment.test index dbae317e8ab..410aeecb7ee 100644 --- a/mysql-test/extra/rpl_tests/rpl_auto_increment.test +++ b/mysql-test/extra/rpl_tests/rpl_auto_increment.test @@ -76,7 +76,7 @@ insert into t1 values (NULL),(5),(NULL),(NULL); insert into t1 values (500),(NULL),(502),(NULL),(NULL); select * from t1; set @@insert_id=600; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values(600),(NULL),(NULL); set @@insert_id=600; insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL); @@ -119,7 +119,7 @@ set auto_increment_increment=11; set auto_increment_offset=4; insert into t1 values(null); insert into t1 values(null); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values(null); select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t1 order by a; diff --git a/mysql-test/extra/rpl_tests/rpl_foreign_key.test b/mysql-test/extra/rpl_tests/rpl_foreign_key.test index 0f4cd856db6..8558650fd04 100644 --- a/mysql-test/extra/rpl_tests/rpl_foreign_key.test +++ b/mysql-test/extra/rpl_tests/rpl_foreign_key.test @@ -22,8 +22,8 @@ SET TIMESTAMP=1000000000; CREATE TABLE t3 ( a INT UNIQUE ); SET FOREIGN_KEY_CHECKS=0; # Had to add 1022 for run with ndb as ndb uses different -# error and error code for 1062. Bug 16677 ---error 1022, 1062 +# error and error code for error ER_DUP_ENTRY_WITH_KEY_NAME. Bug 16677 +--error 1022, ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO t3 VALUES (1),(1); sync_slave_with_master; diff --git a/mysql-test/extra/rpl_tests/rpl_insert_id.test b/mysql-test/extra/rpl_tests/rpl_insert_id.test index 33194270d37..0b07216cf11 100644 --- a/mysql-test/extra/rpl_tests/rpl_insert_id.test +++ b/mysql-test/extra/rpl_tests/rpl_insert_id.test @@ -97,7 +97,7 @@ SET TIMESTAMP=1000000000; CREATE TABLE t1 ( a INT UNIQUE ); SET FOREIGN_KEY_CHECKS=0; # Duplicate Key Errors ---error 1022, 1062 +--error 1022, ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO t1 VALUES (1),(1); sync_slave_with_master; connection master; diff --git a/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test b/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test index 6feafc5a9a7..5a646bd49e3 100644 --- a/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test +++ b/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test @@ -80,7 +80,7 @@ SET TIMESTAMP=1000000000; CREATE TABLE t1 ( a INT UNIQUE ); SET FOREIGN_KEY_CHECKS=0; # Duplicate Key Errors codes ---error 1022, 1062 +--error 1022, ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO t1 VALUES (1),(1); sync_slave_with_master; connection master; diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test index e58908ec7e9..111b66ff7fe 100644 --- a/mysql-test/extra/rpl_tests/rpl_loaddata.test +++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test @@ -130,7 +130,7 @@ connection master; reset master; eval create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60), unique(day)) engine=$engine_type; # no transactions ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines; @@ -146,7 +146,7 @@ select * from t2; alter table t2 drop key day; connection master; delete from t2; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines; diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test index ea2c4c1688c..72a18eb11b6 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_basic.test +++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test @@ -196,11 +196,11 @@ eval CREATE TABLE t8 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = $t # First we make sure that the constraints are correctly set. INSERT INTO t8 VALUES (99,99,99); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO t8 VALUES (99,22,33); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO t8 VALUES (11,99,33); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO t8 VALUES (11,22,99); SELECT * FROM t8 ORDER BY a; diff --git a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test index 6abd2ae844e..654cb523f74 100644 --- a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test +++ b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test @@ -19,7 +19,7 @@ set sql_log_bin=0; insert into t1 values(2); set sql_log_bin=1; save_master_pos; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values(1),(2); drop table t1; save_master_pos; diff --git a/mysql-test/extra/rpl_tests/rpl_trig004.test b/mysql-test/extra/rpl_tests/rpl_trig004.test index 0206241eae9..529e0465062 100644 --- a/mysql-test/extra/rpl_tests/rpl_trig004.test +++ b/mysql-test/extra/rpl_tests/rpl_trig004.test @@ -29,7 +29,7 @@ delimiter ;// INSERT INTO test.t2 VALUES (1, 0.0); # Expect duplicate error 1022 == ndb ---error 1022,1062 +--error 1022,error ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO test.t2 VALUES (1, 0.0); #show binlog events; diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc index 7fe369cfb1e..e170cb83612 100644 --- a/mysql-test/include/mix1.inc +++ b/mysql-test/include/mix1.inc @@ -393,24 +393,24 @@ DROP TABLE t1; CREATE TABLE t1 (a int, b int); insert into t1 values (1,1),(1,2); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TABLE t2 (primary key (a)) select * from t1; # This should give warning drop table if exists t2; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TEMPORARY TABLE t2 (primary key (a)) select * from t1; # This should give warning drop table if exists t2; CREATE TABLE t2 (a int, b int, primary key (a)); BEGIN; INSERT INTO t2 values(100,100); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1; SELECT * from t2; ROLLBACK; SELECT * from t2; TRUNCATE table t2; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO t2 select * from t1; SELECT * from t2; drop table t2; @@ -418,19 +418,19 @@ drop table t2; CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)); BEGIN; INSERT INTO t2 values(100,100); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1; SELECT * from t2; COMMIT; BEGIN; INSERT INTO t2 values(101,101); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1; SELECT * from t2; ROLLBACK; SELECT * from t2; TRUNCATE table t2; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO t2 select * from t1; SELECT * from t2; drop table t1,t2; diff --git a/mysql-test/include/mix2.inc b/mysql-test/include/mix2.inc index 8c11f094907..9bbf2dc0be4 100644 --- a/mysql-test/include/mix2.inc +++ b/mysql-test/include/mix2.inc @@ -96,7 +96,7 @@ INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2), update t1 set parent_id=parent_id+100; select * from t1 where parent_id=102; update t1 set id=id+1000; --- error 1062,1022 +-- error ER_DUP_ENTRY_WITH_KEY_NAME,1022 update t1 set id=1024 where id=1009; select * from t1; update ignore t1 set id=id+1; # This will change all rows @@ -179,13 +179,13 @@ commit; select n, "after commit" from t1; commit; insert into t1 values (5); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values (4); commit; select n, "after commit" from t1; set autocommit=1; insert into t1 values (6); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values (4); select n from t1; set autocommit=0; @@ -259,7 +259,7 @@ drop table t1; eval CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=$engine_type; insert into t1 values ('pippo', 12); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('pippo', 12); # Gives error delete from t1; delete from t1 where id = 'pippo'; @@ -390,9 +390,9 @@ eval CREATE TABLE t1 ( insert into t1 (ggid,passwd) values ('test1','xxx'); insert into t1 (ggid,passwd) values ('test2','yyy'); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 (ggid,passwd) values ('test2','this will fail'); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 (ggid,id) values ('this will fail',1); select * from t1 where ggid='test1'; @@ -401,7 +401,7 @@ select * from t1 where id=2; replace into t1 (ggid,id) values ('this will work',1); replace into t1 (ggid,passwd) values ('test2','this will work'); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME update t1 set id=100,ggid='test2' where id=1; select * from t1; select * from t1 where id=1; @@ -572,7 +572,7 @@ drop table t1; eval create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=$engine_type; insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); LOCK TABLES t1 WRITE; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values (99,1,2,'D'),(1,1,2,'D'); select id from t1; select id from t1; @@ -583,7 +583,7 @@ eval create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 c insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); LOCK TABLES t1 WRITE; begin; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values (99,1,2,'D'),(1,1,2,'D'); select id from t1; insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D'); @@ -1513,7 +1513,7 @@ eval create table t1 (rowid int not null auto_increment, val int not null,primar key (rowid), unique(val)) engine=$engine_type; replace into t1 (val) values ('1'),('2'); replace into t1 (val) values ('1'),('2'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 (val) values ('1'),('2'); select * from t1; drop table t1; @@ -1528,7 +1528,7 @@ eval create table t1 (a int not null auto_increment primary key, val int) engine insert into t1 (val) values (1); update t1 set a=2 where a=1; # We should get the following error because InnoDB does not update the counter ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 (val) values (1); select * from t1; drop table t1; @@ -2027,13 +2027,13 @@ eval create table t3 (s1 varchar(2) binary,primary key (s1)) engine=$engine_type eval create table t4 (s1 char(2) binary,primary key (s1)) engine=$engine_type; insert into t1 values (0x41),(0x4120),(0x4100); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t2 values (0x41),(0x4120),(0x4100); insert into t2 values (0x41),(0x4120); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t3 values (0x41),(0x4120),(0x4100); insert into t3 values (0x41),(0x4100); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t4 values (0x41),(0x4120),(0x4100); insert into t4 values (0x41),(0x4100); select hex(s1) from t1; diff --git a/mysql-test/include/ps_modify.inc b/mysql-test/include/ps_modify.inc index 633c317f4b2..9e38671263f 100644 --- a/mysql-test/include/ps_modify.inc +++ b/mysql-test/include/ps_modify.inc @@ -193,7 +193,7 @@ prepare stmt1 from 'insert into t1 values(6, ? )'; execute stmt1 using @arg00; select a,b from t1 where b = @arg00; # the second insert fails, because the first column is primary key ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME execute stmt1 using @arg00; set @arg00=NULL ; prepare stmt1 from 'insert into t1 values(0, ? )'; @@ -272,7 +272,7 @@ execute stmt1 using @arg00, @arg01; select * from t1 order by a; set @arg00=81 ; set @arg01=1 ; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME execute stmt1 using @arg00, @arg01; ## insert, autoincrement column and ' SELECT LAST_INSERT_ID() ' diff --git a/mysql-test/include/query_cache.inc b/mysql-test/include/query_cache.inc index 0cf2f7cdfe9..b54976886bd 100644 --- a/mysql-test/include/query_cache.inc +++ b/mysql-test/include/query_cache.inc @@ -90,7 +90,7 @@ delete from t3 where t1_id = 1 and t2_id = 1; select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc; begin; insert into t3 VALUES ( NULL, 1, 1, 2 ); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t3 VALUES ( NULL, 1, 1, 2 ); commit; select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc; diff --git a/mysql-test/include/varchar.inc b/mysql-test/include/varchar.inc index 70b563e871c..2d683a15030 100644 --- a/mysql-test/include/varchar.inc +++ b/mysql-test/include/varchar.inc @@ -81,7 +81,7 @@ explain select count(*) from t1 where v between 'a' and 'a '; --replace_column 9 # explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME alter table t1 add unique(v); alter table t1 add key(v); select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a'; @@ -179,17 +179,17 @@ drop table t1; create table t1 (a char(10), unique (a)); insert into t1 values ('a '); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('a '); alter table t1 modify a varchar(10); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('a '),('a '),('a '),('a '); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('a '); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('a '); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('a '); update t1 set a='a ' where a like 'a%'; select concat(a,'.') from t1; diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 7bef6c2efba..977011e7391 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -285,7 +285,7 @@ ERROR 23000: Duplicate entry '3' for key 'PRIMARY' show warnings; Level Code Message Note 1050 Table 't1' already exists -Error 1062 Duplicate entry '3' for key 'PRIMARY' +Error 1579 Duplicate entry '3' for key 'PRIMARY' show status like "Opened_tables"; Variable_name Value Opened_tables 2 diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/r/rpl_sp.result index 261e7cb072c..0999e8c4124 100644 --- a/mysql-test/r/rpl_sp.result +++ b/mysql-test/r/rpl_sp.result @@ -107,7 +107,7 @@ call foo4(); ERROR 23000: Duplicate entry '20' for key 1 show warnings; Level Code Message -Error 1062 Duplicate entry '20' for key 1 +Error 1579 Duplicate entry '20' for key 1 select * from t2; a 20 @@ -241,7 +241,7 @@ return 10; end| do fn1(100); Warnings: -Error 1062 Duplicate entry '100' for key 1 +Error 1579 Duplicate entry '100' for key 1 select fn1(20); ERROR 23000: Duplicate entry '20' for key 1 select * from t2; diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 60363b06ea0..9a41c63c534 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -1493,10 +1493,10 @@ insert into t3 (a) values (1)| create procedure h_ee() deterministic begin -declare continue handler for 1062 -- ER_DUP_ENTRY +declare continue handler for 1579 -- ER_DUP_ENTRY_WITH_KEY_NAME select 'Outer (bad)' as 'h_ee'; begin -declare continue handler for 1062 -- ER_DUP_ENTRY +declare continue handler for 1579 -- ER_DUP_ENTRY_WITH_KEY_NAME select 'Inner (good)' as 'h_ee'; insert into t3 values (1); end; @@ -1504,7 +1504,7 @@ end| create procedure h_es() deterministic begin -declare continue handler for 1062 -- ER_DUP_ENTRY +declare continue handler for 1579 -- ER_DUP_ENTRY_WITH_KEY_NAME select 'Outer (good)' as 'h_es'; begin -- integrity constraint violation @@ -1541,7 +1541,7 @@ end| create procedure h_ex() deterministic begin -declare continue handler for 1062 -- ER_DUP_ENTRY +declare continue handler for 1579 -- ER_DUP_ENTRY_WITH_KEY_NAME select 'Outer (good)' as 'h_ex'; begin declare continue handler for sqlexception @@ -1556,7 +1556,7 @@ begin declare continue handler for sqlstate '23000' select 'Outer (bad)' as 'h_se'; begin -declare continue handler for 1062 -- ER_DUP_ENTRY +declare continue handler for 1579 -- ER_DUP_ENTRY_WITH_KEY_NAME select 'Inner (good)' as 'h_se'; insert into t3 values (1); end; @@ -1696,7 +1696,7 @@ begin declare continue handler for sqlexception select 'Outer (bad)' as 'h_xe'; begin -declare continue handler for 1062 -- ER_DUP_ENTRY +declare continue handler for 1579 -- ER_DUP_ENTRY_WITH_KEY_NAME select 'Inner (good)' as 'h_xe'; insert into t3 values (1); end; @@ -4701,10 +4701,10 @@ insert into t3 values (1)| create procedure bug15011() deterministic begin -declare continue handler for 1062 +declare continue handler for 1579 select 'Outer' as 'Handler'; begin -declare continue handler for 1062 +declare continue handler for 1579 select 'Inner' as 'Handler'; insert into t3 values (1); end; diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 4bc122cc97b..3b83492479a 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -2684,10 +2684,12 @@ FROM t1 HAVING Age < 75; SHOW CREATE VIEW v1; View Create View v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (year(now()) - year(`t1`.`DOB`)) AS `Age` from `t1` having (`Age` < 75) +set timestamp=1136066400; SELECT (year(now())-year(DOB)) AS Age FROM t1 HAVING Age < 75; Age 42 38 +set timestamp=1136066400; SELECT * FROM v1; Age 42 diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test index f869dc06187..f9a4a49d447 100644 --- a/mysql-test/t/auto_increment.test +++ b/mysql-test/t/auto_increment.test @@ -101,10 +101,10 @@ insert into t1 set i = 254; insert into t1 set i = null; select last_insert_id(); explain extended select last_insert_id(); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 set i = 254; select last_insert_id(); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 set i = null; select last_insert_id(); drop table t1; @@ -122,7 +122,7 @@ insert into t1 values (NULL, 10); select last_insert_id(); insert into t1 values (NULL, 15); select last_insert_id(); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values (NULL, 10); select last_insert_id(); @@ -277,7 +277,7 @@ create table t1 (rowid int not null auto_increment, val int not null,primary key (rowid), unique(val)); replace into t1 (val) values ('1'),('2'); replace into t1 (val) values ('1'),('2'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 (val) values ('1'),('2'); select * from t1; drop table t1; @@ -300,7 +300,7 @@ drop table t1; CREATE TABLE t1 (t1 INT(10) PRIMARY KEY, t2 INT(10)); INSERT INTO t1 VALUES(0, 0); INSERT INTO t1 VALUES(1, 1); ---error ER_DUP_ENTRY +--error ER_DUP_ENTRY_WITH_KEY_NAME ALTER TABLE t1 CHANGE t1 t1 INT(10) auto_increment; DROP TABLE t1; diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index a2853ca3191..b4837b4ccbb 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -153,7 +153,7 @@ drop table if exists t1,t2; CREATE TABLE t1 (a int not null); INSERT INTO t1 values (1),(2),(1); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TABLE t2 (primary key(a)) SELECT * FROM t1; --error 1146 SELECT * from t2; @@ -232,7 +232,7 @@ insert into t1 values (1,1); create table if not exists t1 select 2; select * from t1; create table if not exists t1 select 3 as 'a',4 as 'b'; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME create table if not exists t1 select 3 as 'a',3 as 'b'; show warnings; show status like "Opened_tables"; @@ -684,30 +684,30 @@ drop table t1; CREATE TABLE t1 (a int, b int); insert into t1 values (1,1),(1,2); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TABLE t2 (primary key (a)) select * from t1; # This should give warning drop table if exists t2; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TEMPORARY TABLE t2 (primary key (a)) select * from t1; # This should give warning drop table if exists t2; CREATE TABLE t2 (a int, b int, primary key (a)); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1; SELECT * from t2; TRUNCATE table t2; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO t2 select * from t1; SELECT * from t2; drop table t2; CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1; SELECT * from t2; TRUNCATE table t2; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO t2 select * from t1; SELECT * from t2; drop table t1,t2; diff --git a/mysql-test/t/create_select_tmp.test b/mysql-test/t/create_select_tmp.test index ba9898b7752..eacea1ac376 100644 --- a/mysql-test/t/create_select_tmp.test +++ b/mysql-test/t/create_select_tmp.test @@ -14,19 +14,19 @@ drop table if exists t1, t2; --enable_warnings CREATE TABLE t1 ( a int ); INSERT INTO t1 VALUES (1),(2),(1); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1; --error 1146 select * from t2; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1; --error 1146 select * from t2; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1; --error 1146 select * from t2; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1; --error 1146 select * from t2; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 804b17ab6bb..da43166fdd0 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -210,9 +210,9 @@ drop table t2; create table t1 (c varchar(30) character set utf8, unique(c(10))); insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z'); insert into t1 values ('aaaaaaaaaa'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aaaaaaaaaaa'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aaaaaaaaaaaa'); insert into t1 values (repeat('b',20)); select c c1 from t1 where c='1'; @@ -234,9 +234,9 @@ create table t1 (c varchar(30) character set utf8, unique(c(10))) engine=innodb; --enable_warnings insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z'); insert into t1 values ('aaaaaaaaaa'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aaaaaaaaaaa'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aaaaaaaaaaaa'); insert into t1 values (repeat('b',20)); select c c1 from t1 where c='1'; @@ -256,23 +256,23 @@ create table t1 (c char(3) character set utf8, unique (c(2))); insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z'); insert into t1 values ('a'); insert into t1 values ('aa'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aaa'); insert into t1 values ('b'); insert into t1 values ('bb'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('bbb'); insert into t1 values ('а'); insert into t1 values ('аа'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('ааа'); insert into t1 values ('б'); insert into t1 values ('бб'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('ббб'); insert into t1 values ('ꪪ'); insert into t1 values ('ꪪꪪ'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('ꪪꪪꪪ'); drop table t1; # @@ -285,23 +285,23 @@ create table t1 (c char(3) character set utf8, unique (c(2))) engine=innodb; insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z'); insert into t1 values ('a'); insert into t1 values ('aa'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aaa'); insert into t1 values ('b'); insert into t1 values ('bb'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('bbb'); insert into t1 values ('а'); insert into t1 values ('аа'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('ааа'); insert into t1 values ('б'); insert into t1 values ('бб'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('ббб'); insert into t1 values ('ꪪ'); insert into t1 values ('ꪪꪪ'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('ꪪꪪꪪ'); drop table t1; # @@ -314,14 +314,14 @@ unique key a using hash (c(1)) ) engine=heap; show create table t1; insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aa'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aaa'); insert into t1 values ('б'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('бб'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('ббб'); select c as c_all from t1 order by c; select c as c_a from t1 where c='a'; @@ -338,14 +338,14 @@ unique key a using btree (c(1)) ) engine=heap; show create table t1; insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aa'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aaa'); insert into t1 values ('б'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('бб'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('ббб'); select c as c_all from t1 order by c; select c as c_a from t1 where c='a'; @@ -363,14 +363,14 @@ unique key a (c(1)) ) engine=innodb; --enable_warnings insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aa'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aaa'); insert into t1 values ('б'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('бб'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('ббб'); select c as c_all from t1 order by c; select c as c_a from t1 where c='a'; @@ -384,9 +384,9 @@ drop table t1; create table t1 (c varchar(30) character set utf8 collate utf8_bin, unique(c(10))); insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z'); insert into t1 values ('aaaaaaaaaa'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aaaaaaaaaaa'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aaaaaaaaaaaa'); insert into t1 values (repeat('b',20)); select c c1 from t1 where c='1'; @@ -407,23 +407,23 @@ create table t1 (c char(3) character set utf8 collate utf8_bin, unique (c(2))); insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z'); insert into t1 values ('a'); insert into t1 values ('aa'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aaa'); insert into t1 values ('b'); insert into t1 values ('bb'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('bbb'); insert into t1 values ('а'); insert into t1 values ('аа'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('ааа'); insert into t1 values ('б'); insert into t1 values ('бб'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('ббб'); insert into t1 values ('ꪪ'); insert into t1 values ('ꪪꪪ'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('ꪪꪪꪪ'); drop table t1; @@ -437,14 +437,14 @@ unique key a using hash (c(1)) ) engine=heap; show create table t1; insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aa'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aaa'); insert into t1 values ('б'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('бб'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('ббб'); select c as c_all from t1 order by c; select c as c_a from t1 where c='a'; @@ -461,14 +461,14 @@ unique key a using btree (c(1)) ) engine=heap; show create table t1; insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aa'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aaa'); insert into t1 values ('б'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('бб'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('ббб'); select c as c_all from t1 order by c; select c as c_a from t1 where c='a'; @@ -486,14 +486,14 @@ unique key a (c(1)) ) engine=innodb; --enable_warnings insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aa'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('aaa'); insert into t1 values ('б'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('бб'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('ббб'); select c as c_all from t1 order by c; select c as c_a from t1 where c='a'; diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test index 03d8e20dd8f..347c8a9dc55 100644 --- a/mysql-test/t/delayed.test +++ b/mysql-test/t/delayed.test @@ -185,7 +185,7 @@ INSERT INTO t1 VALUES( 49, 71), (NULL, 72), (NULL, 73); INSERT INTO t1 VALUES(NULL, 81), (NULL, 82), (NULL, 83); # Create a duplicate value. SET insert_id= 114; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO t1 VALUES(NULL, 91); INSERT INTO t1 VALUES (NULL, 92), (NULL, 93); # Check what we have now diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test index e501fce1eeb..624597cd8d7 100644 --- a/mysql-test/t/heap.test +++ b/mysql-test/t/heap.test @@ -128,7 +128,7 @@ SELECT * FROM t1 WHERE b=NULL; explain SELECT * FROM t1 WHERE b IS NULL; SELECT * FROM t1 WHERE b<=>NULL; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO t1 VALUES (1,3); DROP TABLE t1; @@ -270,7 +270,7 @@ explain select count(*) from t1 where v like 'a%'; explain select count(*) from t1 where v between 'a' and 'a '; explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME alter table t1 add unique(v); select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a' order by length(concat('*',v,'*',c,'*',t,'*')); explain select * from t1 where v='a'; @@ -296,17 +296,17 @@ drop table t1; create table t1 (a char(10), unique (a)); insert into t1 values ('a'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('a '); alter table t1 modify a varchar(10); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('a '),('a '),('a '),('a '); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('a '); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('a '); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('a '); update t1 set a='a ' where a like 'a '; update t1 set a='a ' where a like 'a '; @@ -357,7 +357,7 @@ explain select count(*) from t1 where v between 'a' and 'a '; --replace_column 9 # explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME alter table t1 add unique(v); select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a' order by length(concat('*',v,'*',c,'*',t,'*')); # Number of rows is not constant for b-trees keys @@ -372,17 +372,17 @@ drop table t1; create table t1 (a char(10), unique using btree (a)) engine=heap; insert into t1 values ('a'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('a '); alter table t1 modify a varchar(10); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('a '),('a '),('a '),('a '); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('a '); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('a '); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('a '); update t1 set a='a ' where a like 'a '; update t1 set a='a ' where a like 'a '; @@ -432,7 +432,7 @@ create table t1 (a int not null, b int not null auto_increment, # create table t1 (c char(255), primary key(c(90))); insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"); drop table t1; diff --git a/mysql-test/t/heap_btree.test b/mysql-test/t/heap_btree.test index 03ba8661a3c..68aa79834fc 100644 --- a/mysql-test/t/heap_btree.test +++ b/mysql-test/t/heap_btree.test @@ -143,7 +143,7 @@ SELECT * FROM t1 WHERE b=NULL; explain SELECT * FROM t1 WHERE b IS NULL; SELECT * FROM t1 WHERE b<=>NULL; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO t1 VALUES (1,3); DROP TABLE t1; diff --git a/mysql-test/t/heap_hash.test b/mysql-test/t/heap_hash.test index 28a75a5ee11..774f83f43b0 100644 --- a/mysql-test/t/heap_hash.test +++ b/mysql-test/t/heap_hash.test @@ -128,7 +128,7 @@ SELECT * FROM t1 WHERE b=NULL; explain SELECT * FROM t1 WHERE b IS NULL; SELECT * FROM t1 WHERE b<=>NULL; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO t1 VALUES (1,3); DROP TABLE t1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 7e9a0e1ed18..df44fcf0105 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -52,7 +52,7 @@ INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2), update t1 set parent_id=parent_id+100; select * from t1 where parent_id=102; update t1 set id=id+1000; --- error 1062,1022 +-- error ER_DUP_ENTRY_WITH_KEY_NAME,1022 update t1 set id=1024 where id=1009; select * from t1; update ignore t1 set id=id+1; # This will change all rows @@ -133,13 +133,13 @@ commit; select n, "after commit" from t1; commit; insert into t1 values (5); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values (4); commit; select n, "after commit" from t1; set autocommit=1; insert into t1 values (6); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values (4); select n from t1; set autocommit=0; @@ -213,7 +213,7 @@ drop table t1; CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=innodb; insert into t1 values ('pippo', 12); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values ('pippo', 12); # Gives error delete from t1; delete from t1 where id = 'pippo'; @@ -341,9 +341,9 @@ CREATE TABLE t1 ( insert into t1 (ggid,passwd) values ('test1','xxx'); insert into t1 (ggid,passwd) values ('test2','yyy'); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 (ggid,passwd) values ('test2','this will fail'); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 (ggid,id) values ('this will fail',1); select * from t1 where ggid='test1'; @@ -352,7 +352,7 @@ select * from t1 where id=2; replace into t1 (ggid,id) values ('this will work',1); replace into t1 (ggid,passwd) values ('test2','this will work'); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME update t1 set id=100,ggid='test2' where id=1; select * from t1; select * from t1 where id=1; @@ -523,7 +523,7 @@ drop table t1; create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb; insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); LOCK TABLES t1 WRITE; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values (99,1,2,'D'),(1,1,2,'D'); select id from t1; select id from t1; @@ -534,7 +534,7 @@ create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(3 insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); LOCK TABLES t1 WRITE; begin; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values (99,1,2,'D'),(1,1,2,'D'); select id from t1; insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D'); @@ -1407,7 +1407,7 @@ create table t1 (rowid int not null auto_increment, val int not null,primary key (rowid), unique(val)) engine=innodb; replace into t1 (val) values ('1'),('2'); replace into t1 (val) values ('1'),('2'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 (val) values ('1'),('2'); select * from t1; drop table t1; @@ -1420,7 +1420,7 @@ create table t1 (a int not null auto_increment primary key, val int) engine=Inno insert into t1 (val) values (1); update t1 set a=2 where a=1; # We should get the following error because InnoDB does not update the counter ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 (val) values (1); select * from t1; drop table t1; @@ -1876,13 +1876,13 @@ create table t3 (s1 varchar(2) binary,primary key (s1)) engine=innodb; create table t4 (s1 char(2) binary,primary key (s1)) engine=innodb; insert into t1 values (0x41),(0x4120),(0x4100); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t2 values (0x41),(0x4120),(0x4100); insert into t2 values (0x41),(0x4120); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t3 values (0x41),(0x4120),(0x4100); insert into t3 values (0x41),(0x4100); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t4 values (0x41),(0x4120),(0x4100); insert into t4 values (0x41),(0x4100); select hex(s1) from t1; diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index 6f86ed897ac..dfe647fe87b 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -10,7 +10,7 @@ create table t1 (bandID MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, payoutID SMALLI insert into t1 (bandID,payoutID) VALUES (1,6),(2,6),(3,4),(4,9),(5,10),(6,1),(7,12),(8,12); create table t2 (payoutID SMALLINT UNSIGNED NOT NULL PRIMARY KEY); insert into t2 (payoutID) SELECT DISTINCT payoutID FROM t1; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t2 (payoutID) SELECT payoutID+10 FROM t1; insert ignore into t2 (payoutID) SELECT payoutID+10 FROM t1; select * from t2; @@ -101,7 +101,7 @@ create table t1 (a int not null primary key, b char(10)); create table t2 (a int not null, b char(10)); insert into t1 values (1,"t1:1"),(3,"t1:3"); insert into t2 values (2,"t2:2"), (3,"t2:3"); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 select * from t2; select * from t1; # REPLACE .. SELECT is not yet supported by PS diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index b3813864464..8a3e0306025 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -12,7 +12,7 @@ INSERT t1 VALUES (8,4,50) ON DUPLICATE KEY UPDATE c=c+1000; SELECT * FROM t1; INSERT t1 VALUES (1,4,60) ON DUPLICATE KEY UPDATE c=c+10000; SELECT * FROM t1; --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME INSERT t1 VALUES (1,9,70) ON DUPLICATE KEY UPDATE c=c+100000, b=4; SELECT * FROM t1; TRUNCATE TABLE t1; @@ -63,7 +63,7 @@ INSERT t1 SELECT 8,4,50 FROM DUAL ON DUPLICATE KEY UPDATE c=c+1000; SELECT * FROM t1; INSERT t1 SELECT 1,4,60 FROM DUAL ON DUPLICATE KEY UPDATE c=c+10000; SELECT * FROM t1; --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME INSERT t1 SELECT 1,9,70 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100000, b=4; SELECT * FROM t1; TRUNCATE TABLE t1; diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index 72a2935337d..9bc88a95ffe 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -97,7 +97,7 @@ WHERE t1.uniq_id = 4 ORDER BY t2.c_amount; INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes'); INSERT INTO t2 VALUES (7,3,1000,2000,0,0,746294,937484,'yes'); diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test index 7c6b38cb871..0a5eb17f6f5 100644 --- a/mysql-test/t/key.test +++ b/mysql-test/t/key.test @@ -150,7 +150,7 @@ create table t1 ); INSERT INTO t1 VALUES (1, 1, 1, 1, 'a'); INSERT INTO t1 VALUES (1, 1, 1, 1, 'b'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO t1 VALUES (1, 1, 1, 1, 'a'); drop table t1; @@ -243,13 +243,13 @@ show create table t1; insert t1 values ('cccc', 'tttt'), (0xD0B1212223D0B1D0B1D0B1D0B1D0B1, 0xD0B1D0B1212223D0B1D0B1D0B1D0B1), (0xD0B1222123D0B1D0B1D0B1D0B1D0B1, 0xD0B1D0B1222123D0B1D0B1D0B1D0B1); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert t1 (c) values ('cc22'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert t1 (t) values ('ttt22'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert t1 (c) values (0xD0B1212322D0B1D0B1D0B1D0B1D0B1); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert t1 (t) values (0xD0B1D0B1212322D0B1D0B1D0B1D0B1); select c from t1 where c='cccc'; select t from t1 where t='tttt'; @@ -438,7 +438,7 @@ insert into t1 values(1, 'b', 'b', NULL); # Drop some indexes for new adds. alter table t1 drop index i3, drop index i2, drop index i1; # Add indexes, one is unique on non-unique values. ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME alter table t1 add index i3 (c3), add index i2 (c2), add unique index i1 (c1); drop table t1; diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 5498468d902..ac2b9471fe9 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -195,9 +195,9 @@ select * from t6 order by a,b; insert into t1 values (99,NULL); select * from t4 where a+0 > 90; # bug#4008 - cannot determine a unique key that caused "dupl. key error" ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert t5 values (1,1); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert t6 values (2,1); insert t5 values (1,1) on duplicate key update b=b+10; insert t6 values (2,1) on duplicate key update b=b+20; diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 5a663718878..b7faa59307e 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -453,9 +453,9 @@ create table t1 (a int not null auto_increment primary key, b text not null, uni insert into t1 (b) values ('a'),('b'),('c'); select concat(b,'.') from t1; update t1 set b='b ' where a=2; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME update t1 set b='b ' where a > 1; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 (b) values ('b'); select * from t1; delete from t1 where b='b'; diff --git a/mysql-test/t/ndb_charset.test b/mysql-test/t/ndb_charset.test index a429ee5e1dc..2cdb1972225 100644 --- a/mysql-test/t/ndb_charset.test +++ b/mysql-test/t/ndb_charset.test @@ -38,9 +38,9 @@ create table t1 ( # ok insert into t1 values('aAa'); # fail ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values('aaa'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values('AAA'); # 1 select * from t1 order by a; @@ -61,9 +61,9 @@ create table t1 ( ) engine=ndb; # insert into t1 values ('A'),('b '),('C '),('d '),('E'),('f'); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values('b'); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values('a '); # select a,length(a) from t1 order by a; @@ -106,9 +106,9 @@ create table t1 ( # ok insert into t1 values(1, 'aAa'); # fail ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values(2, 'aaa'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values(3, 'AAA'); # 1 select * from t1 order by p; @@ -131,9 +131,9 @@ create table t1 ( ) engine=ndb; # insert into t1 values (1,'A'),(2,'b '),(3,'C '),(4,'d '),(5,'E'),(6,'f'); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values(99,'b'); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values(99,'a '); # select a,length(a) from t1 order by a; @@ -231,7 +231,7 @@ drop table t1; # ('a','A '),('B ','b'),('c','C '),('D','d'),('e ','E'),('F','f '), # ('A','b '),('b ','C'),('C','d '),('d','E'),('E ','f'), # ('a','C '),('B ','d'),('c','E '),('D','f'); -#-- error 1062 +#-- error ER_DUP_ENTRY_WITH_KEY_NAME #insert into t1 values('d','f'); # #select a,b,length(a),length(b) from t1 order by a,b limit 3; diff --git a/mysql-test/t/ndb_index_unique.test b/mysql-test/t/ndb_index_unique.test index 94bba98662c..9893dce7367 100644 --- a/mysql-test/t/ndb_index_unique.test +++ b/mysql-test/t/ndb_index_unique.test @@ -22,7 +22,7 @@ select * from t1 where b = 4 order by b; insert into t1 values(7,8,3); select * from t1 where b = 4 order by a; --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values(8, 2, 3); select * from t1 order by a; delete from t1 where a = 1; @@ -59,7 +59,7 @@ select * from t1 use index (bc) where b IS NULL and c IS NULL order by a; select * from t1 use index (bc) where b IS NULL and c = 2 order by a; select * from t1 use index (bc) where b < 4 order by a; select * from t1 use index (bc) where b IS NOT NULL order by a; --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values(5,1,1); drop table t1; @@ -82,7 +82,7 @@ select * from t2 where c = 6; insert into t2 values(7,8,3); select * from t2 where b = 4 order by a; --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME insert into t2 values(8, 2, 3); select * from t2 order by a; delete from t2 where a = 1; @@ -133,7 +133,7 @@ insert into t1 values (-1,NULL), (0,0), (1,NULL),(2,2),(3,NULL),(4,4); select * from t1 order by pk; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values (5,0); select * from t1 order by pk; delete from t1 where a = 0; @@ -152,7 +152,7 @@ insert into t2 values (-1,1,17,NULL),(0,NULL,18,NULL),(1,3,19,'abc'); select * from t2 order by pk; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t2 values(2,3,19,'abc'); select * from t2 order by pk; delete from t2 where c IS NOT NULL; @@ -321,7 +321,7 @@ create table t1 (a int primary key, b varchar(1000) not null, unique key (b)) engine=ndb charset=utf8; insert into t1 values (1, repeat(_utf8 0xe288ab6474, 200)); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values (2, repeat(_utf8 0xe288ab6474, 200)); select a, sha1(b) from t1; diff --git a/mysql-test/t/ndb_insert.test b/mysql-test/t/ndb_insert.test index bf25ca9a133..936bcb305ab 100644 --- a/mysql-test/t/ndb_insert.test +++ b/mysql-test/t/ndb_insert.test @@ -433,7 +433,7 @@ SELECT COUNT(*) FROM t1; # # Insert duplicate rows # ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO t1 VALUES (1,1,1); --error 1022 diff --git a/mysql-test/t/ndb_replace.test b/mysql-test/t/ndb_replace.test index 476a607ed44..fcbefe710ca 100644 --- a/mysql-test/t/ndb_replace.test +++ b/mysql-test/t/ndb_replace.test @@ -21,7 +21,7 @@ replace into t1 (gesuchnr,benutzer_id) values (1,1); insert into t1 (gesuchnr, benutzer_id) value (3,2); replace into t1 (gesuchnr,benutzer_id) values (1,1); replace into t1 (gesuchnr,benutzer_id) values (1,1); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 (gesuchnr,benutzer_id) values (1,1); replace into t1 (gesuchnr,benutzer_id) values (1,1); select * from t1 order by gesuchnr; diff --git a/mysql-test/t/ndb_update.test b/mysql-test/t/ndb_update.test index 45e3add4639..2eb736aecfd 100644 --- a/mysql-test/t/ndb_update.test +++ b/mysql-test/t/ndb_update.test @@ -23,7 +23,7 @@ UPDATE t1 set b = c; select * from t1 order by pk1; UPDATE t1 set pk1 = 4 where pk1 = 1; select * from t1 order by pk1; --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME UPDATE t1 set pk1 = 1, c = 2 where pk1 = 4; select * from t1 order by pk1; UPDATE t1 set pk1 = pk1 + 10; diff --git a/mysql-test/t/replace.test b/mysql-test/t/replace.test index 269854fb180..4e88379241c 100644 --- a/mysql-test/t/replace.test +++ b/mysql-test/t/replace.test @@ -25,9 +25,9 @@ drop table t1; create table t1 (a tinyint not null auto_increment primary key, b char(20) default "default_value"); insert into t1 values (126,"first"),(63, "middle"),(0,"last"); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values (0,"error"); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME replace into t1 values (0,"error"); replace into t1 values (126,"first updated"); replace into t1 values (63,default); diff --git a/mysql-test/t/rpl_err_ignoredtable.test b/mysql-test/t/rpl_err_ignoredtable.test index 42ca8cf2e8b..4d4be6ae786 100644 --- a/mysql-test/t/rpl_err_ignoredtable.test +++ b/mysql-test/t/rpl_err_ignoredtable.test @@ -11,7 +11,7 @@ connection master; create table t1 (a int primary key); create table t4 (a int primary key); # generate an error that goes to the binlog ---error 1022, 1062 +--error 1022, ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values (1),(1); insert into t4 values (1),(2); save_master_pos; diff --git a/mysql-test/t/rpl_row_create_table.test b/mysql-test/t/rpl_row_create_table.test index 3a711e5b496..3900f33088c 100644 --- a/mysql-test/t/rpl_row_create_table.test +++ b/mysql-test/t/rpl_row_create_table.test @@ -63,7 +63,7 @@ SELECT * FROM t6 ORDER BY a,b,c; connection master; # Test for erroneous constructions ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3; # Shouldn't be written to the binary log --replace_regex /table_id: [0-9]+/table_id: #/ @@ -71,7 +71,7 @@ SHOW BINLOG EVENTS FROM 1256; # Test that INSERT-SELECT works the same way as for SBR. CREATE TABLE t7 (a INT, b INT UNIQUE); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME INSERT INTO t7 SELECT a,b FROM tt3; SELECT * FROM t7 ORDER BY a,b; # Should be written to the binary log diff --git a/mysql-test/t/rpl_skip_error-slave.opt b/mysql-test/t/rpl_skip_error-slave.opt index f6f258f799f..acb0b77cc03 100644 --- a/mysql-test/t/rpl_skip_error-slave.opt +++ b/mysql-test/t/rpl_skip_error-slave.opt @@ -1 +1 @@ ---slave-skip-error=1053,1062 +--slave-skip-error=1053,1579 diff --git a/mysql-test/t/rpl_sp.test b/mysql-test/t/rpl_sp.test index 22ab72df104..dfcd8fd3b5b 100644 --- a/mysql-test/t/rpl_sp.test +++ b/mysql-test/t/rpl_sp.test @@ -152,7 +152,7 @@ create procedure foo4() delimiter ;| ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME call foo4(); show warnings; @@ -307,7 +307,7 @@ delimiter ;| do fn1(100); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME select fn1(20); select * from t2; diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index be803a74c7b..938baec51d1 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -30,7 +30,7 @@ check table t1 changed; check table t1 medium; check table t1 extended; show index from t1; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values (5,5,5); optimize table t1; optimize table t1; diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index 456a23123d3..3f3aba383d7 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -586,7 +586,7 @@ begin end| set @x = 0| ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME call bug3279(@x)| select @x| drop procedure bug3279| diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 8f4763c636a..9cf95fd484f 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -1763,11 +1763,11 @@ insert into t3 (a) values (1)| create procedure h_ee() deterministic begin - declare continue handler for 1062 -- ER_DUP_ENTRY + declare continue handler for 1579 -- ER_DUP_ENTRY_WITH_KEY_NAME select 'Outer (bad)' as 'h_ee'; begin - declare continue handler for 1062 -- ER_DUP_ENTRY + declare continue handler for 1579 -- ER_DUP_ENTRY_WITH_KEY_NAME select 'Inner (good)' as 'h_ee'; insert into t3 values (1); @@ -1777,7 +1777,7 @@ end| create procedure h_es() deterministic begin - declare continue handler for 1062 -- ER_DUP_ENTRY + declare continue handler for 1579 -- ER_DUP_ENTRY_WITH_KEY_NAME select 'Outer (good)' as 'h_es'; begin @@ -1823,7 +1823,7 @@ end| create procedure h_ex() deterministic begin - declare continue handler for 1062 -- ER_DUP_ENTRY + declare continue handler for 1579 -- ER_DUP_ENTRY_WITH_KEY_NAME select 'Outer (good)' as 'h_ex'; begin @@ -1842,7 +1842,7 @@ begin select 'Outer (bad)' as 'h_se'; begin - declare continue handler for 1062 -- ER_DUP_ENTRY + declare continue handler for 1579 -- ER_DUP_ENTRY_WITH_KEY_NAME select 'Inner (good)' as 'h_se'; insert into t3 values (1); @@ -2015,7 +2015,7 @@ begin select 'Outer (bad)' as 'h_xe'; begin - declare continue handler for 1062 -- ER_DUP_ENTRY + declare continue handler for 1579 -- ER_DUP_ENTRY_WITH_KEY_NAME select 'Inner (good)' as 'h_xe'; insert into t3 values (1); @@ -4507,7 +4507,7 @@ begin select bug12379(); end| ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME select bug12379()| select 1| # statement-based binlogging will show warning which row-based won't; @@ -4518,7 +4518,7 @@ select 2| call bug12379_2()| --enable_warnings select 3| ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME call bug12379_3()| select 4| @@ -4600,7 +4600,7 @@ end| call bug6127()| select * from t3| ---error ER_DUP_ENTRY +--error ER_DUP_ENTRY_WITH_KEY_NAME call bug6127()| select * from t3| set sql_mode=@sm| @@ -5528,11 +5528,11 @@ insert into t3 values (1)| create procedure bug15011() deterministic begin - declare continue handler for 1062 + declare continue handler for 1579 select 'Outer' as 'Handler'; begin - declare continue handler for 1062 + declare continue handler for 1579 select 'Inner' as 'Handler'; insert into t3 values (1); diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test index 325e11b1ec9..a79f6c7e7e0 100644 --- a/mysql-test/t/sp_trans.test +++ b/mysql-test/t/sp_trans.test @@ -89,7 +89,7 @@ create function bug10015_5(i int) returns int end if; return i; end| ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values (bug10015_5(4)), (bug10015_5(5))| select * from t1| drop function bug10015_5| diff --git a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test index 123007b10c7..d06fde87b34 100644 --- a/mysql-test/t/temp_table.test +++ b/mysql-test/t/temp_table.test @@ -73,7 +73,7 @@ drop table t1,t2; # create temporary table t1 (a int not null); insert into t1 values (1),(1); --- error 1062 +-- error ER_DUP_ENTRY_WITH_KEY_NAME alter table t1 add primary key (a); drop table t1; diff --git a/mysql-test/t/type_binary.test b/mysql-test/t/type_binary.test index 1639aff4711..c547d68d006 100644 --- a/mysql-test/t/type_binary.test +++ b/mysql-test/t/type_binary.test @@ -31,7 +31,7 @@ drop table t1; create table t1 (s1 binary(2) primary key); insert into t1 values (0x01); insert into t1 values (0x0120); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 values (0x0100); select hex(s1) from t1 order by s1; # check index search diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test index 48ad24ff6b7..8141bdedd50 100644 --- a/mysql-test/t/type_bit.test +++ b/mysql-test/t/type_bit.test @@ -39,7 +39,7 @@ drop table t1; create table t1 (a bit); insert into t1 values (b'0'), (b'1'), (b'000'), (b'100'), (b'001'); select hex(a) from t1; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME alter table t1 add unique (a); drop table t1; diff --git a/mysql-test/t/type_bit_innodb.test b/mysql-test/t/type_bit_innodb.test index dbca69d67f0..4ee97782452 100644 --- a/mysql-test/t/type_bit_innodb.test +++ b/mysql-test/t/type_bit_innodb.test @@ -40,7 +40,7 @@ drop table t1; create table t1 (a bit) engine=innodb; insert into t1 values (b'0'), (b'1'), (b'000'), (b'100'), (b'001'); select hex(a) from t1; ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME alter table t1 add unique (a); drop table t1; diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index 6d79dcc863b..cd8f2d48eea 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -334,9 +334,9 @@ drop table t1; # create table t1 (id integer primary key auto_increment, txt text not null, unique index txt_index (txt (20))); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 (txt) values ('Chevy'), ('Chevy '); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME insert into t1 (txt) values ('Chevy'), ('CHEVY'); alter table t1 drop index txt_index, add index txt_index (txt(20)); insert into t1 (txt) values ('Chevy '); diff --git a/mysql-test/t/type_varchar.test b/mysql-test/t/type_varchar.test index 439e98471b2..818fb1d19ca 100644 --- a/mysql-test/t/type_varchar.test +++ b/mysql-test/t/type_varchar.test @@ -25,7 +25,7 @@ select v='a' from t1; select binary v='a' from t1; select binary v='a ' from t1; insert into t1 values('a'); ---error 1062 +--error ER_DUP_ENTRY_WITH_KEY_NAME alter table t1 add primary key (v); drop table t1; create table t1 (v varbinary(20)); diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 7175db1db4e..3e28d8f225e 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -2553,7 +2553,9 @@ CREATE VIEW v1 AS FROM t1 HAVING Age < 75; SHOW CREATE VIEW v1; +set timestamp=1136066400; SELECT (year(now())-year(DOB)) AS Age FROM t1 HAVING Age < 75; +set timestamp=1136066400; SELECT * FROM v1; DROP VIEW v1; diff --git a/sql-bench/example b/sql-bench/example new file mode 100644 index 00000000000..8c9603a3a64 --- /dev/null +++ b/sql-bench/example @@ -0,0 +1,3 @@ +#/bin/sh +run-all-tests --prefix=-innodb --hw="AMD Athlon 4000+; 2400 MHz 1M cache, 3G memory" --optimization="gcc 4.0.2 -O3" --comments="Engine=InnoDB" --create-options="ENGINE=InnoDB" + diff --git a/sql/handler.cc b/sql/handler.cc index b134814db1e..cad745991ad 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2029,7 +2029,7 @@ void handler::print_keydup_error(uint key_nr, const char *msg) { /* Key is unknown */ str.copy("", 0, system_charset_info); - my_printf_error(ER_DUP_ENTRY, msg, + my_printf_error(ER_DUP_ENTRY_WITH_KEY_NAME, msg, MYF(0), str.c_ptr(), "*UNKNOWN*"); } else @@ -2042,7 +2042,7 @@ void handler::print_keydup_error(uint key_nr, const char *msg) str.length(max_length-4); str.append(STRING_WITH_LEN("...")); } - my_printf_error(ER_DUP_ENTRY, msg, + my_printf_error(ER_DUP_ENTRY_WITH_KEY_NAME, msg, MYF(0), str.c_ptr(), table->key_info[key_nr].name); } } @@ -2087,7 +2087,7 @@ void handler::print_error(int error, myf errflag) uint key_nr=get_dup_key(error); if ((int) key_nr >= 0) { - print_keydup_error(key_nr, ER(ER_DUP_ENTRY)); + print_keydup_error(key_nr, ER(ER_DUP_ENTRY_WITH_KEY_NAME)); DBUG_VOID_RETURN; } textno=ER_DUP_KEY; diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 5f9b9e6d563..4cf6ce4bb1e 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -1479,30 +1479,30 @@ ER_DUP_KEYNAME 42000 S1009 swe "Nyckelnamn '%-.64s' finns flera gnger" ukr " ' '%-.64s'" ER_DUP_ENTRY 23000 S1009 - cze "Zvojen-B kl '%-.64s' (slo kle '%-.64s')" - dan "Ens vrdier '%-.64s' for indeks '%-.64s'" - nla "Dubbele ingang '%-.64s' voor zoeksleutel '%-.64s'" - eng "Duplicate entry '%-.64s' for key '%-.64s'" - jps "'%-.64s' key '%-.64s' ɂďdĂ܂", - est "Kattuv vrtus '%-.64s' vtmele '%-.64s'" - fre "Duplicata du champ '%-.64s' pour la clef '%-.64s'" - ger "Doppelter Eintrag '%-.64s' fr Schlssel '%-.64s'" - greek " '%-.64s' '%-.64s'" - hun "Duplikalt bejegyzes '%-.64s' a '%-.64s' kulcs szerint." - ita "Valore duplicato '%-.64s' per la chiave '%-.64s'" - jpn "'%-.64s' key '%-.64s' ˤƽʣƤޤ" - kor "ߺ Է '%-.64s': key '%-.64s'" - nor "Like verdier '%-.64s' for nkkel '%-.64s'" - norwegian-ny "Like verdiar '%-.64s' for nykkel '%-.64s'" - pol "Powtrzone wyst?pienie '%-.64s' dla klucza '%-.64s'" - por "Entrada '%-.64s' duplicada para a chave '%-.64s'" - rum "Cimpul '%-.64s' e duplicat pentru cheia '%-.64s'" - rus " '%-.64s' '%-.64s'" - serbian "Dupliran unos '%-.64s' za klju '%-.64s'" - slo "Opakovan k '%-.64s' (slo ka '%-.64s')" - spa "Entrada duplicada '%-.64s' para la clave '%-.64s'" - swe "Dubbel nyckel '%-.64s' fr nyckel '%-.64s'" - ukr " '%-.64s' '%-.64s'" + cze "Zvojen-B kl '%-.64s' (slo kle %d)" + dan "Ens vrdier '%-.64s' for indeks %d" + nla "Dubbele ingang '%-.64s' voor zoeksleutel %d" + eng "Duplicate entry '%-.64s' for key %d" + jps "'%-.64s' key %d ɂďdĂ܂", + est "Kattuv vrtus '%-.64s' vtmele %d" + fre "Duplicata du champ '%-.64s' pour la clef %d" + ger "Doppelter Eintrag '%-.64s' fr Schlssel %d" + greek " '%-.64s' %d" + hun "Duplikalt bejegyzes '%-.64s' a %d kulcs szerint." + ita "Valore duplicato '%-.64s' per la chiave %d" + jpn "'%-.64s' key %d ˤƽʣƤޤ" + kor "ߺ Է '%-.64s': key %d" + nor "Like verdier '%-.64s' for nkkel %d" + norwegian-ny "Like verdiar '%-.64s' for nykkel %d" + pol "Powtrzone wyst?pienie '%-.64s' dla klucza %d" + por "Entrada '%-.64s' duplicada para a chave %d" + rum "Cimpul '%-.64s' e duplicat pentru cheia %d" + rus " '%-.64s' %d" + serbian "Dupliran unos '%-.64s' za klju '%d'" + slo "Opakovan k '%-.64s' (slo ka %d)" + spa "Entrada duplicada '%-.64s' para la clave %d" + swe "Dubbel nyckel '%-.64s' fr nyckel %d" + ukr " '%-.64s' %d" ER_WRONG_FIELD_SPEC 42000 S1009 cze "Chybn-B specifikace sloupce '%-.64s'" dan "Forkert kolonnespecifikaton for felt '%-.64s'" @@ -6012,4 +6012,28 @@ ER_WRONG_PARAMETERS_TO_NATIVE_FCT 42000 eng "Incorrect parameters in the call to native function '%-.64s'" ER_NATIVE_FCT_NAME_COLLISION eng "This function '%-.64s' has the same name as a native function." - +ER_DUP_ENTRY_WITH_KEY_NAME 23000 S1009 + cze "Zvojen-B kl '%-.64s' (slo kle '%-.64s')" + dan "Ens vrdier '%-.64s' for indeks '%-.64s'" + nla "Dubbele ingang '%-.64s' voor zoeksleutel '%-.64s'" + eng "Duplicate entry '%-.64s' for key '%-.64s'" + jps "'%-.64s' key '%-.64s' ɂďdĂ܂", + est "Kattuv vrtus '%-.64s' vtmele '%-.64s'" + fre "Duplicata du champ '%-.64s' pour la clef '%-.64s'" + ger "Doppelter Eintrag '%-.64s' fr Schlssel '%-.64s'" + greek " '%-.64s' '%-.64s'" + hun "Duplikalt bejegyzes '%-.64s' a '%-.64s' kulcs szerint." + ita "Valore duplicato '%-.64s' per la chiave '%-.64s'" + jpn "'%-.64s' key '%-.64s' ˤƽʣƤޤ" + kor "ߺ Է '%-.64s': key '%-.64s'" + nor "Like verdier '%-.64s' for nkkel '%-.64s'" + norwegian-ny "Like verdiar '%-.64s' for nykkel '%-.64s'" + pol "Powtrzone wyst?pienie '%-.64s' dla klucza '%-.64s'" + por "Entrada '%-.64s' duplicada para a chave '%-.64s'" + rum "Cimpul '%-.64s' e duplicat pentru cheia '%-.64s'" + rus " '%-.64s' '%-.64s'" + serbian "Dupliran unos '%-.64s' za klju '%-.64s'" + slo "Opakovan k '%-.64s' (slo ka '%-.64s')" + spa "Entrada duplicada '%-.64s' para la clave '%-.64s'" + swe "Dubbel nyckel '%-.64s' fr nyckel '%-.64s'" + ukr " '%-.64s' '%-.64s'" diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 1924f25a76a..f3f9f3da4ec 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -6660,7 +6660,7 @@ copy_data_between_tables(TABLE *from,TABLE *to, uint key_nr= to->file->get_dup_key(error); if ((int) key_nr >= 0) { - const char *err_msg= ER(ER_DUP_ENTRY); + const char *err_msg= ER(ER_DUP_ENTRY_WITH_KEY_NAME); if (key_nr == 0 && (to->key_info[0].key_part[0].field->flags & AUTO_INCREMENT_FLAG)) |