Commit 763dfd7b authored by unknown's avatar unknown
Browse files

Merge


mysql-test/r/ndb_index_ordered.result:
  Auto merged
mysql-test/t/ndb_index_ordered.test:
  Auto merged
ndb/src/ndbapi/NdbDictionary.cpp:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
ndb/include/kernel/signaldata/DictTabInfo.hpp:
  merge
ndb/include/ndbapi/NdbDictionary.hpp:
  merge
ndb/include/util/NdbSqlUtil.hpp:
  merge
ndb/src/common/util/NdbSqlUtil.cpp:
  merge
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  merge
ndb/src/ndbapi/NdbRecAttr.cpp:
  merge
parents 1c49d548 96528854
Loading
Loading
Loading
Loading
+34 −10
Original line number Diff line number Diff line
@@ -432,16 +432,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
@@ -529,6 +529,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);
+20 −10
Original line number Diff line number Diff line
@@ -220,16 +220,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';
@@ -268,6 +268,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
+11 −1
Original line number Diff line number Diff line
@@ -276,7 +276,9 @@ public:
    ExtBit = NdbSqlUtil::Type::Bit,
    ExtLongvarchar = NdbSqlUtil::Type::Longvarchar,
    ExtLongvarbinary = NdbSqlUtil::Type::Longvarbinary,
    ExtTime = NdbSqlUtil::Type::Time
    ExtTime = NdbSqlUtil::Type::Time,
    ExtYear = NdbSqlUtil::Type::Year,
    ExtTimestamp = NdbSqlUtil::Type::Timestamp
  };

  // Attribute data interpretation
@@ -389,6 +391,14 @@ public:
        AttributeSize = DictTabInfo::an8Bit;
        AttributeArraySize = 3 * AttributeExtLength;
        break;
      case DictTabInfo::ExtYear:
        AttributeSize = DictTabInfo::an8Bit;
        AttributeArraySize = 1 * AttributeExtLength;
        break;
      case DictTabInfo::ExtTimestamp:
        AttributeSize = DictTabInfo::an8Bit;
        AttributeArraySize = 4 * AttributeExtLength;
        break;
      default:
        return false;
      };
+3 −1
Original line number Diff line number Diff line
@@ -196,7 +196,9 @@ public:
      Bit = NDB_TYPE_BIT,          ///< Bit, length specifies no of bits
      Longvarchar = NDB_TYPE_LONG_VARCHAR,  ///< Length bytes: 2, little-endian
      Longvarbinary = NDB_TYPE_LONG_VARBINARY, ///< Length bytes: 2, little-endian
      Time = NDB_TYPE_TIME         ///< Time without date
      Time = NDB_TYPE_TIME,        ///< Time without date
      Year = NDB_TYPE_YEAR,   ///< Year 1901-2155 (1 byte)
      Timestamp = NDB_TYPE_TIMESTAMP  ///< Unix time
    };

    /** 
+5 −1
Original line number Diff line number Diff line
@@ -92,7 +92,9 @@ public:
      Bit = NDB_TYPE_BIT,
      Longvarchar = NDB_TYPE_LONG_VARCHAR,
      Longvarbinary = NDB_TYPE_LONG_VARBINARY,
      Time = NDB_TYPE_TIME
      Time = NDB_TYPE_TIME,
      Year = NDB_TYPE_YEAR,
      Timestamp = NDB_TYPE_TIMESTAMP
    };
    Enum m_typeId;      // redundant
    Cmp* m_cmp;         // comparison method
@@ -161,6 +163,8 @@ private:
  static Cmp cmpLongvarchar;
  static Cmp cmpLongvarbinary;
  static Cmp cmpTime;
  static Cmp cmpYear;
  static Cmp cmpTimestamp;
};

#endif
Loading