forked from pingcap/tidb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
expression: fix wrong result when convert float to unsigned (pingcap#…
…53590) (pingcap#53612) close pingcap#41736
- Loading branch information
1 parent
c2f973a
commit cd1e029
Showing
4 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
drop table if exists t0; | ||
create table t0(c0 tinyint(1) unsigned not null ); | ||
insert into t0 values (1); | ||
select * from t0 where case 0 when t0.c0 > -1.194192591e9 then null else 1 end; | ||
c0 | ||
1 | ||
select t0.c0 > -1.194192591e9 from t0; | ||
t0.c0 > -1.194192591e9 | ||
1 | ||
select t0.c0 < -1.194192591e9 from t0; | ||
t0.c0 < -1.194192591e9 | ||
0 | ||
select -1.194192591e9 > t0.c0 from t0; | ||
-1.194192591e9 > t0.c0 | ||
0 | ||
select -1.194192591e9 < t0.c0 from t0; | ||
-1.194192591e9 < t0.c0 | ||
1 | ||
select t0.c0 > 1.194192591e9 from t0; | ||
t0.c0 > 1.194192591e9 | ||
0 | ||
select t0.c0 < 1.194192591e9 from t0; | ||
t0.c0 < 1.194192591e9 | ||
1 | ||
select 1.194192591e9 > t0.c0 from t0; | ||
1.194192591e9 > t0.c0 | ||
1 | ||
select 1.194192591e9 < t0.c0 from t0; | ||
1.194192591e9 < t0.c0 | ||
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# TestNegFloatConvertToUnsigned | ||
drop table if exists t0; | ||
create table t0(c0 tinyint(1) unsigned not null ); | ||
insert into t0 values (1); | ||
select * from t0 where case 0 when t0.c0 > -1.194192591e9 then null else 1 end; | ||
select t0.c0 > -1.194192591e9 from t0; | ||
select t0.c0 < -1.194192591e9 from t0; | ||
select -1.194192591e9 > t0.c0 from t0; | ||
select -1.194192591e9 < t0.c0 from t0; | ||
select t0.c0 > 1.194192591e9 from t0; | ||
select t0.c0 < 1.194192591e9 from t0; | ||
select 1.194192591e9 > t0.c0 from t0; | ||
select 1.194192591e9 < t0.c0 from t0; |