Skip to content

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

Closed
@bedla

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

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