mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
A fix for bug when comparing a datetime column with timestamp
values with BETWEEN clause
This commit is contained in:
@ -46,6 +46,20 @@ select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1;
|
||||
select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL;
|
||||
1 XOR 1 1 XOR 0 0 XOR 1 0 XOR 0 NULL XOR 1 1 XOR NULL 0 XOR NULL
|
||||
0 1 1 0 NULL NULL NULL
|
||||
drop table if exists t1,t2;
|
||||
CREATE TABLE t1 ( start datetime default NULL) TYPE=MyISAM;
|
||||
INSERT INTO t1 VALUES ('2002-10-21 00:00:00');
|
||||
INSERT INTO t1 VALUES ('2002-10-28 00:00:00');
|
||||
INSERT INTO t1 VALUES ('2002-11-04 00:00:00');
|
||||
CREATE TABLE t2 ( ctime1 timestamp(14) NOT NULL, ctime2 timestamp(14) NOT NULL) TYPE=MyISAM;
|
||||
INSERT INTO t2 VALUES (20021029165106,20021105164731);
|
||||
select * from t1, t2 where t1.start between t2.ctime1 and t2.ctime2;
|
||||
start ctime1 ctime2
|
||||
2002-11-04 00:00:00 20021029165106 20021105164731
|
||||
select * from t1, t2 where t1.start >= t2.ctime1 and t1.start <= t2.ctime2;
|
||||
start ctime1 ctime2
|
||||
2002-11-04 00:00:00 20021029165106 20021105164731
|
||||
drop table if exists t1,t2;
|
||||
select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1;
|
||||
5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1
|
||||
0 1
|
||||
|
Reference in New Issue
Block a user