Loading mysql-test/r/ndb_index_ordered.result +34 −10 Original line number Diff line number Diff line Loading @@ -323,16 +323,16 @@ 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'); 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'); select count(*)-9 from t1 use index (dt) where dt > '1900-01-01 00:00:00'; count(*)-9 0 Loading Loading @@ -420,6 +420,30 @@ count(*)-8 select count(*)-9 from t1 use index (ti) where ti <= '23:59:59'; count(*)-9 0 select count(*)-9 from t1 use index (ts) where ts >= '2001-01-01 00:00:00'; count(*)-9 0 select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 00:00:00'; count(*)-7 0 select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 05:05:05'; count(*)-7 0 select count(*)-5 from t1 use index (ts) where ts > '2001-01-01 06:06:06'; count(*)-5 0 select count(*)-5 from t1 use index (ts) where ts < '2001-01-01 10:11:11'; count(*)-5 0 select count(*)-6 from t1 use index (ts) where ts <= '2001-01-01 10:11:11'; count(*)-6 0 select count(*)-8 from t1 use index (ts) where ts < '2001-01-01 23:59:59'; count(*)-8 0 select count(*)-9 from t1 use index (ts) where ts <= '2001-01-01 23:59:59'; count(*)-9 0 drop table t1; create table t1(a int primary key, b int not null, index(b)); insert into t1 values (1,1), (2,2); Loading mysql-test/t/ndb_index_ordered.test +20 −10 Original line number Diff line number Diff line Loading @@ -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'; Loading Loading @@ -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 Loading ndb/include/kernel/signaldata/DictTabInfo.hpp +13 −1 Original line number Diff line number Diff line Loading @@ -311,7 +311,9 @@ public: ExtDate = NdbSqlUtil::Type::Date, ExtBlob = NdbSqlUtil::Type::Blob, ExtText = NdbSqlUtil::Type::Text, ExtTime = NdbSqlUtil::Type::Time ExtTime = NdbSqlUtil::Type::Time, ExtYear = NdbSqlUtil::Type::Year, ExtTimestamp = NdbSqlUtil::Type::Timestamp }; // Attribute data interpretation Loading Loading @@ -446,6 +448,16 @@ public: AttributeSize = DictTabInfo::an8Bit; AttributeArraySize = 3 * AttributeExtLength; return true; case DictTabInfo::ExtYear: AttributeType = DictTabInfo::StringType; AttributeSize = DictTabInfo::an8Bit; AttributeArraySize = 1 * AttributeExtLength; return true; case DictTabInfo::ExtTimestamp: AttributeType = DictTabInfo::StringType; AttributeSize = DictTabInfo::an8Bit; AttributeArraySize = 4 * AttributeExtLength; return true; }; return false; } Loading ndb/include/ndbapi/NdbDictionary.hpp +3 −1 Original line number Diff line number Diff line Loading @@ -188,7 +188,9 @@ public: Date, ///< Precision down to 1 day(sizeof(Date) == 4 bytes ) Blob, ///< Binary large object (see NdbBlob) Text, ///< Text blob Time = 25 ///< Time without date Time = 25, ///< Time without date Year = 26, ///< Year 1901-2155 (1 byte) Timestamp = 27 ///< Unix time }; /** Loading ndb/include/util/NdbSqlUtil.hpp +5 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,9 @@ public: Date, // Precision down to 1 day (size 4 bytes) Blob, // Blob Text, // Text blob Time = 25 // Time without date Time = 25, // Time without date Year = 26, // Year (size 1 byte) Timestamp = 27 // Unix seconds (uint32) }; Enum m_typeId; Cmp* m_cmp; // comparison method Loading Loading @@ -137,6 +139,8 @@ private: static Cmp cmpBlob; static Cmp cmpText; static Cmp cmpTime; static Cmp cmpYear; static Cmp cmpTimestamp; }; #endif Loading
mysql-test/r/ndb_index_ordered.result +34 −10 Original line number Diff line number Diff line Loading @@ -323,16 +323,16 @@ 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'); 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'); select count(*)-9 from t1 use index (dt) where dt > '1900-01-01 00:00:00'; count(*)-9 0 Loading Loading @@ -420,6 +420,30 @@ count(*)-8 select count(*)-9 from t1 use index (ti) where ti <= '23:59:59'; count(*)-9 0 select count(*)-9 from t1 use index (ts) where ts >= '2001-01-01 00:00:00'; count(*)-9 0 select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 00:00:00'; count(*)-7 0 select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 05:05:05'; count(*)-7 0 select count(*)-5 from t1 use index (ts) where ts > '2001-01-01 06:06:06'; count(*)-5 0 select count(*)-5 from t1 use index (ts) where ts < '2001-01-01 10:11:11'; count(*)-5 0 select count(*)-6 from t1 use index (ts) where ts <= '2001-01-01 10:11:11'; count(*)-6 0 select count(*)-8 from t1 use index (ts) where ts < '2001-01-01 23:59:59'; count(*)-8 0 select count(*)-9 from t1 use index (ts) where ts <= '2001-01-01 23:59:59'; count(*)-9 0 drop table t1; create table t1(a int primary key, b int not null, index(b)); insert into t1 values (1,1), (2,2); Loading
mysql-test/t/ndb_index_ordered.test +20 −10 Original line number Diff line number Diff line Loading @@ -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'; Loading Loading @@ -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 Loading
ndb/include/kernel/signaldata/DictTabInfo.hpp +13 −1 Original line number Diff line number Diff line Loading @@ -311,7 +311,9 @@ public: ExtDate = NdbSqlUtil::Type::Date, ExtBlob = NdbSqlUtil::Type::Blob, ExtText = NdbSqlUtil::Type::Text, ExtTime = NdbSqlUtil::Type::Time ExtTime = NdbSqlUtil::Type::Time, ExtYear = NdbSqlUtil::Type::Year, ExtTimestamp = NdbSqlUtil::Type::Timestamp }; // Attribute data interpretation Loading Loading @@ -446,6 +448,16 @@ public: AttributeSize = DictTabInfo::an8Bit; AttributeArraySize = 3 * AttributeExtLength; return true; case DictTabInfo::ExtYear: AttributeType = DictTabInfo::StringType; AttributeSize = DictTabInfo::an8Bit; AttributeArraySize = 1 * AttributeExtLength; return true; case DictTabInfo::ExtTimestamp: AttributeType = DictTabInfo::StringType; AttributeSize = DictTabInfo::an8Bit; AttributeArraySize = 4 * AttributeExtLength; return true; }; return false; } Loading
ndb/include/ndbapi/NdbDictionary.hpp +3 −1 Original line number Diff line number Diff line Loading @@ -188,7 +188,9 @@ public: Date, ///< Precision down to 1 day(sizeof(Date) == 4 bytes ) Blob, ///< Binary large object (see NdbBlob) Text, ///< Text blob Time = 25 ///< Time without date Time = 25, ///< Time without date Year = 26, ///< Year 1901-2155 (1 byte) Timestamp = 27 ///< Unix time }; /** Loading
ndb/include/util/NdbSqlUtil.hpp +5 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,9 @@ public: Date, // Precision down to 1 day (size 4 bytes) Blob, // Blob Text, // Text blob Time = 25 // Time without date Time = 25, // Time without date Year = 26, // Year (size 1 byte) Timestamp = 27 // Unix seconds (uint32) }; Enum m_typeId; Cmp* m_cmp; // comparison method Loading Loading @@ -137,6 +139,8 @@ private: static Cmp cmpBlob; static Cmp cmpText; static Cmp cmpTime; static Cmp cmpYear; static Cmp cmpTimestamp; }; #endif