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 — 4.3Release:Error SQL:select database() from dual · Issue #1443 · JSQLParser/JSqlParser

4.3Release:Error SQL:select database() from dual #1443

New issue
Copy link
New issue
Copy link
Closed
#1382
Closed
4.3Release:Error SQL:select database() from dual#1443
#1382
Copy link

Description

@ahgaoyong
ahgaoyong
opened on Dec 13, 2021
Issue body actions

DB : mysql5.7
JSqlParser : 4.3

public static void main(String[] args) {
        String sql = "select database() from dual";
        try {
            Statement statement = CCJSqlParserUtil.parse(sql);
            System.out.println(statement.toString());
        } catch (JSQLParserException e) {
            throw new RuntimeException(e.getCause() + "Failed to process, Error SQL:" + sql);
        }
    }

run result:

Exception in thread "main" java.lang.RuntimeException: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "database" "DATABASE"
    at line 1, column 8.

Was expecting one of:

    "*"
    "STRAIGHT_JOIN"
Failed to process, Error SQL:select database() from dual
	at com.ruoyi.common.Test.main(Test.java:15)

Greetings.

this bug not fixed on release-4.3, but Why does it work normally with 4.3-Snapshot ?


Activity

  1. ahgaoyong
    changed the title [-]Error SQL:select database() from dual[/-] [+]4.3:Error SQL:select database() from dual[/+] on Dec 13, 2021
  2. ahgaoyong
    changed the title [-]4.3:Error SQL:select database() from dual[/-] [+]4.3Release:Error SQL:select database() from dual[/+] on Dec 13, 2021
  3. wumpz commented on Dec 20, 2021

    @wumpz
    wumpz
    on Dec 20, 2021
    Member
    More actions

    In one of PRs that were never deployed to 4.3-SNAPSHOT there was a construct included using a new keyword "database". That's why in the release this does not work anymore.

    select database2() from dual

    works.

  4. manticore-projects commented on Dec 30, 2021

    @manticore-projects
    manticore-projects
    on Dec 30, 2021
    Contributor
    More actions

    Solved by PR #1382 (which properly allows token for certain use.)

  5. wumpz
    closed this as completedin #1382on Oct 25, 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.