-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: vectorized escapes LIKE '%\\%'
incorrectly
#68040
Labels
A-sql-vec
SQL vectorized engine
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-sql-queries
SQL Queries Team
Comments
otan
added
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
A-sql-vec
SQL vectorized engine
labels
Jul 25, 2021
cc @yuzefovich |
otan
changed the title
sql: vectorized escapes LIKED
sql: vectorized escapes Jul 26, 2021
%\\%
incorrectlyLIKE '%\\%'
incorrectly
timgraham
added a commit
to timgraham/django-cockroachdb
that referenced
this issue
Jul 28, 2021
craig bot
pushed a commit
that referenced
this issue
Aug 2, 2021
68289: colexec: fix LIKE operators when patterns have escape characters r=yuzefovich a=yuzefovich **colexec: fix LIKE operators when patterns have escape characters** Fixes: #68040. Release note (bug fix): Previously, CockroachDB could incorrectly evaluate LIKE expressions when the pattern contained the escape characters `\` if the expressions were executed via the vectorized engine. **colbuilder: force planning of optimized projection operators** Whenever we're planning a projection expression, we have 3 cases: the left is constant, the right is constants, and neither are constants. For the second case we have some optimized operators. Previously, those operators weren't exercised via the TestEval/vectorized because in the eval tests the left side is constant. This commit switches the planning to force planning of those optimized operators. This shouldn't really have an effect on planning of actual queries. This was prompted by the bug in LIKE operators that is fixed in the previous commit. Had we forced the planning for our eval tests, we would have caught it earlier. This also revealed an incompatibility for our IN operator implementation when the right side is an empty tuple which this commit also fixes. However, I don't think this scenario can be hit in production because the optimizer folds such an expression into correct `false`. Thus, there is no release note. Release note: None Co-authored-by: Yahor Yuzefovich <[email protected]>
This was referenced Aug 3, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-sql-vec
SQL vectorized engine
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-sql-queries
SQL Queries Team
Describe the problem
LIKE '%\\%'
To Reproduce
This is a problem since v21.1, guessing since vectorize was on by default.
Setup:
Now observe the difference in results when vectorized is off vs on:
The vectorize=off result is the expected result.
Found by #67974
The text was updated successfully, but these errors were encountered: