1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

Give warnings for unused objects

Changed error message to be compatible with old error file
Added new error message for new DUP_ENTRY syntax
This commit is contained in:
monty@mysql.com/narttu.mysql.fi
2007-01-22 18:42:52 +02:00
parent 693b906f6e
commit 2dcc7110c9
60 changed files with 282 additions and 251 deletions

View File

@@ -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()`;

View File

@@ -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;