1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-23518 Syntax error in ond SP results in misleading message on SHOW CREATE PROCEDURE

Add info to the error message how to get details about error which happened.
This commit is contained in:
Oleksandr Byelkin
2020-08-28 16:05:38 +02:00
parent bd64c2e8cc
commit acb0c9e8fd
9 changed files with 164 additions and 17 deletions

View File

@ -196,3 +196,38 @@ ERROR 22003: BIGINT value is out of range in '-73 * -2465717823867977728'
SELECT UPDATEXML(-73 * -2465717823867977728,@@global.long_query_time,null);
ERROR 22003: BIGINT value is out of range in '-73 * -2465717823867977728'
# End of 10.3 tests
#
# MDEV-23518: Syntax error in ond SP results in misleading
# message on SHOW CREATE PROCEDURE
#
CREATE PROCEDURE P1 ()
BEGIN NOT ATOMIC
IF (SELECT 2) THEN
SELECT 4;
END IF ;
END;
$$
select name,db,body from mysql.proc where name = "P1";
name db body
P1 test BEGIN NOT ATOMIC
IF (SELECT 2) THEN
SELECT 4;
END IF ;
END
update mysql.proc set body_utf8="BEGIN NOT ATOMIC
IF (SELECT 2) OR foo = 3 THEN
SELECT 4;
END IF ;
END", body="BEGIN NOT ATOMIC
IF (SELECT 2) OR foo = 3 THEN
SELECT 4;
END IF ;
END"where name = "P1";
show create procedure P1;
ERROR HY000: Failed to load routine test.P1 (internal code -6). For more details, run SHOW WARNINGS
show warnings;
Level Code Message
Error 1327 Undeclared variable: foo
Error 1457 Failed to load routine test.P1 (internal code -6). For more details, run SHOW WARNINGS
drop procedure P1;
# End of 10.4 tests