Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL: Skip PL/SQL selection directives and add sanity check for inquiry directive size #3654

Merged
merged 1 commit into from
Mar 21, 2023

Commits on Mar 21, 2023

  1. sql: parse PL/SQL selection directives

    PLSQL selection directives are of the form
    
    $IF boolean_static_expression $THEN
       text
    [ $ELSIF boolean_static_expression $THEN
       text
    ]...
    [ $ELSE
       text
    ]
    $END
    
    In addition, boolean_static_expression conditions like
    
    $$MY_CUSTOM_VAR > 3
    
    can appear which confuses the current parser because it
    thinks $$ is the start of dollar-quoted string and drops
    the rest of the code.
    
    This patch keeps only the $IF branch and skips all the code
    between $ELSE or $ELSIF and $END. In addition, this patch
    also drops $ from all identifiers starting with $$ behind
    $IF and $ELSIF as these may be conditional variables and
    not dollar-quoted strings.
    techee committed Mar 21, 2023
    Configuration menu
    Copy the full SHA
    78a7342 View commit details
    Browse the repository at this point in the history