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 — where table_name = select database() has exception · Issue #1508 · JSQLParser/JSqlParser

where table_name = select database() has exception #1508

New issue
Copy link
New issue
Copy link
Closed
#1382
Closed
where table_name = select database() has exception#1508
#1382
Copy link

Description

@luoguohua
luoguohua
opened on Apr 11, 2022
Issue body actions

Describe the bug
paser where table_name = select database() has exception

To Reproduce Example

       public static void main(String[] args) throws JSQLParserException {
        String sql = " select table_name, table_comment, create_time, update_time from information_schema.tables " +
                " where table_schema = (select database()) ";
        Statement statement = CCJSqlParserUtil.parse(sql);
        System.out.println(statement.toString());
    }

Exception out

Exception in thread "main" net.sf.jsqlparser.JSQLParserException: Encountered unexpected token: "=" "="
    at line 1, column 112.

Was expecting one of:

    "&"
    "::"
    ";"
    "<<"
    ">>"
    "COLLATE"
    "CONNECT"
    "EMIT"
    "GROUP"
    "HAVING"
    "START"
    "["
    "^"
    "|"
    <EOF>

	at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatement(CCJSqlParserUtil.java:190)
	at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:63)
	at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:38)
	at com.seerbigdata.tourism.common.config.MybatisPlusConfig.main(MybatisPlusConfig.java:158)
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "=" "="
    at line 1, column 112.

Was expecting one of:

    "&"
    "::"
    ";"
    "<<"
    ">>"
    "COLLATE"
    "CONNECT"
    "EMIT"
    "GROUP"
    "HAVING"
    "START"
    "["
    "^"
    "|"
    <EOF>

	at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:31468)
	at net.sf.jsqlparser.parser.CCJSqlParser.jj_consume_token(CCJSqlParser.java:31301)
	at net.sf.jsqlparser.parser.CCJSqlParser.Statement(CCJSqlParser.java:163)
	at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatement(CCJSqlParserUtil.java:188)
	... 3 more

System

  • MySQL-v8.0.27
  • java version "1.8.0_31"
  • JSqlParser 4.4

Activity

  1. manticore-projects commented on Apr 11, 2022

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

    Fixed by PR #1382 which is pending approval.
    You can pull and compile in the meantime to get a working JAR.

  2. 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.