Skip to content

Commit 2dcc711

Browse files
author
[email protected]/narttu.mysql.fi
committed
Give warnings for unused objects
Changed error message to be compatible with old error file Added new error message for new DUP_ENTRY syntax
1 parent 693b906 commit 2dcc711

60 files changed

Lines changed: 282 additions & 251 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BUILD/SETUP.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ if [ "x$warning_mode" != "xpedantic" ]; then
9292
# Both C and C++ warnings
9393
warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W"
9494
warnings="$warnings -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare"
95-
warnings="$warnings -Wwrite-strings"
95+
warnings="$warnings -Wwrite-strings -Wunused-function -Wunused-label -Wunused-value -Wunused-variable -Wshadow"
9696
# C warnings
97-
c_warnings="$warnings -Wunused"
97+
c_warnings="$warnings -Wunused-parameter"
9898
# C++ warnings
9999
cxx_warnings="$warnings -Woverloaded-virtual -Wsign-promo -Wreorder"
100100
cxx_warnings="$warnings -Wctor-dtor-privacy -Wnon-virtual-dtor"

mysql-test/extra/binlog_tests/insert_select-binlog.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ insert into t1 values(2);
1313
create table t2(a int);
1414
insert into t2 values(1),(2);
1515
reset master;
16-
--error 1062
16+
--error ER_DUP_ENTRY_WITH_KEY_NAME
1717
insert into t1 select * from t2;
1818
# The above should produce an error, but still be in the binlog;
1919
# verify the binlog :
@@ -29,7 +29,7 @@ drop table t1, t2;
2929
create table t1(a int);
3030
insert into t1 values(1),(1);
3131
reset master;
32-
--error 1062
32+
--error ER_DUP_ENTRY_WITH_KEY_NAME
3333
create table t2(unique(a)) select a from t1;
3434
# The above should produce an error, *and* not appear in the binlog
3535
let $VERSION=`select version()`;

mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -273,25 +273,25 @@ set autocommit=0;
273273
CREATE TABLE t1 (a int, b int) engine=myisam;
274274
reset master;
275275
INSERT INTO t1 values (1,1),(1,2);
276-
--error 1062
276+
--error ER_DUP_ENTRY_WITH_KEY_NAME
277277
CREATE TABLE t2 (primary key (a)) engine=innodb select * from t1;
278278
# This should give warning
279279
DROP TABLE if exists t2;
280280
INSERT INTO t1 values (3,3);
281-
--error 1062
281+
--error ER_DUP_ENTRY_WITH_KEY_NAME
282282
CREATE TEMPORARY TABLE t2 (primary key (a)) engine=innodb select * from t1;
283283
ROLLBACK;
284284
# This should give warning
285285
DROP TABLE IF EXISTS t2;
286286

287287
CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb;
288288
INSERT INTO t1 VALUES (4,4);
289-
--error 1062
289+
--error ER_DUP_ENTRY_WITH_KEY_NAME
290290
CREATE TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
291291
SELECT * from t2;
292292
TRUNCATE table t2;
293293
INSERT INTO t1 VALUES (5,5);
294-
--error 1062
294+
--error ER_DUP_ENTRY_WITH_KEY_NAME
295295
INSERT INTO t2 select * from t1;
296296
SELECT * FROM t2;
297297
DROP TABLE t2;
@@ -301,25 +301,25 @@ CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)) engine=innodb ;
301301
INSERT INTO t1 values (7,7);
302302
ROLLBACK;
303303
INSERT INTO t1 values (8,8);
304-
--error 1062
304+
--error ER_DUP_ENTRY_WITH_KEY_NAME
305305
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
306306
COMMIT;
307307
INSERT INTO t1 values (9,9);
308-
--error 1062
308+
--error ER_DUP_ENTRY_WITH_KEY_NAME
309309
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
310310
ROLLBACK;
311311
SELECT * from t2;
312312
TRUNCATE table t2;
313313
INSERT INTO t1 values (10,10);
314-
--error 1062
314+
--error ER_DUP_ENTRY_WITH_KEY_NAME
315315
INSERT INTO t2 select * from t1;
316316
SELECT * from t1;
317317
INSERT INTO t2 values (100,100);
318-
--error 1062
318+
--error ER_DUP_ENTRY_WITH_KEY_NAME
319319
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
320320
COMMIT;
321321
INSERT INTO t2 values (101,101);
322-
--error 1062
322+
--error ER_DUP_ENTRY_WITH_KEY_NAME
323323
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
324324
ROLLBACK;
325325
SELECT * from t2;

