#86 DefaultMdxParserImpl parses successfuly queries with syntax errors

olap4j-1.1
open
nobody
None
5
2014-01-08
2014-01-08
Stelios
No

There seems to be an bug in the parser. Consider the following test

String mdx = "SELECT [a] ON COLUMNS, [b] ON ROWS FROM cube WHERE CROSSJOIN([a], [b]), Filter([x], [y]>0))";
SelectNode selectNode = new DefaultMdxParserImpl().parseSelect(mdx);

The paranthesis in the where clause are not balanced (there is a redudant parenthesis after node [b]). So I would expect that this would throw an error. Instead, the problematic part is simply ignored. The parser parses this expression as:
SELECT [a] ON COLUMNS, [b] ON ROWS FROM cube WHERE CROSSJOIN([a], [b])

Discussion

  • Julian Hyde
    Julian Hyde
    2014-01-08

    Sounds like the parser is not trying to match <end-of-file>, and it should be.

    The same problem may exist in Mondrian's parser.