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