mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
ndb - make YEAR and TIMESTAMP into ndb types
This commit is contained in:
@ -189,16 +189,16 @@ create table t1 (
|
||||
index(ts)
|
||||
) engine=ndb;
|
||||
|
||||
insert into t1 (pk,dt,da,ye,ti) values
|
||||
(1, '1901-05-05 23:00:59', '1901-05-05', '1901', '23:00:59'),
|
||||
(2, '1912-09-05 13:00:59', '1912-09-05', '1912', '13:00:59'),
|
||||
(3, '1945-12-31 00:00:00', '1945-12-31', '1945', '00:00:00'),
|
||||
(4, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00'),
|
||||
(5, '1963-06-06 06:06:06', '1963-06-06', '1963', '06:06:06'),
|
||||
(6, '1993-06-06 06:06:06', '1993-06-06', '1993', '06:06:06'),
|
||||
(7, '2001-01-01 10:11:10', '2001-01-01', '2001', '10:11:10'),
|
||||
(8, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11'),
|
||||
(9, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59');
|
||||
insert into t1 (pk,dt,da,ye,ti,ts) values
|
||||
(1, '1901-05-05 23:00:59', '1901-05-05', '1901', '23:00:59', '2001-01-01 23:00:59'),
|
||||
(2, '1912-09-05 13:00:59', '1912-09-05', '1912', '13:00:59', '2001-01-01 13:00:59'),
|
||||
(3, '1945-12-31 00:00:00', '1945-12-31', '1945', '00:00:00', '2001-01-01 00:00:00'),
|
||||
(4, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00', '2001-01-01 00:00:00'),
|
||||
(5, '1963-06-06 06:06:06', '1963-06-06', '1963', '06:06:06', '2001-01-01 06:06:06'),
|
||||
(6, '1993-06-06 06:06:06', '1993-06-06', '1993', '06:06:06', '2001-01-01 06:06:06'),
|
||||
(7, '2001-01-01 10:11:10', '2001-01-01', '2001', '10:11:10', '2001-01-01 10:11:10'),
|
||||
(8, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11', '2001-01-01 10:11:11'),
|
||||
(9, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59', '2001-01-01 23:59:59');
|
||||
|
||||
# datetime
|
||||
select count(*)-9 from t1 use index (dt) where dt > '1900-01-01 00:00:00';
|
||||
@ -237,6 +237,16 @@ select count(*)-6 from t1 use index (ti) where ti <= '10:11:11';
|
||||
select count(*)-8 from t1 use index (ti) where ti < '23:59:59';
|
||||
select count(*)-9 from t1 use index (ti) where ti <= '23:59:59';
|
||||
|
||||
# timestamp
|
||||
select count(*)-9 from t1 use index (ts) where ts >= '2001-01-01 00:00:00';
|
||||
select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 00:00:00';
|
||||
select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 05:05:05';
|
||||
select count(*)-5 from t1 use index (ts) where ts > '2001-01-01 06:06:06';
|
||||
select count(*)-5 from t1 use index (ts) where ts < '2001-01-01 10:11:11';
|
||||
select count(*)-6 from t1 use index (ts) where ts <= '2001-01-01 10:11:11';
|
||||
select count(*)-8 from t1 use index (ts) where ts < '2001-01-01 23:59:59';
|
||||
select count(*)-9 from t1 use index (ts) where ts <= '2001-01-01 23:59:59';
|
||||
|
||||
drop table t1;
|
||||
|
||||
# bug#7798
|
||||
|
Reference in New Issue
Block a user