Commit 3186b340 authored by unknown's avatar unknown
Browse files

ndb - wl-1442 fix Time ordering


mysql-test/r/ndb_index_ordered.result:
  wl-1442 fix Time.  adds new type id 25
mysql-test/t/ndb_index_ordered.test:
  wl-1442 fix Time.  adds new type id 25
ndb/include/kernel/signaldata/DictTabInfo.hpp:
  wl-1442 fix Time.  adds new type id 25
ndb/include/ndbapi/NdbDictionary.hpp:
  wl-1442 fix Time.  adds new type id 25
ndb/include/util/NdbSqlUtil.hpp:
  wl-1442 fix Time.  adds new type id 25
ndb/src/common/util/NdbSqlUtil.cpp:
  wl-1442 fix Time.  adds new type id 25
ndb/src/ndbapi/NdbDictionary.cpp:
  wl-1442 fix Time.  adds new type id 25
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  wl-1442 fix Time.  adds new type id 25
ndb/test/include/NdbSchemaOp.hpp:
  wl-1442 fix Time.  adds new type id 25
ndb/tools/restore/consumer.cpp:
  wl-1442 fix Time.  adds new type id 25
sql/ha_ndbcluster.cc:
  wl-1442 fix Time.  adds new type id 25
parent 633ee9b0
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
@@ -375,3 +375,48 @@ count(*)-8
select count(*)-9 from t1 use index (da) where da <= '2055-01-01';
count(*)-9
0
select count(*)-9 from t1 use index (ye) where ye >  '1900';
count(*)-9
0
select count(*)-6 from t1 use index (ye) where ye >= '1955';
count(*)-6
0
select count(*)-5 from t1 use index (ye) where ye >  '1955';
count(*)-5
0
select count(*)-5 from t1 use index (ye) where ye <  '1970';
count(*)-5
0
select count(*)-6 from t1 use index (ye) where ye <  '2001';
count(*)-6
0
select count(*)-8 from t1 use index (ye) where ye <= '2001';
count(*)-8
0
select count(*)-9 from t1 use index (ye) where ye <= '2055';
count(*)-9
0
select count(*)-9 from t1 use index (ti) where ti >= '00:00:00';
count(*)-9
0
select count(*)-7 from t1 use index (ti) where ti >  '00:00:00';
count(*)-7
0
select count(*)-7 from t1 use index (ti) where ti >  '05:05:05';
count(*)-7
0
select count(*)-5 from t1 use index (ti) where ti >  '06:06:06';
count(*)-5
0
select count(*)-5 from t1 use index (ti) where ti <  '10:11:11';
count(*)-5
0
select count(*)-6 from t1 use index (ti) where ti <= '10:11:11';
count(*)-6
0
select count(*)-8 from t1 use index (ti) where ti <  '23:59:59';
count(*)-8
0
select count(*)-9 from t1 use index (ti) where ti <= '23:59:59';
count(*)-9
0
+19 −0
Original line number Diff line number Diff line
@@ -217,3 +217,22 @@ 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';
+7 −1
Original line number Diff line number Diff line
@@ -310,7 +310,8 @@ public:
    ExtDatetime = NdbSqlUtil::Type::Datetime,
    ExtDate = NdbSqlUtil::Type::Date,
    ExtBlob = NdbSqlUtil::Type::Blob,
    ExtText = NdbSqlUtil::Type::Text
    ExtText = NdbSqlUtil::Type::Text,
    ExtTime = NdbSqlUtil::Type::Time
  };

  // Attribute data interpretation
@@ -440,6 +441,11 @@ public:
        // head + inline part [ attr precision lower half ]
        AttributeArraySize = (NDB_BLOB_HEAD_SIZE << 2) + (AttributeExtPrecision & 0xFFFF);
        return true;
      case DictTabInfo::ExtTime:
        AttributeType = DictTabInfo::StringType;
        AttributeSize = DictTabInfo::an8Bit;
        AttributeArraySize = 3 * AttributeExtLength;
        return true;
      };
      return false;
    }
+2 −1
Original line number Diff line number Diff line
@@ -187,7 +187,8 @@ public:
      Datetime,    ///< Precision down to 1 sec (sizeof(Datetime) == 8 bytes )
      Date,        ///< Precision down to 1 day(sizeof(Date) == 4 bytes )
      Blob,        ///< Binary large object (see NdbBlob)
      Text         ///< Text blob
      Text,        ///< Text blob
      Time = 25    ///< Time without date
    };

    /** 
+3 −1
Original line number Diff line number Diff line
@@ -83,7 +83,8 @@ public:
      Datetime,         // Precision down to 1 sec  (size 8 bytes)
      Date,             // Precision down to 1 day (size 4 bytes)
      Blob,             // Blob
      Text              // Text blob
      Text,             // Text blob
      Time = 25         // Time without date
    };
    Enum m_typeId;
    Cmp* m_cmp;         // comparison method
@@ -135,6 +136,7 @@ private:
  static Cmp cmpDate;
  static Cmp cmpBlob;
  static Cmp cmpText;
  static Cmp cmpTime;
};

#endif
Loading