mysql-test/extra/rpl_tests/rpl_auto_increment.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ insert into t1 values (NULL),(5),(NULL),(NULL);
7676
insert into t1 values (500),(NULL),(502),(NULL),(NULL);
7777
select * from t1;
7878
set @@insert_id=600;
79-
--error 1062
79+
--error ER_DUP_ENTRY_WITH_KEY_NAME
8080
insert into t1 values(600),(NULL),(NULL);
8181
set @@insert_id=600;
8282
insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
@@ -119,7 +119,7 @@ set auto_increment_increment=11;
119119
set auto_increment_offset=4;
120120
insert into t1 values(null);
121121
insert into t1 values(null);
122-
--error 1062
122+
--error ER_DUP_ENTRY_WITH_KEY_NAME
123123
insert into t1 values(null);
124124
select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t1 order by a;
125125

mysql-test/extra/rpl_tests/rpl_foreign_key.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ SET TIMESTAMP=1000000000;
2222
CREATE TABLE t3 ( a INT UNIQUE );
2323
SET FOREIGN_KEY_CHECKS=0;
2424
# Had to add 1022 for run with ndb as ndb uses different
25-
# error and error code for 1062. Bug 16677
26-
--error 1022, 1062
25+
# error and error code for error ER_DUP_ENTRY_WITH_KEY_NAME. Bug 16677
26+
--error 1022, ER_DUP_ENTRY_WITH_KEY_NAME
2727
INSERT INTO t3 VALUES (1),(1);
2828
sync_slave_with_master;
2929

mysql-test/extra/rpl_tests/rpl_insert_id.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ SET TIMESTAMP=1000000000;
9797
CREATE TABLE t1 ( a INT UNIQUE );
9898
SET FOREIGN_KEY_CHECKS=0;
9999
# Duplicate Key Errors
100-
--error 1022, 1062
100+
--error 1022, ER_DUP_ENTRY_WITH_KEY_NAME
101101
INSERT INTO t1 VALUES (1),(1);
102102
sync_slave_with_master;
103103
connection master;

mysql-test/extra/rpl_tests/rpl_insert_id_pk.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ SET TIMESTAMP=1000000000;
8080
CREATE TABLE t1 ( a INT UNIQUE );
8181
SET FOREIGN_KEY_CHECKS=0;
8282
# Duplicate Key Errors codes
83-
--error 1022, 1062
83+
--error 1022, ER_DUP_ENTRY_WITH_KEY_NAME
8484
INSERT INTO t1 VALUES (1),(1);
8585
sync_slave_with_master;
8686
connection master;

mysql-test/extra/rpl_tests/rpl_loaddata.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ connection master;
130130
reset master;
131131
eval create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
132132
unique(day)) engine=$engine_type; # no transactions
133-
--error 1062
133+
--error ER_DUP_ENTRY_WITH_KEY_NAME
134134
load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
135135
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
136136
'\n##\n' starting by '>' ignore 1 lines;
@@ -146,7 +146,7 @@ select * from t2;
146146
alter table t2 drop key day;
147147
connection master;
148148
delete from t2;
149-
--error 1062
149+
--error ER_DUP_ENTRY_WITH_KEY_NAME
150150
load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
151151
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
152152
'\n##\n' starting by '>' ignore 1 lines;

mysql-test/extra/rpl_tests/rpl_row_basic.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,11 @@ eval CREATE TABLE t8 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = $t
196196

197197
# First we make sure that the constraints are correctly set.
198198
INSERT INTO t8 VALUES (99,99,99);
199-
--error 1062
199+
--error ER_DUP_ENTRY_WITH_KEY_NAME
200200
INSERT INTO t8 VALUES (99,22,33);
201-
--error 1062
201+
--error ER_DUP_ENTRY_WITH_KEY_NAME
202202
INSERT INTO t8 VALUES (11,99,33);
203-
--error 1062
203+
--error ER_DUP_ENTRY_WITH_KEY_NAME
204204
INSERT INTO t8 VALUES (11,22,99);
205205
SELECT * FROM t8 ORDER BY a;
206206

mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ set sql_log_bin=0;
1919
insert into t1 values(2);
2020
set sql_log_bin=1;
2121
save_master_pos;
22-
--error 1062
22+
--error ER_DUP_ENTRY_WITH_KEY_NAME
2323
insert into t1 values(1),(2);
2424
drop table t1;
2525
save_master_pos;

0 commit comments

Comments
 (0)