-
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: DELETE FROM is broken for system.jobs table #40890
Comments
Thanks @spaskob - this appears to be an issue with the creation of constraint spans in some cases. Check out the explain:
In the But, in the |
I've tracked the bug down to a method called Before that method, the optimizer constraints are as expected:
After that method, the physical spans produced:
|
I think it has to do with tables with column families. As such, I thought it was introduced by #30744, but that PR is present in 19.1 and this problem doesn't repro in 19.1. Here's a tight repro on master without system tables:
|
should we consider this a release blocker for 19.2? |
Definitely. |
Okay, looks like this was introduced by #38301. |
Describe the problem
DELETE FROM system.jobs WHERE id IN (x_1, x_2, ..., x_n)
only deletes 1 row even if all thex_i
are in the table. Always only the last element (x_n
) is deleted.Interestingly, the faulty behavior only holds for
system.jobs
. I was not able to reproduce it for user defined tables or for other system tables (tested withsystem.zones
).To Reproduce*
cockroach demo
IN
listExpected behavior
Delete should delete all matching rows as it does for other tables.
Additional data / screenshots
None
Environment:
Additional context
This leaves lots of finished jobs rows in the
system.jobs
table.See #40563
The text was updated successfully, but these errors were encountered: