Skip to content

Commit

Permalink
MDEV-5528 Command line variable to choose MariaDB-5.3 vs MySQL-5.6 te…
Browse files Browse the repository at this point in the history
…mporal data formats
  • Loading branch information
Alexander Barkov committed Nov 3, 2014
1 parent a245543 commit 43f185e
Show file tree
Hide file tree
Showing 53 changed files with 1,643 additions and 588 deletions.
2 changes: 1 addition & 1 deletion mysql-test/r/ctype_binary.result
Original file line number Diff line number Diff line change
Expand Up @@ -2769,7 +2769,7 @@ id select_type table type possible_keys key key_len ref rows Extra
ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition
1 SIMPLE t1 range date_column date_column 6 NULL 1 Using index condition
DROP TABLE t1;
#
# Bug #31384 DATE_ADD() and DATE_SUB() return binary data
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/r/ctype_cp1251.result
Original file line number Diff line number Diff line change
Expand Up @@ -3161,7 +3161,7 @@ id select_type table type possible_keys key key_len ref rows Extra
ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition
1 SIMPLE t1 range date_column date_column 6 NULL 1 Using index condition
DROP TABLE t1;
#
# Bug #31384 DATE_ADD() and DATE_SUB() return binary data
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/r/ctype_latin1.result
Original file line number Diff line number Diff line change
Expand Up @@ -3445,7 +3445,7 @@ id select_type table type possible_keys key key_len ref rows Extra
ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition
1 SIMPLE t1 range date_column date_column 6 NULL 1 Using index condition
DROP TABLE t1;
#
# Bug #31384 DATE_ADD() and DATE_SUB() return binary data
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/r/ctype_ucs.result
Original file line number Diff line number Diff line change
Expand Up @@ -4352,7 +4352,7 @@ id select_type table type possible_keys key key_len ref rows Extra
ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition
1 SIMPLE t1 range date_column date_column 6 NULL 1 Using index condition
DROP TABLE t1;
#
# Bug #31384 DATE_ADD() and DATE_SUB() return binary data
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/r/ctype_utf8.result
Original file line number Diff line number Diff line change
Expand Up @@ -5220,7 +5220,7 @@ id select_type table type possible_keys key key_len ref rows Extra
ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition
1 SIMPLE t1 range date_column date_column 6 NULL 1 Using index condition
DROP TABLE t1;
#
# Bug #31384 DATE_ADD() and DATE_SUB() return binary data
Expand Down
20 changes: 10 additions & 10 deletions mysql-test/r/distinct.result
Original file line number Diff line number Diff line change
Expand Up @@ -925,9 +925,6 @@ set join_buffer_size=1024;
SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
id
7
8
9
18
20
24
Expand All @@ -937,34 +934,37 @@ id
51
61
64
7
71
74
77
78
8
9
93
94
set join_buffer_size=1024*16;
SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
id
7
9
18
20
24
8
43
45
50
51
61
43
45
71
64
7
71
74
77
78
94
8
9
93
94
set join_buffer_size=default;
SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
Expand Down
6 changes: 3 additions & 3 deletions mysql-test/r/func_in.result
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ select * from t2 where a NOT IN (
'2006-04-25 10:00:00','2006-04-25 10:02:00','2006-04-25 10:04:00',
'2006-04-25 10:06:00', '2006-04-25 10:08:00');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range a a 9 NULL 18 Using index condition
1 SIMPLE t2 range a a 6 NULL 12 Using index condition
select * from t2 where a NOT IN (
'2006-04-25 10:00:00','2006-04-25 10:02:00','2006-04-25 10:04:00',
'2006-04-25 10:06:00', '2006-04-25 10:08:00');
Expand Down Expand Up @@ -701,11 +701,11 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN SELECT * FROM t1 WHERE c_datetime
IN ('2009-09-01 00:00:01', '2009-09-02 00:00:01', '2009-09-03 00:00:01');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_datetime c_datetime 8 NULL 3 Using index condition
1 SIMPLE t1 range c_datetime c_datetime 5 NULL 3 Using index condition
EXPLAIN SELECT * FROM t1 WHERE c_datetime
IN (NULL, '2009-09-01 00:00:01', '2009-09-02 00:00:01', '2009-09-03 00:00:01');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_datetime c_datetime 8 NULL 3 Using index condition
1 SIMPLE t1 range c_datetime c_datetime 5 NULL 3 Using index condition
EXPLAIN SELECT * FROM t1 WHERE c_datetime IN (NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Expand Down
5 changes: 5 additions & 0 deletions mysql-test/r/mysqld--help.result
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,10 @@ The following options may be given as the first argument:
NULLS_UNEQUAL (default behavior for 4.1 and later),
NULLS_EQUAL (emulate 4.0 behavior), and NULLS_IGNORED
--myisam-use-mmap Use memory mapping for reading and writing MyISAM tables
--mysql56-temporal-format
Use MySQL-5.6 (instead of MariaDB-5.3) format for TIME,
DATETIME, TIMESTAMP columns.
(Defaults to on; use --skip-mysql56-temporal-format to disable.)
--net-buffer-length=#
Buffer length for TCP/IP and socket communication
--net-read-timeout=#
Expand Down Expand Up @@ -1226,6 +1230,7 @@ myisam-repair-threads 1
myisam-sort-buffer-size 134216704
myisam-stats-method NULLS_UNEQUAL
myisam-use-mmap FALSE
mysql56-temporal-format TRUE
net-buffer-length 16384
net-read-timeout 30
net-retry-count 10
Expand Down
13 changes: 13 additions & 0 deletions mysql-test/r/old-mode.result
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ DROP TABLE t1;
#
# MDEV-6649 Different warnings for TIME and TIME(N) when @@old_mode=zero_date_time_cast
#
SET @@global.mysql56_temporal_format=true;
SET @@old_mode=zero_date_time_cast;
CREATE TABLE t1 (a TIME,b TIME(1));
INSERT INTO t1 VALUES (TIME'830:20:30',TIME'830:20:30');
Expand All @@ -114,3 +115,15 @@ Warnings:
Warning 1264 Out of range value for column 'a' at row 1
Warning 1264 Out of range value for column 'b' at row 1
DROP TABLE t1;
SET @@global.mysql56_temporal_format=false;
SET @@old_mode=zero_date_time_cast;
CREATE TABLE t1 (a TIME,b TIME(1));
INSERT INTO t1 VALUES (TIME'830:20:30',TIME'830:20:30');
SELECT TO_DAYS(a), TO_DAYS(b) FROM t1;
TO_DAYS(a) TO_DAYS(b)
NULL NULL
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
Warning 1264 Out of range value for column 'b' at row 1
DROP TABLE t1;
SET @@global.mysql56_temporal_format=DEFAULT;
Loading

0 comments on commit 43f185e

Please sign in to comment.