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

'>= NULL' should not return the data #22817

Closed
aytrack opened this issue Feb 19, 2021 · 3 comments · Fixed by #22821
Closed

'>= NULL' should not return the data #22817

aytrack opened this issue Feb 19, 2021 · 3 comments · Fixed by #22821
Assignees
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@aytrack
Copy link
Contributor

aytrack commented Feb 19, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t3(a year);
insert into t3 values (1991), ("1992"), ("93"), (94);
select * from t3 where a >= NULL;

2. What did you expect to see? (Required)

the result is empty.

mysql test> select * from t3 where a >= NULL;
+---+
| a |
+---+

3. What did you see instead (Required)

mysql test> create table t3(a year);
Query OK, 0 rows affected
Time: 0.255s
mysql test> insert into t3 values (1991), ("1992"), ("93"), (94);
Query OK, 4 rows affected
Time: 0.065s
mysql test> select * from t3 where a >= NULL;
+------+
| a    |
+------+
| 1991 |
| 1992 |
| 1993 |
| 1994 |
+------+
4 rows in set
Time: 0.056s
mysql root@172.16.4.131:test> desc select * from t3 where a >= NULL;
+---------------------+----------+-----------+---------------+--------------------------------+
| id                  | estRows  | task      | access object | operator info                  |
+---------------------+----------+-----------+---------------+--------------------------------+
| TableReader_7       | 3333.33  | root      |               | data:Selection_6               |
| └─Selection_6       | 3333.33  | cop[tikv] |               | ge(test.t3.a, 0)               |
|   └─TableFullScan_5 | 10000.00 | cop[tikv] | table:t3      | keep order:false, stats:pseudo |
+---------------------+----------+-----------+---------------+--------------------------------+

3 rows in set
Time: 0.064s

4. What is your TiDB version? (Required)

mysql root@172.16.4.131:test> select tidb_version()\G
***************************[ 1. row ]***************************
tidb_version() | Release Version: v4.0.0-beta.2-2135-gd6a2b9a37-dirty
Edition: Community
Git Commit Hash: d6a2b9a372edd3638c0ed88e1d2a5e6b702a69ed
Git Branch: master
UTC Build Time: 2021-02-11 02:48:59
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
@aytrack aytrack added the type/bug The issue is confirmed as a bug. label Feb 19, 2021
@lzmhhh123 lzmhhh123 self-assigned this Feb 19, 2021
@lzmhhh123
Copy link
Contributor

Caused by #21099

@ti-srebot
Copy link
Contributor

ti-srebot commented Feb 20, 2021

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

[v4.0.9:v4.0.11],[v5.0.0-rc]

6. Fixed versions

master

@seiya-annie
Copy link

[["21099"," expression: adjust int constant when compare with year type (#21099)\n"," v5.0.0-rc",null],
["21283"," expression: adjust int constant when compare with year type (#21099) (#21283)\n"," v4.0.9",null]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants