GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — WithIsolation regression between v4.3 and v4.4 · Issue #1520 · JSQLParser/JSqlParser

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

New issue
Copy link
New issue
Copy link
Closed
Closed
WithIsolation regression between v4.3 and v4.4#1520
Copy link

Description

@bedla
bedla
opened on Apr 26, 2022
Issue body actions

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

  • https://github.com/JSQLParser/JSqlParser/blob/jsqlparser-4.4/src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt#L215
  • Regression commit 3e97652

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
    chiangcho
    on Apr 27, 2022
    Contributor
    More actions

    I will fix it today

  2. chiangcho
    added a commit that references this issue on Apr 27, 2022

    fixs JSQLParser#1520

    ece180f
  3. manticore-projects commented on Apr 27, 2022

    @manticore-projects
    manticore-projects
    on Apr 27, 2022
    Contributor
    More actions

    @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. wumpz
    added a commit that references this issue on May 11, 2022

    fixs #1520 (#1521)

    f7f9d27
  5. manticore-projects commented on Nov 12, 2022

    @manticore-projects
    manticore-projects
    on Nov 12, 2022
    Contributor
    More actions

    Closed, since no further question has been asked.

  6. manticore-projects
    closed this as completedon Nov 12, 2022
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

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.