Skip to content

offset statement can't support nameparameter parser #612

Description

@MarvellousLiang

Actual Behavior

Caused by:
net.sf.jsqlparser.parser.ParseException: Encountered " ":" ": "" at line 1, column 33.
Was expecting one of:
    <S_LONG> ...
    "?" ...
    
	at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:16869)
	at net.sf.jsqlparser.parser.CCJSqlParser.jj_consume_token(CCJSqlParser.java:16722)
	at net.sf.jsqlparser.parser.CCJSqlParser.Offset(CCJSqlParser.java:4700)

Expected Behavior

select a from b limit 10 offset :param can be parsered;

Steps to Reproduce the Problem

1.My test case:

   @Test
    public void testParse() throws Exception {
        String sql = "select a from b limit 10 offset :param";
        Statement parse = CCJSqlParserUtil.parse(sql);
        System.out.println(parse);
    }

2.Parser sql select a from b limit 10,:param is work,but offset can not

Specifications

  • Version: 1.1
  • Platform:
  • Subsystem:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions