PL/SQL parser - Phase 2 (MDEV-10764)

[MDEV-11058] Put user defined exceptions to the same name space with variables Created: 2016-10-14  Updated: 2021-05-11

Status: Open
Project: MariaDB Server
Component/s: Parser
Affects Version/s: 10.3
Fix Version/s: None

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

Issue Links:
Blocks
is blocked by MDEV-4912 Data type plugin API version 1 Closed
Relates
relates to MDEV-10587 sql_mode=ORACLE: User defined exceptions Closed

 Description   

Variables and exceptions are in the same name space. Having a variable and an exception with the same name is not possible in the same scope:

DROP FUNCTION f1;
CREATE FUNCTION f1 RETURN VARCHAR
AS
  e INT:=10;
  e EXCEPTION;
BEGIN
  RAISE e;
END;
/
SHOW ERRORS;

LINE/COL ERROR
-------- -----------------------------------------------------------------
6/3	 PL/SQL: Statement ignored
6/9	 PLS-00371: at most one declaration for 'E' is permitted


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