[MDEV-22822] sql_mode="oracle" cannot declare without variable errors Created: 2020-05-14  Updated: 2022-01-07  Resolved: 2020-06-07

Status: Closed
Project: MariaDB Server
Component/s: Parser
Affects Version/s: None
Fix Version/s: 10.5.4, 10.3.24, 10.4.14

Type: Bug Priority: Major
Reporter: Manjot Singh (Inactive) Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: Compatibility


 Description   

'DECLARE' statement without any variable declaration followed generate error.

BEGIN
  DECLARE
  BEGIN
    null; 
  END;
EXCEPTION
WHEN OTHERS THEN
    null;
END;
/



 Comments   
Comment by Julien Fritsch [ 2020-06-02 ]

bar confirmed that this is a bug.

Comment by Alexander Barkov [ 2020-06-07 ]

The same syntax error is raised for these scripts:

SET sql_mode=ORACLE;
DELIMITER /
DECLARE
BEGIN
  NULL;
EXCEPTION
WHEN OTHERS THEN
    null;
END;
/
DELIMITER ;

SET sql_mode=ORACLE;
DELIMITER /
BEGIN
<<lab>>
  DECLARE
  BEGIN
    null; 
  END;
EXCEPTION
WHEN OTHERS THEN
    null;
END;
/
DELIMITER ;

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