-
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: Incorrect results when deleting rows from table with index column being dropped #33361
Labels
A-sql-mutations
Mutation statements: UPDATE/INSERT/UPSERT/DELETE.
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
S-3-erroneous-edge-case
Database produces or stores erroneous data without visible error/warning, in rare edge cases.
Comments
andy-kimball
added
the
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
label
Dec 26, 2018
CC: @vivekmenezes, since this is a schema change related issue. |
knz
added
A-sql-mutations
Mutation statements: UPDATE/INSERT/UPSERT/DELETE.
S-3-erroneous-edge-case
Database produces or stores erroneous data without visible error/warning, in rare edge cases.
labels
Dec 27, 2018
vivekmenezes
added a commit
to vivekmenezes/cockroach
that referenced
this issue
Jan 2, 2019
this change is a followup to fix cockroachdb#32188 unique columns have an index on them. When such a column is dropped, a DELETE statement will read a dropped column to correctly drop the index on it, but this dropped column is exposed through the RETURNING clause. This change stops exposing the column via RETURNING. fixes cockroachdb#33361 Release note (sql change): fixed problem with returning dropped unique columns in DELETE RETURNING statement.
craig bot
pushed a commit
that referenced
this issue
Jan 3, 2019
33438: sql: stop returning dropped unique columns in DELETE RETURNING r=vivekmenezes a=vivekmenezes this change is a followup to fix #32188 unique columns have an index on them. When such a column is dropped, a DELETE statement will read a dropped column to correctly drop the index on it, but this dropped column is exposed through the RETURNING clause. This change stops exposing the column via RETURNING. fixes #33361 Release note (sql change): fixed problem with returning dropped unique columns in DELETE RETURNING statement. Co-authored-by: Vivek Menezes <vivek@cockroachlabs.com>
vivekmenezes
added a commit
to vivekmenezes/cockroach
that referenced
this issue
Jan 7, 2019
this change is a followup to fix cockroachdb#32188 unique columns have an index on them. When such a column is dropped, a DELETE statement will read a dropped column to correctly drop the index on it, but this dropped column is exposed through the RETURNING clause. This change stops exposing the column via RETURNING. fixes cockroachdb#33361 Release note (sql change): fixed problem with returning dropped unique columns in DELETE RETURNING statement.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-sql-mutations
Mutation statements: UPDATE/INSERT/UPSERT/DELETE.
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
S-3-erroneous-edge-case
Database produces or stores erroneous data without visible error/warning, in rare edge cases.
The bug occurs when a column being dropped is part of an index. In that case, it is incorrectly projected by the RETURNING clause.
EXPECTED: Since column
y
was dropped, it should not be part of the results.ACTUAL: Column
y
is projected in the result because it is part of an index. If there is no index, then the correct results are returned.The text was updated successfully, but these errors were encountered: