Skip to content

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

Closed
@Lzw2016

Description

@Lzw2016

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>

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