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

bug: where clause error #7457

Closed
1 of 2 tasks
hanyisong opened this issue Sep 3, 2022 · 2 comments · Fixed by #7497
Closed
1 of 2 tasks

bug: where clause error #7457

hanyisong opened this issue Sep 3, 2022 · 2 comments · Fixed by #7497
Assignees
Labels
C-bug Category: something isn't working sqlancer

Comments

@hanyisong
Copy link
Contributor

Search before asking

  • I had searched in the issues and found no similar issues.

Version

8.0.26-v0.8.12-nightly-74d0287-simd(rust-1.64.0-nightly-2022-08-27T03:09:50.519081067Z)

What's Wrong?

https://databend.rs/doc/reference/data-types/data-type-logical-types#implicit-conversion

negative numbers are not converted to true

How to Reproduce?

select * from t0 where (-123);

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@hanyisong hanyisong added the C-bug Category: something isn't working label Sep 3, 2022
@sundy-li sundy-li self-assigned this Sep 3, 2022
@BohuTANG
Copy link
Member

BohuTANG commented Sep 3, 2022

@hanyisong

Thanks for the reporting. It's interesting, could you tell us how you found this bug?

@hanyisong
Copy link
Contributor Author

hanyisong commented Sep 3, 2022

@hanyisong

Thanks for the reporting. It's interesting, could you tell us how you found this bug?

@BohuTANG TLP where tester

MySQL [databend0]> select * from t0;
+-------------+---------------------+
| c0int       | c1float             |
+-------------+---------------------+
|   -28037702 | 0.13393984735012054 |
|        NULL |  0.2758837938308716 |
|   191085745 |   0.410796195268631 |
|  1607963264 |   0.410796195268631 |
|        NULL |  0.0973014384508133 |
|  2050261229 |         191085744.0 |
|  1479877258 |        2050261248.0 |
|        NULL |  0.9692699313163757 |
|        NULL | 0.07162362337112427 |
|   -28037702 |  0.7503516674041748 |
| -1357461657 |   0.529532790184021 |
| -1357461657 |  0.8742622137069702 |
|   315210081 |  0.8744754195213318 |
|   315210081 |   0.410796195268631 |
|  -230082541 |   0.410796195268631 |
| -1357461657 |         315210080.0 |
|        NULL |   0.410796195268631 |
|        NULL | 0.13393984735012054 |
|        NULL |   0.410796195268631 |
|   191085745 |   0.410796195268631 |
|   -28037702 |  0.0520845390856266 |
|   191085745 |  0.8742622137069702 |
+-------------+---------------------+
22 rows in set (0.009 sec)

MySQL [databend0]> select c0int from t0 where c0int;
+------------+
| c0int      |
+------------+
|  315210081 |
|  191085745 |
|  315210081 |
| 2050261229 |
| 1479877258 |
| 1607963264 |
|  191085745 |
|  191085745 |
+------------+
8 rows in set (0.007 sec)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: something isn't working sqlancer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants