PL/SQL parser (MDEV-10142)

[MDEV-10580] sql_mode=ORACLE: FOR loop statement Created: 2016-08-17  Updated: 2023-10-04  Resolved: 2016-08-24

Status: Closed
Project: MariaDB Server
Component/s: Parser, Stored routines
Affects Version/s: None
Fix Version/s: 10.3.0

Type: Technical task Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: Compatibility

Issue Links:
Problem/Incident
causes MDEV-32275 getting error 'Illegal parameter data... Closed
Relates
relates to MDEV-16674 Document FOR loop Open
Sprint: 10.2.2-3, 10.2.2-1, 10.2.2-2, 10.2.2-4, 10.1.18

 Description   

Add support for the Oracle-style FOR loop when running in sql_mode=ORACLE

FOR index IN [ REVERSE ] lower_bound .. upper_bound
LOOP statements
END LOOP [ label ] ;

There must be at least one statement.

The two dots must have no spaces between, otherwise an error is returned:

BEGIN
  FOR i IN 1 .  . 10 LOOP
    NULL;
  END LOOP;
END;
/

ORA-06550: line 2, column 14:
PLS-00103: Encountered the symbol "." when expecting one of the following:
* & - + / at mod remainder rem .. <an exponent (**)> ||
multiset


Generated at Thu Feb 08 07:43:18 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.