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

fix: deletion of null values #6277

Merged
merged 3 commits into from
Jun 29, 2022

Conversation

dantengsky
Copy link
Member

@dantengsky dantengsky commented Jun 28, 2022

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

fixing issue

by inverse the filter result, instead of the filter expression.

mysql> create table t(c int null);
Query OK, 0 rows affected (0.06 sec)

mysql> insert into t values(1), (2), (NULL);
Query OK, 0 rows affected (0.06 sec)

mysql> delete from t where c=1;
Query OK, 0 rows affected (0.06 sec)

mysql> select * from t;
+------+
| c    |
+------+
|    2 |
| NULL |
+------+
2 rows in set (0.03 sec)
Read 2 rows, 8.00 B in 0.006 sec., 346.05 rows/sec., 1.35 KiB/sec.

mysql> delete from t where c is null;
Query OK, 0 rows affected (0.05 sec)

mysql> select * from t;
+------+
| c    |
+------+
|    2 |
+------+
1 row in set (0.06 sec)
Read 1 rows, 4.00 B in 0.005 sec., 197.37 rows/sec., 789.48 B/sec.

mysql> delete from t where 1=1;
Query OK, 0 rows affected (0.05 sec)

mysql> select * from t;
Query OK, 0 rows affected (0.03 sec)

Changelog

  • Bug Fix
  • Not for changelog (changelog entry is not required)

Related Issues

Fixes #6275

@vercel
Copy link

vercel bot commented Jun 28, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
databend ⬜️ Ignored (Inspect) Jun 28, 2022 at 3:17PM (UTC)

@mergify
Copy link
Contributor

mergify bot commented Jun 28, 2022

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@mergify mergify bot added pr-bugfix this PR patches a bug in codebase pr-not-for-changelog labels Jun 28, 2022
@dantengsky dantengsky marked this pull request as ready for review June 29, 2022 02:10
@BohuTANG BohuTANG merged commit 22d9e94 into databendlabs:main Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-review pr-bugfix this PR patches a bug in codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: incorrect deletion of null valued rows
3 participants