Skip to content

Replace parser fails on processing own statement toString output #57

@aegisql

Description

@aegisql

One should expect that "toString" output of any statement should be not only functionally identical to the original query text, but can be also used to create another statement with the same result.
For replace statements it works only for simple queries. If query contains sub select it fails
Example:
Original query:
replace a_table (ID,A,B) select A_ID,A,B from b_table
Statement's toString output:
REPLACE a_table (ID, A, B) (SELECT A_ID, A, B FROM b_table WHERE D = 0)

This output used as an input string for another statement fails with the following parser error:
net.sf.jsqlparser.parser.ParseException: Encountered " "(" "( "" at line 1, column xxx.
Was expecting:
"SELECT" ...

Similar INSERT works fine.

Metadata

Metadata

Assignees

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