cockroachdb / cockroachdb/cockroach
QA: plainto_tsquery can't parse !!, &&, ||, <->, etc.
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
Postgres ignores non-alphanumeric symbols in the argument to `plainto_tsquery`, but CRDB does not,
e.g.
```sql
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.
```sql
root@localhost:26257/defaultdb> select plainto_tsquery('fat <-> bat');
ERROR: plainto_tsquery(): syntax error in TSQuery: fat <-> bat
SQLSTATE: 42601
```
Jira issue: CRDB-25956
Contributor guide
Assessment
This issue has not been assessed yet.