diff options
author | unknown <pekka@mysql.com> | 2005-01-08 13:59:57 +0100 |
---|---|---|
committer | unknown <pekka@mysql.com> | 2005-01-08 13:59:57 +0100 |
commit | ce6de604c899167d930d01f8500bbd81d1f0e24b (patch) | |
tree | 36c9f02781a409cfcc3004dbf1ca3eefe25ad0a7 /mysql-test | |
parent | 0c57a67ce0434fa78e2b64f569a271d166371a32 (diff) | |
download | mariadb-git-ce6de604c899167d930d01f8500bbd81d1f0e24b.tar.gz |
ndb - wl-1442 bug#7725 datetime ordering
mysql-test/t/ndb_index_ordered.test:
wl-1442 datetime ordering
ndb/src/common/util/NdbSqlUtil.cpp:
wl-1442 datetime ordering
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/t/ndb_index_ordered.test | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/t/ndb_index_ordered.test index 53177511bc6..c5d3a83a3ab 100644 --- a/mysql-test/t/ndb_index_ordered.test +++ b/mysql-test/t/ndb_index_ordered.test @@ -172,3 +172,32 @@ 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, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00'), + (3, '1999-06-06 06:06:06', '1999-06-06', '1999', '06:06:06'), + (4, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11'), + (5, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59'); + +# datetime +select count(*) from t1 use index (dt) where dt > '1900-01-01 00:00:00'; +select count(*) from t1 use index (dt) where dt > '1955-12-31 00:00:00'; +select count(*) from t1 use index (dt) where dt < '2001-01-01 10:11:11'; +select count(*) from t1 use index (dt) where dt < '2001-01-01 10:11:12'; |