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

error updating table with impossible where clause #5397

Closed
zachmu opened this issue Feb 21, 2023 · 1 comment
Closed

error updating table with impossible where clause #5397

zachmu opened this issue Feb 21, 2023 · 1 comment
Assignees
Labels
bad error message bug Something isn't working good repro Easily reproducible bugs sql Issue with SQL

Comments

@zachmu
Copy link
Member

zachmu commented Feb 21, 2023

When an update statement has a where clause that is always false, the update statement returns an error "table doesn't support UPDATE"

tablescan_order> desc t1;
+-------+--------+------+-----+---------+-------+
| Field | Type   | Null | Key | Default | Extra |
+-------+--------+------+-----+---------+-------+
| a     | bigint | NO   | PRI | NULL    |       |
| b     | int    | YES  |     | NULL    |       |
+-------+--------+------+-----+---------+-------+
2 rows in set (0.01 sec)

tablescan_order> update t1 set b = b+1 where (a = 100 and 0);
table doesn't support UPDATE
tablescan_order> update t1 set b = b+1 where (a = 100);
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0
tablescan_order> update t1 set b = b+1 where (0);
table doesn't support _UPDATE_

Expected behavior: updates zero rows with no error

@timsehn timsehn added bug Something isn't working sql Issue with SQL labels Feb 21, 2023
@fulghum fulghum added the good repro Easily reproducible bugs label Feb 24, 2023
@jycor jycor self-assigned this Jul 19, 2023
@jycor
Copy link
Contributor

jycor commented Jul 22, 2023

Fix is merged into main

@jycor jycor closed this as completed Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bad error message bug Something isn't working good repro Easily reproducible bugs sql Issue with SQL
Projects
None yet
Development

No branches or pull requests

4 participants