mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
merge bugfuxes for sp-error.test
This commit is contained in:
@ -1315,19 +1315,25 @@ drop procedure test_signal $$
|
||||
#
|
||||
# Test where SIGNAL can be used
|
||||
#
|
||||
|
||||
# RETURN statement clears Diagnostics Area, thus
|
||||
# the warnings raised in a stored function are not
|
||||
# visible outsidef the stored function. So, we're using
|
||||
# @@warning_count variable to check that SIGNAL succeeded.
|
||||
|
||||
create function test_signal_func() returns integer
|
||||
begin
|
||||
DECLARE v INT;
|
||||
DECLARE warn CONDITION FOR SQLSTATE "01XXX";
|
||||
SIGNAL warn SET
|
||||
MESSAGE_TEXT = "This function SIGNAL a warning",
|
||||
MYSQL_ERRNO = 1012;
|
||||
return 5;
|
||||
SELECT @@warning_count INTO v;
|
||||
return v;
|
||||
end $$
|
||||
select test_signal_func() $$
|
||||
test_signal_func()
|
||||
5
|
||||
Warnings:
|
||||
Warning 1012 This function SIGNAL a warning
|
||||
1
|
||||
drop function test_signal_func $$
|
||||
create function test_signal_func() returns integer
|
||||
begin
|
||||
|
Reference in New Issue
Block a user