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 — [BUG] JSQLParser Version : 4.6 : If there is a '.' in JdbcNamedParameter, parsing will fail! · Issue #1768 · JSQLParser/JSqlParser

[BUG] JSQLParser Version : 4.6 : If there is a '.' in JdbcNamedParameter, parsing will fail! #1768

New issue
Copy link
New issue
Copy link
Closed
#1778
Closed
[BUG] JSQLParser Version : 4.6 : If there is a '.' in JdbcNamedParameter, parsing will fail!#1768
#1778
Copy link

Description

@Lzw2016
Lzw2016
opened on Apr 19, 2023
Issue body actions

If there is a '.' in JdbcNamedParameter, parsing will fail:

  • SELECT 1 FROM dual WHERE a = :paramMap.aValue

SQL Example:

-- If there is a '.' sign in JdbcNamedParameter, parsing will fail
String sql = "SELECT 1 FROM dual WHERE a = :paramMap.aValue";
Statement statement = CCJSqlParserUtil.parse(sql);

-- This situation occurs when using the foreach tag of mybatis:
-- ... where line_no in ( :__frch_item_0.receipt_line_no,  :__frch_item_1.receipt_line_no,  :__frch_item_2.receipt_line_no)

Error Info:

net.sf.jsqlparser.JSQLParserException: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "." "."
    at line 1, column 39.

Was expecting one of:

    "&"
    "::"
    "<<"
    ">>"
    "CONNECT"
    "EMIT"
    "GROUP"
    "HAVING"
    "START"
    "WINDOW"
    "["
    "^"
    "|"
    <EOF>
    <ST_SEMICOLON>

Activity

  1. manticore-projects commented on Apr 19, 2023

    @manticore-projects
    manticore-projects
    on Apr 19, 2023
    Contributor
    More actions

    Yes, and I do not really understand why you would like to change that.
    The correct SQL should look like this:

    SELECT 1 FROM dual WHERE a = :aValue

    I have the feeling, that you would need to report this upstream to myBatis instead toJSQLParser.

  2. Lzw2016 commented on Apr 19, 2023

    @Lzw2016
    Lzw2016
    on Apr 19, 2023
    Author
    More actions

    Okay, I have my own solution。
    I just think it's best not to restrict the naming of JdbcNamedParameter as spring jdbc's JdbcTemplate also supports the form of "a=: paramMap. aValue"

  3. manticore-projects
    added a commit that references this issue on Apr 29, 2023

    feat: Multi-Part Names for Variables and Parameters

    This issue will close once commit 9da7a06 is merged into the 'master' branch.
    9da7a06
  4. manticore-projects
    closed this as completedin #1778on Jun 1, 2023
  5. manticore-projects
    added a commit that references this issue on Jun 1, 2023

    JSQLParser 5.0 (#1778)

    This issue will close once commit 41b6fce is merged into the 'master' branch.
    41b6fce
  6. manticore-projects
    added a commit that references this issue on Jun 15, 2023

    Assorted Fixes #8 (#1807)

    This issue will close once commit a815f5f is merged into the 'master' branch.
    a815f5f
  7. manticore-projects
    added a commit that references this issue on Jun 27, 2023

    Backslash Quotation of Single-Quote `'\\''` (#1813)

    This issue will close once commit c79dfff is merged into the 'master' branch.
    c79dfff
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.