Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query parsing error (read/write splitting mode) #776

Closed
leo-ural opened this issue Aug 16, 2024 · 2 comments
Closed

Query parsing error (read/write splitting mode) #776

leo-ural opened this issue Aug 16, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@leo-ural
Copy link

An error occurs while pgcat is in read/write queries splitting mode.
Original SQL query is:
SELECT req_tab_0.* FROM validation req_tab_0 WHERE array['http://www.w3.org/ns/shacl#ValidationResult'] && req_tab_0.type::text[] AND ( ( (req_tab_0.focusnode = 'DataSource_Credilogic_DataSourceAddress_144959227') ) )

When parsing the query pgcat has logged an error:
QueryRouterParserError("sql parser error: Expected an expression:, found: &")

Version: pgcat-0.1.0

@pchaseh
Copy link

pchaseh commented Aug 19, 2024

The 0.1.0 release was built on Feb 22nd, where-in sqlparser v0.34 would have still been in use. You can see from the commit apache/datafusion-sqlparser-rs@a50671d that support for the overlap operator is only available in v0.36 or later. You'll have to build your own pgcat binary from the latest master branch until the maintainers offer a newer release which includes sqlparser v0.41 (see 0d94d0b).

@drdrsh drdrsh added the bug Something isn't working label Aug 31, 2024
@drdrsh
Copy link
Collaborator

drdrsh commented Aug 31, 2024

I verified that this was fixed in the updated sqlparser version and is no longer reproducible under the latest version of PgCat.

I used that query to create a test case for the parser. Thank you for reporting

@drdrsh drdrsh closed this as completed Aug 31, 2024
drdrsh added a commit that referenced this issue Aug 31, 2024
I am adding a tiny test that uses the SQL statement that was reported to break an older version of SQL parser library

#776
AndrewJackson2020 pushed a commit to AndrewJackson2020/pgcat that referenced this issue Sep 3, 2024
I am adding a tiny test that uses the SQL statement that was reported to break an older version of SQL parser library

postgresml#776
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants