Details
-
Bug
-
Status: In Review (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.7(EOL)
-
None
Description
Notes:
- The test case uses explicit HANDLER / RESIGNAL for more obvious demonstration, but it is really the same without any handler, when the error remains uncaught and gets passed over to the upper level.
- If you run the test case via MTR, remember to adjust delimiters.
create or replace function f(a int) returns int return a; |
delimiter $
|
create or replace function f2() returns int |
begin
|
declare i int default -1; |
declare exit handler for 1318 |
begin |
get diagnostics condition 1 @row_number_in_f2= row_number, @msg_in_f2= message_text;
|
resignal;
|
return -2; |
end; |
select f() into i; |
return i; |
end $ |
delimiter ;
|
|
--error ER_SP_WRONG_NO_OF_ARGS
|
select f2(); |
|
get diagnostics condition 1 @row_number_outside= row_number, @msg_outside= message_text;
|
select @row_number_in_f2, @msg_in_f2; |
select @row_number_outside, @msg_outside; |
|
# Cleanup
|
drop function f2; |
drop function f; |
bb-10.7-row_number cb9002be |
MariaDB [test]> select @row_number_in_f2, @msg_in_f2; |
+-------------------+----------------------------------------------------------------------+ |
| @row_number_in_f2 | @msg_in_f2 |
|
+-------------------+----------------------------------------------------------------------+ |
| 1 | Incorrect number of arguments for FUNCTION test.f; expected 1, got 0 | |
+-------------------+----------------------------------------------------------------------+ |
1 row in set (0.000 sec) |
|
MariaDB [test]> select @row_number_outside, @msg_outside; |
+---------------------+----------------------------------------------------------------------+ |
| @row_number_outside | @msg_outside |
|
+---------------------+----------------------------------------------------------------------+ |
| 0 | Incorrect number of arguments for FUNCTION test.f; expected 1, got 0 | |
+---------------------+----------------------------------------------------------------------+ |
1 row in set (0.000 sec) |
So, while the error message is passed over to the caller, the ROW_NUMBER isn't.
There must be plenty other examples like this.
Attachments
Issue Links
- is caused by
-
MDEV-10075 Provide index of error causing error in array INSERT
- Closed