Skip to content

Commit 43f185e

Browse files
author
Alexander Barkov
committed
MDEV-5528 Command line variable to choose MariaDB-5.3 vs MySQL-5.6 temporal data formats
1 parent a245543 commit 43f185e

File tree

53 files changed

+1643
-588
lines changed

Some content is hidden

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

53 files changed

+1643
-588
lines changed

mysql-test/r/ctype_binary.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2769,7 +2769,7 @@ id select_type table type possible_keys key key_len ref rows Extra
27692769
ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
27702770
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
27712771
id select_type table type possible_keys key key_len ref rows Extra
2772-
1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition
2772+
1 SIMPLE t1 range date_column date_column 6 NULL 1 Using index condition
27732773
DROP TABLE t1;
27742774
#
27752775
# Bug #31384 DATE_ADD() and DATE_SUB() return binary data

mysql-test/r/ctype_cp1251.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3161,7 +3161,7 @@ id select_type table type possible_keys key key_len ref rows Extra
31613161
ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
31623162
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
31633163
id select_type table type possible_keys key key_len ref rows Extra
3164-
1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition
3164+
1 SIMPLE t1 range date_column date_column 6 NULL 1 Using index condition
31653165
DROP TABLE t1;
31663166
#
31673167
# Bug #31384 DATE_ADD() and DATE_SUB() return binary data

mysql-test/r/ctype_latin1.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3445,7 +3445,7 @@ id select_type table type possible_keys key key_len ref rows Extra
34453445
ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
34463446
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
34473447
id select_type table type possible_keys key key_len ref rows Extra
3448-
1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition
3448+
1 SIMPLE t1 range date_column date_column 6 NULL 1 Using index condition
34493449
DROP TABLE t1;
34503450
#
34513451
# Bug #31384 DATE_ADD() and DATE_SUB() return binary data

mysql-test/r/ctype_ucs.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4352,7 +4352,7 @@ id select_type table type possible_keys key key_len ref rows Extra
43524352
ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
43534353
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
43544354
id select_type table type possible_keys key key_len ref rows Extra
4355-
1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition
4355+
1 SIMPLE t1 range date_column date_column 6 NULL 1 Using index condition
43564356
DROP TABLE t1;
43574357
#
43584358
# Bug #31384 DATE_ADD() and DATE_SUB() return binary data

mysql-test/r/ctype_utf8.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5220,7 +5220,7 @@ id select_type table type possible_keys key key_len ref rows Extra
52205220
ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
52215221
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
52225222
id select_type table type possible_keys key key_len ref rows Extra
5223-
1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition
5223+
1 SIMPLE t1 range date_column date_column 6 NULL 1 Using index condition
52245224
DROP TABLE t1;
52255225
#
52265226
# Bug #31384 DATE_ADD() and DATE_SUB() return binary data

mysql-test/r/distinct.result

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -925,9 +925,6 @@ set join_buffer_size=1024;
925925
SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
926926
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
927927
id
928-
7
929-
8
930-
9
931928
18
932929
20
933930
24
@@ -937,34 +934,37 @@ id
937934
51
938935
61
939936
64
937+
7
940938
71
941939
74
942940
77
943941
78
942+
8
943+
9
944944
93
945945
94
946946
set join_buffer_size=1024*16;
947947
SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
948948
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
949949
id
950-
7
951-
9
952950
18
953951
20
954952
24
955-
8
953+
43
954+
45
956955
50
957956
51
958957
61
959-
43
960-
45
961-
71
962958
64
959+
7
960+
71
963961
74
964962
77
965963
78
966-
94
964+
8
965+
9
967966
93
967+
94
968968
set join_buffer_size=default;
969969
SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
970970
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;

