diff options
author | Igor Babaev <igor@askmonty.org> | 2016-08-30 16:14:51 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2016-08-30 16:14:51 -0700 |
commit | 2250e9ea261f661cb73c147a28f4d30655d7483d (patch) | |
tree | 04673b47943fdb137f8fe5bafdb64a24887f8c0f /mysql-test/r/function_defaults.result | |
parent | cb1e44219b9beae92e104cfe5e67aab3073dd8aa (diff) | |
parent | 4ca7b226c05ae883accec64b1afe6d60daf1b323 (diff) | |
download | mariadb-git-2250e9ea261f661cb73c147a28f4d30655d7483d.tar.gz |
Merge 10.2 into 10.2-mdev9864.
Diffstat (limited to 'mysql-test/r/function_defaults.result')
-rw-r--r-- | mysql-test/r/function_defaults.result | 144 |
1 files changed, 62 insertions, 82 deletions
diff --git a/mysql-test/r/function_defaults.result b/mysql-test/r/function_defaults.result index b8f42b86c1f..987c505f1fb 100644 --- a/mysql-test/r/function_defaults.result +++ b/mysql-test/r/function_defaults.result @@ -9,50 +9,40 @@ SET TIME_ZONE = "+00:00"; # Test of errors for column data types that dont support function # defaults. # -CREATE TABLE t1( a BIT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a TINYINT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a SMALLINT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a MEDIUMINT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a INT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a BIGINT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a FLOAT DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a DECIMAL DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a DATE DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a TIME DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a YEAR DEFAULT CURRENT_TIMESTAMP ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a BIT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a BIT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a TINYINT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a SMALLINT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a MEDIUMINT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a INT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a BIGINT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a FLOAT DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a DECIMAL DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a DATE DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a TIME DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a YEAR DEFAULT CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a BIT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a TINYINT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a TINYINT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a SMALLINT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a SMALLINT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a MEDIUMINT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a MEDIUMINT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a INT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a INT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a BIGINT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a BIGINT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a FLOAT ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a FLOAT ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a DECIMAL ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a DECIMAL ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a DATE ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a DATE ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a TIME ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a TIME ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a YEAR ON UPDATE CURRENT_TIMESTAMP ); +CREATE OR REPLACE TABLE t1( a YEAR ON UPDATE CURRENT_TIMESTAMP ); ERROR HY000: Invalid ON UPDATE clause for 'a' column +drop table if exists t1; # # Test that the default clause behaves like NOW() regarding time zones. # @@ -864,8 +854,8 @@ SET TIMESTAMP = 2000.876543; INSERT INTO t2( a ) VALUES ( 3 ); SELECT * FROM t2; b a -0000-00-00 00:00:00 1 -0000-00-00 00:00:00 2 +1970-01-01 00:16:40 1 +1970-01-01 00:16:40 2 1970-01-01 00:33:20 3 DROP TABLE t1, t2; # @@ -1242,7 +1232,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `g` timestamp NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 LOAD DATA INFILE "file1.dat" INTO table t1; Warnings: @@ -1294,7 +1284,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `g` timestamp NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 LOAD DATA INFILE "file1.dat" INTO table t1; Warnings: @@ -1361,7 +1351,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `g` timestamp NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 LOAD DATA INFILE "file2.dat" INTO table t1; Warnings: @@ -1399,7 +1389,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `g` timestamp NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 LOAD DATA INFILE "file2.dat" INTO table t1; Warnings: @@ -1453,7 +1443,7 @@ a b # 1970-01-01 03:33:20 SET TIMESTAMP = 2000.000234; UPDATE v1 SET a = 2; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM t1; a b 1 1970-01-01 03:16:40 @@ -1476,7 +1466,7 @@ a c 1973-08-14 09:11:22 1 SET TIMESTAMP = 1.126789; INSERT INTO v1 ( c ) VALUES ( 1 ) ON DUPLICATE KEY UPDATE c = 2; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM v1; a c 1973-08-14 09:11:22 1 @@ -1565,50 +1555,40 @@ SET TIME_ZONE = "+00:00"; # Test of errors for column data types that dont support function # defaults. # -CREATE TABLE t1( a BIT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a TINYINT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a SMALLINT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a MEDIUMINT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a INT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a BIGINT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a FLOAT DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a DECIMAL DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a DATE DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a TIME DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a YEAR DEFAULT CURRENT_TIMESTAMP(6) ); -ERROR 42000: Invalid default value for 'a' -CREATE TABLE t1( a BIT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a BIT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a TINYINT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a SMALLINT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a MEDIUMINT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a INT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a BIGINT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a FLOAT DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a DECIMAL DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a DATE DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a TIME DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a YEAR DEFAULT CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a BIT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a TINYINT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a TINYINT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a SMALLINT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a SMALLINT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a MEDIUMINT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a MEDIUMINT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a INT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a INT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a BIGINT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a BIGINT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a FLOAT ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a FLOAT ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a DECIMAL ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a DECIMAL ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a DATE ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a DATE ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a TIME ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a TIME ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column -CREATE TABLE t1( a YEAR ON UPDATE CURRENT_TIMESTAMP(6) ); +CREATE OR REPLACE TABLE t1( a YEAR ON UPDATE CURRENT_TIMESTAMP(6) ); ERROR HY000: Invalid ON UPDATE clause for 'a' column +drop table if exists t1; # # Test that the default clause behaves like NOW() regarding time zones. # @@ -2420,8 +2400,8 @@ SET TIMESTAMP = 2000.876543; INSERT INTO t2( a ) VALUES ( 3 ); SELECT * FROM t2; b a -0000-00-00 00:00:00.000000 1 -0000-00-00 00:00:00.000000 2 +1970-01-01 00:16:40.987654 1 +1970-01-01 00:16:40.987654 2 1970-01-01 00:33:20.876543 3 DROP TABLE t1, t2; # @@ -2798,7 +2778,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `g` timestamp(6) NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 LOAD DATA INFILE "file1.dat" INTO table t1; Warnings: @@ -2850,7 +2830,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `g` timestamp(6) NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 LOAD DATA INFILE "file1.dat" INTO table t1; Warnings: @@ -2917,7 +2897,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `g` timestamp(6) NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 LOAD DATA INFILE "file2.dat" INTO table t1; Warnings: @@ -2955,7 +2935,7 @@ t1 CREATE TABLE `t1` ( `f` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `g` timestamp(6) NULL DEFAULT NULL, `h` int(11) DEFAULT NULL, - `i` int(11) NOT NULL DEFAULT '42' + `i` int(11) NOT NULL DEFAULT 42 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 LOAD DATA INFILE "file2.dat" INTO table t1; Warnings: @@ -3009,7 +2989,7 @@ a b # 1970-01-01 03:33:20 SET TIMESTAMP = 2000.000234; UPDATE v1 SET a = 2; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM t1; a b 1 1970-01-01 03:16:40.123456 @@ -3032,7 +3012,7 @@ a c 1973-08-14 09:11:22.089786 1 SET TIMESTAMP = 1.126789; INSERT INTO v1 ( c ) VALUES ( 1 ) ON DUPLICATE KEY UPDATE c = 2; -ERROR HY000: CHECK OPTION failed 'test.v1' +ERROR 44000: CHECK OPTION failed `test`.`v1` SELECT * FROM v1; a c 1973-08-14 09:11:22.089786 1 |