[MDEV-26832] ROW_NUMBER in SIGNAL/RESIGNAL causes a syntax error Created: 2021-10-14  Updated: 2021-10-26  Resolved: 2021-10-20

Status: Closed
Project: MariaDB Server
Component/s: Parser
Affects Version/s: N/A
Fix Version/s: 10.7.1

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Rucha Deodhar
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-10075 Provide index of error causing error ... Closed

 Description   

DROP TABLE t1;
delimiter $
BEGIN NOT ATOMIC
  DECLARE EXIT HANDLER FOR SQLEXCEPTION
    SIGNAL SQLSTATE '45000' SET ROW_NUMBER= 5;
  DROP TABLE t1;
END $
delimiter ;

bb-10.7-row_number cb9002bee

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ROW_NUMBER= 5;
  DROP TABLE t1;

Same with RESIGNAL.

An example of a working diagnostics property:

MariaDB [test]> delimiter ;
MariaDB [test]> DROP TABLE t1;
ERROR 1051 (42S02): Unknown table 'test.t1'
MariaDB [test]> delimiter $
MariaDB [test]> BEGIN NOT ATOMIC
    ->   DECLARE EXIT HANDLER FOR SQLEXCEPTION
    ->     SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT= 'my signal here';
    ->   DROP TABLE t1;
    -> END $
ERROR 1644 (45000): my signal here
MariaDB [test]> delimiter ;



 Comments   
Comment by Rucha Deodhar [ 2021-10-14 ]

Patch: https://github.com/MariaDB/server/commit/97458a7767bd06c9e21edbb43a64ab0b504983cd

Comment by Rucha Deodhar [ 2021-10-17 ]

Pushed to bb-10.7-row_number

Generated at Thu Feb 08 09:48:17 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.