Skip to content

error when whitespace chars present after open curly bracket in function expression #753

@xsgao-github

Description

@xsgao-github

Actual Behavior

	String query = "select { fn Substring('abc', 1, 3) }";
	System.out.println(CCJSqlParserUtil.parse(query));

Throws error:
Exception in thread "main" net.sf.jsqlparser.parser.TokenMgrError: Lexical error at line 1, column 9. Encountered: " " (32), after : "{"
at net.sf.jsqlparser.parser.CCJSqlParserTokenManager.getNextToken(CCJSqlParserTokenManager.java:2267)
at net.sf.jsqlparser.parser.CCJSqlParser.jj_scan_token(CCJSqlParser.java:13878)

Expected Behavior

I did not find any documentation regarding if whitespace chars are allowed after open curly brackets (or before close brackets) , but SQL support it.

If I remove whitespace, "{fn Substring('abc', 1, 3)}", jsqlparser will parse this query.

Steps to Reproduce the Problem

  1. Put two lines above in your Java code.

Specifications

  • Version: jsqlparser-0.9.5.jar
  • Platform: Win
  • Subsystem: 10

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