mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
853077ad7e
Conflicts: .bzrignore VERSION cmake/plugin.cmake debian/dist/Debian/control debian/dist/Ubuntu/control mysql-test/r/join_outer.result mysql-test/r/join_outer_jcl6.result mysql-test/r/null.result mysql-test/r/old-mode.result mysql-test/r/union.result mysql-test/t/join_outer.test mysql-test/t/null.test mysql-test/t/old-mode.test mysql-test/t/union.test packaging/rpm-oel/mysql.spec.in scripts/mysql_config.sh sql/ha_ndbcluster.cc sql/ha_ndbcluster_binlog.cc sql/ha_ndbcluster_cond.cc sql/item_cmpfunc.h sql/lock.cc sql/sql_select.cc sql/sql_show.cc sql/sql_update.cc sql/sql_yacc.yy storage/innobase/buf/buf0flu.cc storage/innobase/fil/fil0fil.cc storage/innobase/include/srv0srv.h storage/innobase/lock/lock0lock.cc storage/tokudb/CMakeLists.txt storage/xtradb/buf/buf0flu.cc storage/xtradb/fil/fil0fil.cc storage/xtradb/include/srv0srv.h storage/xtradb/lock/lock0lock.cc support-files/mysql.spec.sh
85 lines
2.7 KiB
Text
85 lines
2.7 KiB
Text
#
|
|
# Test 'old' mode
|
|
#
|
|
|
|
# Initialise
|
|
--disable_warnings
|
|
drop table if exists t1,t2;
|
|
--enable_warnings
|
|
|
|
create table t1 (a int, b varchar(200), c text not null) checksum=1;
|
|
create table t2 (a int, b varchar(200), c text not null) checksum=0;
|
|
insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
|
|
insert t2 select * from t1;
|
|
checksum table t1, t2;
|
|
checksum table t1, t2 quick;
|
|
checksum table t1, t2 extended;
|
|
drop table t1,t2;
|
|
|
|
#
|
|
# Test that SHOW PROCESSLIST doesn't have the Progress column
|
|
#
|
|
|
|
--replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
|
|
# Embedded server is hardcoded to show "Writing to net" as STATE.
|
|
--replace_result "Writing to net" "NULL"
|
|
--replace_regex /localhost[:0-9]*/localhost/
|
|
SHOW PROCESSLIST;
|
|
|
|
--echo #
|
|
--echo # MDEV-5372 Make "CAST(time_expr AS DATETIME)" compatible with the SQL Standard)
|
|
--echo #
|
|
set @@old_mode=zero_date_time_cast;
|
|
SELECT CAST(TIME'-10:30:30' AS DATETIME);
|
|
SELECT CAST(TIME'10:20:30' AS DATETIME);
|
|
SELECT CAST(TIME'830:20:30' AS DATETIME);
|
|
CREATE TABLE t1 (a DATETIME);
|
|
INSERT INTO t1 VALUES (TIME'-10:20:30');
|
|
INSERT INTO t1 VALUES (TIME'10:20:30');
|
|
INSERT INTO t1 VALUES (TIME'830:20:30');
|
|
SELECT * FROM t1;
|
|
DROP TABLE t1;
|
|
CREATE TABLE t1 (a TIMESTAMP);
|
|
INSERT INTO t1 VALUES (TIME'-10:20:30');
|
|
INSERT INTO t1 VALUES (TIME'10:20:30');
|
|
INSERT INTO t1 VALUES (TIME'830:20:30');
|
|
SELECT * FROM t1;
|
|
DROP TABLE t1;
|
|
CREATE TABLE t1 (a TIME);
|
|
INSERT INTO t1 VALUES (TIME'-10:20:30');
|
|
INSERT INTO t1 VALUES (TIME'10:20:30');
|
|
INSERT INTO t1 VALUES (TIME'830:20:30');
|
|
SELECT a, CAST(a AS DATETIME), TO_DAYS(a) FROM t1;
|
|
DROP TABLE t1;
|
|
# Note, it was actually a bug that TO_DAYS('830:20:30') returned NULL
|
|
# for a column, while 3 for an expression. We won't fix this,
|
|
# it's "old_mode" anyway.
|
|
SELECT TO_DAYS(TIME'-10:20:30');
|
|
SELECT TO_DAYS(TIME'10:20:30');
|
|
SELECT TO_DAYS(TIME'830:20:30');
|
|
|
|
# This is to cover Item_temporal_hybrid_func::fix_temporal_type in old_mode:
|
|
CREATE TABLE t1 (a DATETIME, b TIME);
|
|
INSERT INTO t1 VALUES (NULL, '00:20:12');
|
|
INSERT INTO t1 VALUES (NULL, '-00:20:12');
|
|
SELECT IF(1,ADDDATE(IFNULL(a,b),0),1) FROM t1;
|
|
DROP TABLE t1;
|
|
|
|
--echo #
|
|
--echo # MDEV-6649 Different warnings for TIME and TIME(N) when @@old_mode=zero_date_time_cast
|
|
--echo #
|
|
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');
|
|
SELECT TO_DAYS(a), TO_DAYS(b) FROM t1;
|
|
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;
|
|
DROP TABLE t1;
|
|
SET @@global.mysql56_temporal_format=DEFAULT;
|
|
|