Skip to content

Commit cc3b5d1

Browse files
committed
Merge bb-10.2-ext into 10.3
2 parents b006d2e + 22770a9 commit cc3b5d1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1272
-356
lines changed

include/my_time.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,6 @@ ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *);
134134
ulonglong TIME_to_ulonglong(const MYSQL_TIME *);
135135
double TIME_to_double(const MYSQL_TIME *my_time);
136136

137-
longlong pack_time(const MYSQL_TIME *my_time);
138-
MYSQL_TIME *unpack_time(longlong packed, MYSQL_TIME *my_time);
139-
140137
int check_time_range(struct st_mysql_time *my_time, uint dec, int *warning);
141138
my_bool check_datetime_range(const MYSQL_TIME *ltime);
142139

mysql-test/r/type_datetime.result

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,5 +1218,86 @@ a
12181218
DROP TABLE t1;
12191219
SET timestamp=DEFAULT;
12201220
#
1221+
# MDEV-15310 Range optimizer does not work well for "WHERE temporal_column NOT IN (const_list)"
1222+
#
1223+
#
1224+
# DATETIME(0)
1225+
#
1226+
CREATE TABLE t1 (a DATETIME, filler CHAR(200), KEY(a));
1227+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1228+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1229+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1230+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1231+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1232+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1233+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1234+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1235+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1236+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1237+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1238+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1239+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1240+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1241+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1242+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1243+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1244+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1245+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1246+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1247+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1248+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1249+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1250+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01', 'no');
1251+
INSERT INTO t1 VALUES ('2001-01-01 23:00:02', 'no');
1252+
INSERT INTO t1 VALUES ('2001-01-01 23:00:03', 'yes');
1253+
INSERT INTO t1 VALUES ('2001-01-01 23:00:04', 'yes');
1254+
EXPLAIN SELECT * FROM t1 WHERE a NOT IN ('2001-01-01 23:00:01','2001-01-01 23:00:02');
1255+
id select_type table type possible_keys key key_len ref rows Extra
1256+
1 SIMPLE t1 range a a 6 NULL 5 Using index condition
1257+
SELECT * FROM t1 WHERE a NOT IN ('2001-01-01 23:00:01','2001-01-01 23:00:02');
1258+
a filler
1259+
2001-01-01 23:00:03 yes
1260+
2001-01-01 23:00:04 yes
1261+
DROP TABLE t1;
1262+
#
1263+
# DATETIME(1)
1264+
#
1265+
CREATE TABLE t1 (a DATETIME(1), filler CHAR(200), KEY(a));
1266+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1267+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1268+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1269+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1270+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1271+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1272+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1273+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1274+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1275+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1276+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1277+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1278+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1279+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1280+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1281+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1282+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1283+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1284+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1285+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1286+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1287+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1288+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1289+
INSERT INTO t1 VALUES ('2001-01-01 23:00:01.1', 'no');
1290+
INSERT INTO t1 VALUES ('2001-01-01 23:00:02.1', 'no');
1291+
INSERT INTO t1 VALUES ('2001-01-01 23:00:03.1', 'yes');
1292+
INSERT INTO t1 VALUES ('2001-01-01 23:00:04.1', 'yes');
1293+
EXPLAIN SELECT * FROM t1 WHERE a NOT IN ('2001-01-01 23:00:01.1','2001-01-01 23:00:02.1');
1294+
id select_type table type possible_keys key key_len ref rows Extra
1295+
1 SIMPLE t1 range a a 7 NULL 5 Using index condition
1296+
SELECT * FROM t1 WHERE a NOT IN ('2001-01-01 23:00:01.1','2001-01-01 23:00:02.1');
1297+
a filler
1298+
2001-01-01 23:00:03.1 yes
1299+
2001-01-01 23:00:04.1 yes
1300+
DROP TABLE t1;
1301+
#
12211302
# End of 10.3 tests
12221303
#

0 commit comments

Comments
 (0)