Skip to content

[PL/SQL] Parser fails on NOT IN — grammar missing case #4656

@samelat

Description

@samelat

Hey, I noticed that the PL/SQL grammar doesn’t handle NOT IN (or even plain IN) inside relational_expression.
Here’s the current rule:

relational_expression
    : relational_expression relational_operator relational_expression
    | compound_expression
    ;

This misses the NOT? IN case.

Example that fails (but is valid Oracle code):

IF NOT internal AND
    object_category IN (VEC_CAT_OBJECT_LIST, VEC_CAT_FEEDBACK) AND
    (allowed_categories IS NULL OR
     object_category NOT MEMBER OF allowed_categories)
THEN

Suggested fix:

relational_expression
    : relational_expression relational_operator relational_expression
    | relational_expression NOT? IN in_elements
    | compound_expression
    ;

Thanks guys! Excellent project :D

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions