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

QA: plainto_tsquery can't parse !!, &&, ||, <->, etc. #99588

Open
msirek opened this issue Mar 26, 2023 · 0 comments
Open

QA: plainto_tsquery can't parse !!, &&, ||, <->, etc. #99588

msirek opened this issue Mar 26, 2023 · 0 comments
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-qa T-sql-queries SQL Queries Team
Projects

Comments

@msirek
Copy link
Contributor

msirek commented Mar 26, 2023

Postgres ignores non-alphanumeric symbols in the argument to plainto_tsquery, but CRDB does not,
e.g.

postgres=# select plainto_tsquery('fat !! bat');
 plainto_tsquery 
-----------------
 'fat' & 'bat'
(1 row)

postgres=# select plainto_tsquery('fat &&& bat');
 plainto_tsquery 
-----------------
 'fat' & 'bat'
(1 row)

postgres=# select plainto_tsquery('fat ) bat');
 plainto_tsquery 
-----------------
 'fat' & 'bat'
(1 row)

postgres=# select plainto_tsquery('fat && bat');
 plainto_tsquery 
-----------------
 'fat' & 'bat'
(1 row)

postgres=# select plainto_tsquery('fat || bat');
 plainto_tsquery 
-----------------
 'fat' & 'bat'
(1 row)

postgres=# select plainto_tsquery('fat <-> bat');
 plainto_tsquery 
-----------------
 'fat' & 'bat'
(1 row)

All of these examples return a syntax error on CRDB, e.g.

root@localhost:26257/defaultdb> select plainto_tsquery('fat <-> bat');                                                                                                                            
ERROR: plainto_tsquery(): syntax error in TSQuery: fat <-> bat
SQLSTATE: 42601

Jira issue: CRDB-25956

@msirek msirek added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-qa labels Mar 26, 2023
@msirek msirek added this to Triage in SQL Queries via automation Mar 26, 2023
@blathers-crl blathers-crl bot added the T-sql-queries SQL Queries Team label Mar 26, 2023
@msirek msirek moved this from Triage to Bugs to Fix in SQL Queries Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-qa T-sql-queries SQL Queries Team
Projects
Status: Bugs to Fix
SQL Queries
Bugs to Fix
Development

No branches or pull requests

1 participant