[MDEV-17666] sql_mode=ORACLE: Keyword ELSEIF should not be reserved Created: 2018-11-11  Updated: 2018-11-11  Resolved: 2018-11-11

Status: Closed
Project: MariaDB Server
Component/s: Parser
Affects Version/s: 10.3
Fix Version/s: 10.3.11

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-12518 Unify sql_yacc.yy and sql_yacc_ora.yy Closed

 Description   

The keyword ELSEIF does not have a special meaning on Oracle. These scripts work fine on Oracle:

DECLARE
  ELSEIF INT;
BEGIN
  ELSEIF:=1;
END;
/

BEGIN
<<ELSEIF>>
  NULL;
END;
/

Equivalent MariaDB scripts produce systax errors:

SET sql_mode=ORACLE;
DELIMITER /
DECLARE
  ELSEIF INT;
BEGIN
  ELSEIF:=1;
END;
/
DELIMITER ;

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 'ELSEIF INT;...

SET sql_mode=ORACLE;
DELIMITER /
BEGIN
<<ELSEIF>>
  NULL;
END;
/
DELIMITER ;

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 'ELSEIF>>


Generated at Thu Feb 08 08:38:11 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.