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

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

Closed
bedla opened this issue Apr 26, 2022 · 3 comments
Closed

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

bedla opened this issue Apr 26, 2022 · 3 comments

Comments

@bedla
Copy link

bedla commented Apr 26, 2022

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

@chiangcho
Copy link
Contributor

I will fix it today

chiangcho pushed a commit to chiangcho/JSqlParser that referenced this issue Apr 27, 2022
@manticore-projects
Copy link
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.

wumpz pushed a commit that referenced this issue May 11, 2022
@manticore-projects
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants