Syntax error at or near "WHERE" on AD window.

Description

If virtual column has new line after Select clause in sub query, opening window throw exception

Environment

None

Activity

Show:
Deepak Pansheriya
March 27, 2014, 12:12 PM

Attached is patch containing fix as well as unit test cases.

Carlos Ruiz
March 27, 2014, 2:55 PM

Hi , I think the patch is dangerous as eventually it could replace newlines within a text, i.e. a virtual column like:

will be changed in the AccessSqlParser. Indeed the actual code can change newlines within text for the words FROM and WHERE, I this is better to avoid adding more potential cases.

Also, if you write your subquery like "( SELECT ..." it will fail again because line 176 of AccessSqlParser is looking for a strict notation.

The workaround is very simple, just add a space in front of the SELECT

What I understand from the AccessSqlParser class is that you need to follow some strict guidelines to work with that - i.e. some uppercase reserved words - I think it would be valuable to write a wiki page with the rules required (in this case subqueries must conform to "(SELECT " notation.

Regards,

Carlos Ruiz

Deepak Pansheriya
March 27, 2014, 5:02 PM

Carlos,

Undestood. Should you think we should replace "(SELECT\n" or "(SELECT\t" with "(SELECT "?

Carlos Ruiz
March 27, 2014, 5:06 PM

No Deepak, I think is better to change the virtual column in such case.

Assignee

Deepak Pansheriya

Reporter

Deepak Pansheriya

Labels

Tested By

None

Components

Fix versions

Affects versions

Priority

Major
Configure