mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user