diff options
author | pekka@mysql.com <> | 2005-01-08 22:34:16 +0100 |
---|---|---|
committer | pekka@mysql.com <> | 2005-01-08 22:34:16 +0100 |
commit | 195f7bda021a3245dc11102aad97cc3e568e25e3 (patch) | |
tree | cb43fe2faff44cd0b0f5a29ce87fce61522e5294 /mysql-test/t/ndb_index_ordered.test | |
parent | 8d6f8446413798d96de57587d1cfcc2518b69b65 (diff) | |
parent | e98e64cea815b2697b9ad2562779817e195f7cbb (diff) | |
download | mariadb-git-195f7bda021a3245dc11102aad97cc3e568e25e3.tar.gz |
Merge
Diffstat (limited to 'mysql-test/t/ndb_index_ordered.test')
-rw-r--r-- | mysql-test/t/ndb_index_ordered.test | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/t/ndb_index_ordered.test index 42325e25ea3..b7a5b418f44 100644 --- a/mysql-test/t/ndb_index_ordered.test +++ b/mysql-test/t/ndb_index_ordered.test @@ -203,3 +203,67 @@ SELECT s.SubscrID,l.SbclID FROM test1 s left JOIN test2 l ON l.SbcrID=s.SubscrID WHERE s.UsrID=224 order by 1, 2; drop table test1; drop table test2; + +# bug#7424 + bug#7725 + +create table t1 ( + pk int primary key, + dt datetime not null, + da date not null, + ye year not null, + ti time not null, + ts timestamp not null, + index(dt), + index(da), + index(ye), + index(ti), + 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'); + +# datetime +select count(*)-9 from t1 use index (dt) where dt > '1900-01-01 00:00:00'; +select count(*)-6 from t1 use index (dt) where dt >= '1955-12-31 00:00:00'; +select count(*)-5 from t1 use index (dt) where dt > '1955-12-31 00:00:00'; +select count(*)-5 from t1 use index (dt) where dt < '1970-03-03 22:22:22'; +select count(*)-7 from t1 use index (dt) where dt < '2001-01-01 10:11:11'; +select count(*)-8 from t1 use index (dt) where dt <= '2001-01-01 10:11:11'; +select count(*)-9 from t1 use index (dt) where dt <= '2055-01-01 00:00:00'; + +# date +select count(*)-9 from t1 use index (da) where da > '1900-01-01'; +select count(*)-6 from t1 use index (da) where da >= '1955-12-31'; +select count(*)-5 from t1 use index (da) where da > '1955-12-31'; +select count(*)-5 from t1 use index (da) where da < '1970-03-03'; +select count(*)-6 from t1 use index (da) where da < '2001-01-01'; +select count(*)-8 from t1 use index (da) where da <= '2001-01-02'; +select count(*)-9 from t1 use index (da) where da <= '2055-01-01'; + +# year +select count(*)-9 from t1 use index (ye) where ye > '1900'; +select count(*)-6 from t1 use index (ye) where ye >= '1955'; +select count(*)-5 from t1 use index (ye) where ye > '1955'; +select count(*)-5 from t1 use index (ye) where ye < '1970'; +select count(*)-6 from t1 use index (ye) where ye < '2001'; +select count(*)-8 from t1 use index (ye) where ye <= '2001'; +select count(*)-9 from t1 use index (ye) where ye <= '2055'; + +# time +select count(*)-9 from t1 use index (ti) where ti >= '00:00:00'; +select count(*)-7 from t1 use index (ti) where ti > '00:00:00'; +select count(*)-7 from t1 use index (ti) where ti > '05:05:05'; +select count(*)-5 from t1 use index (ti) where ti > '06:06:06'; +select count(*)-5 from t1 use index (ti) where ti < '10:11:11'; +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'; |