mysql-test/r/func_in.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ select * from t2 where a NOT IN (
271271
'2006-04-25 10:00:00','2006-04-25 10:02:00','2006-04-25 10:04:00',
272272
'2006-04-25 10:06:00', '2006-04-25 10:08:00');
273273
id select_type table type possible_keys key key_len ref rows Extra
274-
1 SIMPLE t2 range a a 9 NULL 18 Using index condition
274+
1 SIMPLE t2 range a a 6 NULL 12 Using index condition
275275
select * from t2 where a NOT IN (
276276
'2006-04-25 10:00:00','2006-04-25 10:02:00','2006-04-25 10:04:00',
277277
'2006-04-25 10:06:00', '2006-04-25 10:08:00');
@@ -701,11 +701,11 @@ id select_type table type possible_keys key key_len ref rows Extra
701701
EXPLAIN SELECT * FROM t1 WHERE c_datetime
702702
IN ('2009-09-01 00:00:01', '2009-09-02 00:00:01', '2009-09-03 00:00:01');
703703
id select_type table type possible_keys key key_len ref rows Extra
704-
1 SIMPLE t1 range c_datetime c_datetime 8 NULL 3 Using index condition
704+
1 SIMPLE t1 range c_datetime c_datetime 5 NULL 3 Using index condition
705705
EXPLAIN SELECT * FROM t1 WHERE c_datetime
706706
IN (NULL, '2009-09-01 00:00:01', '2009-09-02 00:00:01', '2009-09-03 00:00:01');
707707
id select_type table type possible_keys key key_len ref rows Extra
708-
1 SIMPLE t1 range c_datetime c_datetime 8 NULL 3 Using index condition
708+
1 SIMPLE t1 range c_datetime c_datetime 5 NULL 3 Using index condition
709709
EXPLAIN SELECT * FROM t1 WHERE c_datetime IN (NULL);
710710
id select_type table type possible_keys key key_len ref rows Extra
711711
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables

mysql-test/r/mysqld--help.result

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,10 @@ The following options may be given as the first argument:
479479
NULLS_UNEQUAL (default behavior for 4.1 and later),
480480
NULLS_EQUAL (emulate 4.0 behavior), and NULLS_IGNORED
481481
--myisam-use-mmap Use memory mapping for reading and writing MyISAM tables
482+
--mysql56-temporal-format
483+
Use MySQL-5.6 (instead of MariaDB-5.3) format for TIME,
484+
DATETIME, TIMESTAMP columns.
485+
(Defaults to on; use --skip-mysql56-temporal-format to disable.)
482486
--net-buffer-length=#
483487
Buffer length for TCP/IP and socket communication
484488
--net-read-timeout=#
@@ -1226,6 +1230,7 @@ myisam-repair-threads 1
12261230
myisam-sort-buffer-size 134216704
12271231
myisam-stats-method NULLS_UNEQUAL
12281232
myisam-use-mmap FALSE
1233+
mysql56-temporal-format TRUE
12291234
net-buffer-length 16384
12301235
net-read-timeout 30
12311236
net-retry-count 10

mysql-test/r/old-mode.result

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ DROP TABLE t1;
104104
#
105105
# MDEV-6649 Different warnings for TIME and TIME(N) when @@old_mode=zero_date_time_cast
106106
#
107+
SET @@global.mysql56_temporal_format=true;
107108
SET @@old_mode=zero_date_time_cast;
108109
CREATE TABLE t1 (a TIME,b TIME(1));
109110
INSERT INTO t1 VALUES (TIME'830:20:30',TIME'830:20:30');
@@ -114,3 +115,15 @@ Warnings:
114115
Warning 1264 Out of range value for column 'a' at row 1
115116
Warning 1264 Out of range value for column 'b' at row 1
116117
DROP TABLE t1;
118+
SET @@global.mysql56_temporal_format=false;
119+
SET @@old_mode=zero_date_time_cast;
120+
CREATE TABLE t1 (a TIME,b TIME(1));
121+
INSERT INTO t1 VALUES (TIME'830:20:30',TIME'830:20:30');
122+
SELECT TO_DAYS(a), TO_DAYS(b) FROM t1;
123+
TO_DAYS(a) TO_DAYS(b)
124+
NULL NULL
125+
Warnings:
126+
Warning 1264 Out of range value for column 'a' at row 1
127+
Warning 1264 Out of range value for column 'b' at row 1
128+
DROP TABLE t1;
129+
SET @@global.mysql56_temporal_format=DEFAULT;

0 commit comments

Comments
 (0)