Skip to content

WithIsolation regression between v4.3 and v4.4 #1520

Closed

Description

@bedla

Hi,
I found that following query cannot be parsed with v4.4, but with v4.3 it is ok.

    @Test
    void name1() throws JSQLParserException {
        final String statement = "" +
                "SELECT rresult.RR_DS_GUID,\n" +
                "       rresult.RR_OGUID              AS r_oguid,\n" +
                "       rs.RSR_ACTIVE                 as barActive\n" +
                "FROM foo.AA_XXX_RRESULT rresult\n" +
                "WHERE rresult.RR_DS_GUID = ?\n" +
                "      and r.RR_DELETED = 0" +
                "";
        assertSqlCanBeParsedAndDeparsed(statement, true,
                parser -> parser.withSquareBracketQuotation(true));
    }

When I change rs alias to something else, it is parsed correctly. I found that it is because of WithIsolation() parsing and token. When I remove it in v4.4, it is parsed correctly.

See

Mind that my SQL is isolated test case, and is part of much bigger SQL, and I am able to run it by MSSQL without error.

I am currently trying to create PR, but JavaCC is new to me (I am used to work with ANTLR).

What do you think?

Thx

Ivos

cc @chiangcho

Activity

  1. chiangcho commented on Apr 27, 2022

    @chiangcho
    Contributor

    I will fix it today

  2. added a commit that references this issue on Apr 27, 2022
  3. manticore-projects commented on Apr 27, 2022

    @manticore-projects
    Contributor

    @wumpz: looks to me like this was a perfect illustration, why the proposed Keywords-Improvement is needed.
    The Update Keywords mechanism would have avoided both the Issue Report and also the PR addressing it. And the parametrized test would have revealed the problem during the WithIsolation PR cycle.

  4. added a commit that references this issue on May 11, 2022
  5. manticore-projects commented on Nov 12, 2022

    @manticore-projects
    Contributor

    Closed, since no further question has been asked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions