diff options
author | Alexander Barkov <bar@mariadb.org> | 2015-12-29 19:37:11 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2015-12-29 19:37:11 +0400 |
commit | 2ba7ed77aab05004f0c853a77850e325b78a1892 (patch) | |
tree | 943659d76215e16d0d1946c28683c562debeff34 /mysql-test/r | |
parent | 63f0669fd6dc430b60ffd5de0bff9854622a1c1a (diff) | |
parent | 1bb66ea88c4679d6bd3ad1472d75983e66f679ae (diff) | |
download | mariadb-git-2ba7ed77aab05004f0c853a77850e325b78a1892.tar.gz |
Merge remote-tracking branch 'origin/10.1' into 10.2
Diffstat (limited to 'mysql-test/r')
26 files changed, 701 insertions, 15 deletions
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 5fc06e4362e..6f664d306a1 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -1883,5 +1883,11 @@ t1 CREATE TABLE `t1` ( `c` char(32) AS (convert(cast(n as char), char)) PERSISTENT ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +set @@session.collation_server=filename; +create table t1(a enum('','')); +Warnings: +Note 1291 Column 'a' has duplicated value '' in ENUM +drop table t1; +set @@session.collation_server=default; create table t1; ERROR 42000: A table must have at least 1 column diff --git a/mysql-test/r/ctype_filename.result b/mysql-test/r/ctype_filename.result index 12cc8afcbd2..c6d7d1e39b9 100644 --- a/mysql-test/r/ctype_filename.result +++ b/mysql-test/r/ctype_filename.result @@ -11,6 +11,9 @@ create table com1 (a int); drop table com1; create table `clock$` (a int); drop table `clock$`; +select convert(convert(',' using filename) using binary); +convert(convert(',' using filename) using binary) +@002c # # MDEV-7677 my_charset_handler_filename has a wrong "ismbchar" member # diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 97617f6c3df..56174311bf3 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -5640,5 +5640,14 @@ Warnings: Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d` from `test`.`t1` where ((coalesce(`test`.`t1`.`c`,0) = '3 ') and (coalesce(`test`.`t1`.`d`,0) = '3 ')) DROP TABLE t1; # +# MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED) +# +SET NAMES utf8; +SELECT CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED); +CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED) +1 +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '1IJ3' +# # End of 10.1 tests # diff --git a/mysql-test/r/ctype_utf16.result b/mysql-test/r/ctype_utf16.result index 77941ab4906..3bd37255b59 100644 --- a/mysql-test/r/ctype_utf16.result +++ b/mysql-test/r/ctype_utf16.result @@ -2190,5 +2190,14 @@ COUNT(DISTINCT a) 7 DROP TABLE t1; # +# MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING utf16) AS SIGNED) +# +SET NAMES utf8; +SELECT CAST(CONVERT('1IJ3' USING utf16) AS SIGNED); +CAST(CONVERT('1IJ3' USING utf16) AS SIGNED) +1 +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '1IJ3' +# # End of 10.1 tests # diff --git a/mysql-test/r/ctype_utf16le.result b/mysql-test/r/ctype_utf16le.result index a2d3ffb793f..93fce843dc8 100644 --- a/mysql-test/r/ctype_utf16le.result +++ b/mysql-test/r/ctype_utf16le.result @@ -2382,5 +2382,14 @@ COUNT(DISTINCT a) 7 DROP TABLE t1; # +# MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED) +# +SET NAMES utf8; +SELECT CAST(CONVERT('1IJ3' USING utf16le) AS SIGNED); +CAST(CONVERT('1IJ3' USING utf16le) AS SIGNED) +1 +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '1IJ3' +# # End of 10.1 tests # diff --git a/mysql-test/r/ctype_utf32.result b/mysql-test/r/ctype_utf32.result index 16e045d0fbb..a0a8072265c 100644 --- a/mysql-test/r/ctype_utf32.result +++ b/mysql-test/r/ctype_utf32.result @@ -2226,5 +2226,14 @@ SELECT _utf32 0x10001=_utf32 0x10002; _utf32 0x10001=_utf32 0x10002 1 # +# MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED) +# +SET NAMES utf8; +SELECT CAST(CONVERT('1IJ3' USING utf32) AS SIGNED); +CAST(CONVERT('1IJ3' USING utf32) AS SIGNED) +1 +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '1IJ3' +# # End of 10.1 tests # diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 66db7df555f..d95b506f247 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -6155,6 +6155,49 @@ SELECT (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2); ERROR 21000: Subquery returns more than 1 row DROP TABLE t1, t2; # +# MDEV-8630 Datetime value dropped in "INSERT ... SELECT ... ON DUPLICATE KEY" +# +SET NAMES utf8; +CREATE TABLE t1 (id2 int, ts timestamp); +INSERT INTO t1 VALUES (1,'2012-06-11 15:17:34'),(2,'2012-06-11 15:18:24'); +CREATE TABLE t2 AS SELECT +COALESCE(ts, 0) AS c0, +GREATEST(COALESCE(ts, 0), COALESCE(ts, 0)) AS c1, +GREATEST(CASE WHEN 1 THEN ts ELSE 0 END, CASE WHEN 1 THEN ts ELSE 0 END) AS c2, +GREATEST(IFNULL(ts,0), IFNULL(ts,0)) AS c3, +GREATEST(IF(1,ts,0), IF(1,ts,0)) AS c4 +FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `c0` varchar(19) CHARACTER SET utf8 NOT NULL, + `c1` varchar(19) CHARACTER SET utf8 NOT NULL, + `c2` varchar(19) CHARACTER SET utf8 NOT NULL, + `c3` varchar(19) CHARACTER SET utf8 NOT NULL, + `c4` varchar(19) CHARACTER SET utf8 NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT * FROM t2; +c0 c1 c2 c3 c4 +2012-06-11 15:17:34 2012-06-11 15:17:34 2012-06-11 15:17:34 2012-06-11 15:17:34 2012-06-11 15:17:34 +2012-06-11 15:18:24 2012-06-11 15:18:24 2012-06-11 15:18:24 2012-06-11 15:18:24 2012-06-11 15:18:24 +DROP TABLE t2, t1; +# +# MDEV-9319 ALTER from a bigger to a smaller blob type truncates too much data +# +SET NAMES utf8; +CREATE TABLE t1 (a TEXT CHARACTER SET utf8); +INSERT INTO t1 VALUES (REPEAT('A',100)); +SELECT OCTET_LENGTH(a) FROM t1; +OCTET_LENGTH(a) +300 +ALTER TABLE t1 MODIFY a TINYTEXT CHARACTER SET utf8; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +SELECT OCTET_LENGTH(a),a FROM t1; +OCTET_LENGTH(a) a +255 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +DROP TABLE t1; +# # End of 5.5 tests # # diff --git a/mysql-test/r/ctype_utf8mb4.result b/mysql-test/r/ctype_utf8mb4.result index abdec24bf37..ac53a7e5a4e 100644 --- a/mysql-test/r/ctype_utf8mb4.result +++ b/mysql-test/r/ctype_utf8mb4.result @@ -2809,6 +2809,22 @@ Warning 1292 Truncated incorrect INTEGER value: 'a' DROP TABLE t1; # End of test for Bug#13581962,Bug#14096619 # +# MDEV-9319 ALTER from a bigger to a smaller blob type truncates too much data +# +SET NAMES utf8mb4; +CREATE TABLE t1 (a TEXT CHARACTER SET utf8mb4); +INSERT INTO t1 VALUES (REPEAT('😎',100)); +SELECT OCTET_LENGTH(a) FROM t1; +OCTET_LENGTH(a) +400 +ALTER TABLE t1 MODIFY a TINYTEXT CHARACTER SET utf8mb4; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +SELECT OCTET_LENGTH(a),a FROM t1; +OCTET_LENGTH(a) a +252 😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎 +DROP TABLE t1; +# # End of 5.5 tests # # diff --git a/mysql-test/r/dyncol.result b/mysql-test/r/dyncol.result index 62e3b1c7331..b0d28a81043 100644 --- a/mysql-test/r/dyncol.result +++ b/mysql-test/r/dyncol.result @@ -6,16 +6,16 @@ hex(COLUMN_CREATE(1, NULL AS char character set utf8)) 000000 select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8)); hex(COLUMN_CREATE(1, "afaf" AS char character set utf8)) -0001000100030861666166 +0001000100032161666166 select hex(COLUMN_CREATE(1, 1212 AS char character set utf8)); hex(COLUMN_CREATE(1, 1212 AS char character set utf8)) -0001000100030831323132 +0001000100032131323132 select hex(COLUMN_CREATE(1, 12.12 AS char character set utf8)); hex(COLUMN_CREATE(1, 12.12 AS char character set utf8)) -0001000100030831322E3132 +0001000100032131322E3132 select hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS char character set utf8)); hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS char character set utf8)) -000100010003083939393939393939393939393939393939393939393939393939393939 +000100010003213939393939393939393939393939393939393939393939393939393939 select hex(COLUMN_CREATE(1, NULL AS unsigned int)); hex(COLUMN_CREATE(1, NULL AS unsigned int)) 000000 @@ -144,7 +144,7 @@ hex(COLUMN_CREATE(1, "afaf" AS char character set utf8, 6, "2011-04-05" AS date, 7, "- 0:45:49.000001" AS time, 8, "2011-04-05 0:45:49.000001" AS datetime)) -01080001000300020029000300380004004A0005008C000600AE000700C7000800F5000861666166BC0478093D0AD7A3703D284002028C0C85B60F010010B7000485B60F010010B70000 +01080001000300020029000300380004004A0005008C000600AE000700C7000800F5002161666166BC0478093D0AD7A3703D284002028C0C85B60F010010B7000485B60F010010B70000 explain extended select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8, 2, 1212 AS unsigned int, @@ -1693,10 +1693,10 @@ ERROR 22007: Illegal value used as argument of dynamic column function # select column_json(column_create("int", -1212 as int, "uint", 12334 as unsigned int, "decimal", "23.344" as decimal, "double", 1.23444e50 as double, "string", 'gdgd\\dhdjh"dhdhd' as char, "time", "0:45:49.000001" AS time, "datetime", "2011-04-05 0:45:49.000001" AS datetime, "date", "2011-04-05" AS date)); column_json(column_create("int", -1212 as int, "uint", 12334 as unsigned int, "decimal", "23.344" as decimal, "double", 1.23444e50 as double, "string", 'gdgd\\dhdjh"dhdhd' as char, "time", "0:45:49.000001" AS time, "datetime", "2011-04-05 0:45:49.000001" -{"int":-1212,"date":"2011-04-05","time":"00:45:49.000001","uint":12334,"double":"1.2e50","string":"gdgd\\dhdjh\"dhdhd","decimal":23.344,"datetime":"2011-04-05 00:45:49.000001"} +{"int":-1212,"date":"2011-04-05","time":"00:45:49.000001","uint":12334,"double":1.23444e50,"string":"gdgd\\dhdjh\"dhdhd","decimal":23.344,"datetime":"2011-04-05 00:45:49.000001"} select column_json(column_create(1, -1212 as int, 2, 12334 as unsigned int, 3, "23.344" as decimal, 4, 1.23444e50 as double, 5, 'gdgd\\dhdjh"dhdhd' as char, 6, "0:45:49.000001" AS time, 7, "2011-04-05 0:45:49.000001" AS datetime, 8, "2011-04-05" AS date)); column_json(column_create(1, -1212 as int, 2, 12334 as unsigned int, 3, "23.344" as decimal, 4, 1.23444e50 as double, 5, 'gdgd\\dhdjh"dhdhd' as char, 6, "0:45:49.000001" AS time, 7, "2011-04-05 0:45:49.000001" AS datetime, 8, "2011-04-05" AS date)) -{"1":-1212,"2":12334,"3":23.344,"4":"1.2e50","5":"gdgd\\dhdjh\"dhdhd","6":"00:45:49.000001","7":"2011-04-05 00:45:49.000001","8":"2011-04-05"} +{"1":-1212,"2":12334,"3":23.344,"4":1.23444e50,"5":"gdgd\\dhdjh\"dhdhd","6":"00:45:49.000001","7":"2011-04-05 00:45:49.000001","8":"2011-04-05"} # # CHECK test # @@ -1820,5 +1820,58 @@ SELECT COLUMN_JSON(COLUMN_CREATE('a',1,'b','1')); COLUMN_JSON(COLUMN_CREATE('a',1,'b','1')) {"a":1,"b":"1"} # +# MDEV-8401: COLUMN_CREATE(name, value as DOUBLE) results in string +# +SELECT COLUMN_JSON( +COLUMN_CREATE( +'one', 123.456, +'two', 123.456 as DOUBLE +) +); +COLUMN_JSON( +COLUMN_CREATE( +'one', 123.456, +'two', 123.456 as DOUBLE +) +) +{"one":123.456,"two":123.456} +# +# MDEV-8521: Drastic loss of precision in COLUMN_JSON() on DOUBLEs +# +select column_get(column_create('float', 1.23456789012345E+100 as double), 'float' as double); +column_get(column_create('float', 1.23456789012345E+100 as double), 'float' as double) +1.23456789012345e100 +select column_json(column_create('float', 1.23456789012345E+100 as double)); +column_json(column_create('float', 1.23456789012345E+100 as double)) +{"float":1.23456789012345e100} +select column_json(column_create('float', 1.23456789012345E+10 as double)); +column_json(column_create('float', 1.23456789012345E+10 as double)) +{"float":12345678901.2345} +# +# MDEV-9147: Character set is ignored in Dynamic Column for saved string +# +SET NAMES utf8; +SELECT COLUMN_GET(COLUMN_CREATE(1, 0xC2A2 AS CHAR CHARACTER SET latin1), 1 AS CHAR CHARACTER SET utf8) AS a; +a +¢ +SELECT COLUMN_GET(COLUMN_CREATE(1, 0xC2A2 AS CHAR CHARACTER SET utf8), 1 AS CHAR CHARACTER SET utf8) AS a; +a +¢ +# +# MDEV-9167: COLUMN_CHECK fails on valid decimal data +# +SELECT COLUMN_CHECK(COLUMN_CREATE('a',0 AS DECIMAL,'b',1 AS DECIMAL)); +COLUMN_CHECK(COLUMN_CREATE('a',0 AS DECIMAL,'b',1 AS DECIMAL)) +1 +SELECT COLUMN_CHECK(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL)); +COLUMN_CHECK(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL)) +1 +SELECT COLUMN_JSON(COLUMN_CREATE('a',0 AS DECIMAL,'b',1 AS DECIMAL)); +COLUMN_JSON(COLUMN_CREATE('a',0 AS DECIMAL,'b',1 AS DECIMAL)) +{"a":0,"b":1} +SELECT COLUMN_JSON(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL)); +COLUMN_JSON(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL)) +{"a":1,"b":1} +# # end of 10.0 tests # diff --git a/mysql-test/r/events_1.result b/mysql-test/r/events_1.result index 637cd26b79a..153137bc4f9 100644 --- a/mysql-test/r/events_1.result +++ b/mysql-test/r/events_1.result @@ -115,8 +115,7 @@ create table t_event3 (a int, b float); drop event if exists event3; Warnings: Note 1305 Event event3 does not exist -create event event3 on schedule every 50 + 10 minute starts date_add("20100101", interval 5 minute) ends date_add("20251010", interval 5 day) -comment "portokala_comment" DO insert into t_event3 values (unix_timestamp(), rand()); +create event event3 on schedule every 50 + 10 minute starts date_add(curdate(), interval 5 minute) ends date_add(curdate(), interval 5 day) comment "portokala_comment" DO insert into t_event3 values (unix_timestamp(), rand()); select count(*) from t_event3; count(*) 0 diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result index 4c67ab5693a..5678f0f3968 100644 --- a/mysql-test/r/explain.result +++ b/mysql-test/r/explain.result @@ -393,3 +393,17 @@ Warnings: Note 1003 select NULL AS `a` from (select NULL AS `a` from `test`.`t1` where 0) `t` set optimizer_switch=@tmp_optimizer_switch; DROP TABLE t1,t2; +# +# MDEV-7215: EXPLAIN REPLACE produces an error: +# Column count doesn't match value count +# +create table t1 (a int); +insert into t1 values (1); +create table t2 (b int, c int); +replace into t2 select 100, (select a from t1); +explain replace into t2 select 100, (select a from t1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +2 SUBQUERY t1 system NULL NULL NULL NULL 1 +drop table t1, t2; +# End of 10.1 tests diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 0cac910886b..8bf948e0d72 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -551,7 +551,7 @@ MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) DROP TABLE t1; CREATE TABLE t1(a TEXT); SELECT GROUP_CONCAT(a) AS st FROM t1 HAVING MATCH(st) AGAINST('test' IN BOOLEAN MODE); -ERROR HY000: Incorrect arguments to AGAINST +ERROR HY000: Incorrect arguments to MATCH DROP TABLE t1; CREATE TABLE t1(a VARCHAR(64), FULLTEXT(a)); INSERT INTO t1 VALUES('awrd bwrd cwrd'),('awrd bwrd cwrd'),('awrd bwrd cwrd'); diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 69a14b20787..33080509114 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -1727,7 +1727,7 @@ Table Create Table SPATIAL_REF_SYS CREATE TEMPORARY TABLE `SPATIAL_REF_SYS` ( `SRID` smallint(5) NOT NULL DEFAULT '0', `AUTH_NAME` varchar(512) NOT NULL DEFAULT '', - `AUTH_SRID` smallint(5) NOT NULL DEFAULT '0', + `AUTH_SRID` int(5) NOT NULL DEFAULT '0', `SRTEXT` varchar(2048) NOT NULL DEFAULT '' ) ENGINE=MEMORY DEFAULT CHARSET=utf8 create table t1(g GEOMETRY, pt POINT); diff --git a/mysql-test/r/myisam-blob.result b/mysql-test/r/myisam-blob.result index 43db7c8badd..6b41a244621 100644 --- a/mysql-test/r/myisam-blob.result +++ b/mysql-test/r/myisam-blob.result @@ -29,9 +29,11 @@ select length(data) from t1; length(data) 18874368 alter table t1 modify data blob; +Warnings: +Warning 1265 Data truncated for column 'data' at row 1 select length(data) from t1; length(data) -0 +65535 drop table t1; CREATE TABLE t1 (data BLOB) ENGINE=myisam; INSERT INTO t1 (data) VALUES (NULL); diff --git a/mysql-test/r/mysql_plugin.result b/mysql-test/r/mysql_plugin.result index 636b039047e..0bcb47e4a10 100644 --- a/mysql-test/r/mysql_plugin.result +++ b/mysql-test/r/mysql_plugin.result @@ -102,7 +102,7 @@ ERROR: Missing --plugin_dir option. # Show the help. # mysql_plugin Ver V.V.VV Distrib XX.XX.XX -Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. Enable or disable plugins. diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result index 673c241de11..d10e042729f 100644 --- a/mysql-test/r/mysql_upgrade.result +++ b/mysql-test/r/mysql_upgrade.result @@ -46,7 +46,7 @@ Phase 6/6: Running 'FLUSH PRIVILEGES' OK Run it again - should say already completed This installation of MySQL is already upgraded to VERSION, use --force if you still need to run mysql_upgrade -Force should run it regardless of wether it's been run before +Force should run it regardless of whether it has been run before Phase 1/6: Checking and upgrading mysql database Processing databases mysql @@ -394,6 +394,13 @@ test Phase 6/6: Running 'FLUSH PRIVILEGES' OK # +# Bug #21489398: MYSQL_UPGRADE: FATAL ERROR: UPGRADE FAILED - IMPROVE ERROR +# +Run mysql_upgrade with unauthorized access +Version check failed. Got the following error when calling the 'mysql' command line client +ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) +FATAL ERROR: Upgrade failed +# # MDEV-4332 Increase username length from 16 characters # MDEV-6068, MDEV-6178 mysql_upgrade breaks databases with long user names # diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index 7d646dce596..033b4086985 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -347,6 +347,9 @@ CREATE TABLE test.`t.1` (id int); mysqlcheck test t.1 test.t.1 OK drop table test.`t.1`; +# +# MDEV-8123 mysqlcheck: new --process-views option conflicts with --quick, --extended and such +# create view v1 as select 1; mysqlcheck --process-views test test.v1 OK @@ -361,6 +364,9 @@ test.v1 OK mysqlcheck --process-views --check-upgrade test test.v1 OK drop view v1; +# +# MDEV-8124 mysqlcheck: --auto-repair runs REPAIR TABLE instead of REPAIR VIEW on views +# create table t1(a int); mysqlcheck --process-views --check-upgrade --auto-repair test test.t1 OK @@ -370,3 +376,16 @@ Repairing views test.v1 OK drop view v1; drop table t1; +# +#MDEV-7384 [PATCH] add PERSISENT FOR ALL option to mysqlanalyze/mysqlcheck +# +create table t1(a int); +insert into t1 (a) values (1), (2), (3); +select * from mysql.column_stats; +db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram +test.t1 Engine-independent statistics collected +status : OK +select * from mysql.column_stats where db_name = 'test' and table_name = 't1'; +db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram +test t1 a 1 3 0.0000 4.0000 1.0000 0 NULL NULL +drop table t1; diff --git a/mysql-test/r/mysqld_help_crash-9183.result b/mysql-test/r/mysqld_help_crash-9183.result new file mode 100644 index 00000000000..c0e5323d6d7 --- /dev/null +++ b/mysql-test/r/mysqld_help_crash-9183.result @@ -0,0 +1,3 @@ +rename table mysql.plugin to test.plugin; +flush tables; +rename table test.plugin to mysql.plugin; diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index bcf099a9a46..3646618cb1d 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -5320,6 +5320,33 @@ OR mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...] OR mysqldump [OPTIONS] --all-databases [OPTIONS] For more options, use mysqldump --help # +# MDEV-9001 - [PATCH] Fix DB name quoting in mysqldump --routine +# +CREATE DATABASE `a\"'``b`; +USE `a\"'``b`; +CREATE PROCEDURE p1() BEGIN END; +ALTER DATABASE `a\"'``b` COLLATE utf8_general_ci; +ALTER DATABASE `a\"'``b` CHARACTER SET latin1 COLLATE latin1_swedish_ci ; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() +BEGIN END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +ALTER DATABASE `a\"'``b` CHARACTER SET utf8 COLLATE utf8_general_ci ; +DROP DATABASE `a\"'``b`; +use test; +# # Test mysqldump with --disable-query-logs # create table t1 (a int); diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index a7fb28c988a..a0e44f91d44 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -2100,6 +2100,19 @@ count(*) 40960 drop table t1; set names default; +create table t2 (a int, b int, c int, d int, key x(a, b)); +insert into t2 values (2, 2, 2, 2), (3, 3, 3, 3), (4, 4, 4, 4), (5, 5, 5, 5), +(6, 6, 6, 6), (7, 7, 7, 7), (8, 8, 8, 8), (9, 9, 9, 9); +insert into t2 select * from t2; +insert into t2 values (0, 0, 0, 0), (1, 1, 1, 1); +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select a, b from t2 where (a, b) in ((0, 0), (1, 1)); +a b +0 0 +1 1 +drop table t2; # # BUG#13731380: RANGE OPTIMIZER CALLS RECORDS_IN_RANGE() FOR OPEN RANGE # diff --git a/mysql-test/r/range_mrr_icp.result b/mysql-test/r/range_mrr_icp.result index 54dd3008c7a..c16d3b4adae 100644 --- a/mysql-test/r/range_mrr_icp.result +++ b/mysql-test/r/range_mrr_icp.result @@ -2102,6 +2102,19 @@ count(*) 40960 drop table t1; set names default; +create table t2 (a int, b int, c int, d int, key x(a, b)); +insert into t2 values (2, 2, 2, 2), (3, 3, 3, 3), (4, 4, 4, 4), (5, 5, 5, 5), +(6, 6, 6, 6), (7, 7, 7, 7), (8, 8, 8, 8), (9, 9, 9, 9); +insert into t2 select * from t2; +insert into t2 values (0, 0, 0, 0), (1, 1, 1, 1); +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select a, b from t2 where (a, b) in ((0, 0), (1, 1)); +a b +0 0 +1 1 +drop table t2; # # BUG#13731380: RANGE OPTIMIZER CALLS RECORDS_IN_RANGE() FOR OPEN RANGE # diff --git a/mysql-test/r/show_row_order-9226.result b/mysql-test/r/show_row_order-9226.result new file mode 100644 index 00000000000..b8c8de647ef --- /dev/null +++ b/mysql-test/r/show_row_order-9226.result @@ -0,0 +1,80 @@ +create table test_table ( +column_number_1 enum('1','2') not null, +column_number_2 enum('1','2','3','4','5','6','7','8','9','10','11','12') not null, +column_number_3 varchar(10) not null, +column_number_4 varchar(10) not null, +column_number_5 enum( +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa01', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa02', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa03', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa04', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa05', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa06', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa07', +'aaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa46', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa47', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa48', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa49', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa50', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa51', +'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa52' + ) not null, +column_number_6 enum('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','78','79','80','81','82','83','84','85','86','87','88','89','90','91','92','93','94','95','96','97','98','99','100','101','102','103','104','105','106','107','108','109','110','111','112','113','114','115','116','117','118','119','120','121','122','123','124','125','126','127','128','129','130','131') not null, +column_number_7 enum('1','2','3','4','5','6','7') not null, +column_number_8 enum('8') not null, +column_number_9 enum('9') not null, +column_number_10 varchar(10) not null, +column_number_11 enum('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49') not null +) default charset=utf8mb4; +show columns from test_table; +Field Type Null Key Default Extra +column_number_1 enum('1','2') NO NULL +column_number_2 enum('1','2','3','4','5','6','7','8','9','10','11','12') NO NULL +column_number_3 varchar(10) NO NULL +column_number_4 varchar(10) NO NULL +column_number_5 enum('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa01','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa02','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa03','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa04','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa05','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa06','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa07','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa08','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa09','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa10','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa11','aaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa51','aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa52') NO NULL +column_number_6 enum('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','78','79','80','81','82','83','84','85','86','87','88','89','90','91','92','93','94','95','96','97','98','99','100','101','102','103','104','105','106','107','108','109','110','111','112','113','114','115','116','117','118','119','120','121','122','123','124','125','126','127','128','129','130','131') NO NULL +column_number_7 enum('1','2','3','4','5','6','7') NO NULL +column_number_8 enum('8') NO NULL +column_number_9 enum('9') NO NULL +column_number_10 varchar(10) NO NULL +column_number_11 enum('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49') NO NULL +drop table test_table; diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index c1780819c68..86219875bed 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -214,12 +214,14 @@ end if; end| insert into t3 values (1); insert into t1 values (4, "four", 1), (5, "five", 2); -ERROR 23000: Column 'id' cannot be null +Warnings: +Warning 1048 Column 'id' cannot be null select * from t1; id data fk 1 one NULL 2 two NULL 4 four 1 +0 five 2 select * from t2; event INSERT INTO t1 id=1 data='one' diff --git a/mysql-test/r/trigger_null-8605.result b/mysql-test/r/trigger_null-8605.result new file mode 100644 index 00000000000..79627eac455 --- /dev/null +++ b/mysql-test/r/trigger_null-8605.result @@ -0,0 +1,311 @@ +set sql_mode=strict_all_tables; +set time_zone="+02:00"; +create table t1 (a int not null, b int, c int); +create trigger trgi before insert on t1 for each row set new.a=if(new.a is null,new.b,new.c); +insert t1 values (10, NULL, 1); +insert t1 values (NULL, 2, NULL); +insert t1 values (NULL, NULL, 20); +ERROR 23000: Column 'a' cannot be null +insert t1 values (1, 2, NULL); +ERROR 23000: Column 'a' cannot be null +select * from t1; +a b c +1 NULL 1 +2 2 NULL +insert ignore t1 values (NULL, NULL, 30); +Warnings: +Warning 1048 Column 'a' cannot be null +insert ignore t1 values (1, 3, NULL); +Warnings: +Warning 1048 Column 'a' cannot be null +select * from t1; +a b c +1 NULL 1 +2 2 NULL +0 NULL 30 +0 3 NULL +insert t1 set a=NULL, b=4, c=a; +select * from t1; +a b c +1 NULL 1 +2 2 NULL +0 NULL 30 +0 3 NULL +4 4 NULL +delete from t1; +insert t1 (a,c) values (10, 1); +insert t1 (a,b) values (NULL, 2); +insert t1 (a,c) values (NULL, 20); +ERROR 23000: Column 'a' cannot be null +insert t1 (a,b) values (1, 2); +ERROR 23000: Column 'a' cannot be null +select * from t1; +a b c +1 NULL 1 +2 2 NULL +delete from t1; +insert t1 select 10, NULL, 1; +insert t1 select NULL, 2, NULL; +insert t1 select NULL, NULL, 20; +ERROR 23000: Column 'a' cannot be null +insert t1 select 1, 2, NULL; +ERROR 23000: Column 'a' cannot be null +insert ignore t1 select NULL, NULL, 30; +Warnings: +Warning 1048 Column 'a' cannot be null +insert ignore t1 select 1, 3, NULL; +Warnings: +Warning 1048 Column 'a' cannot be null +select * from t1; +a b c +1 NULL 1 +2 2 NULL +0 NULL 30 +0 3 NULL +delete from t1; +insert delayed t1 values (10, NULL, 1); +insert delayed t1 values (NULL, 2, NULL); +insert delayed t1 values (NULL, NULL, 20); +ERROR 23000: Column 'a' cannot be null +insert delayed t1 values (1, 2, NULL); +ERROR 23000: Column 'a' cannot be null +select * from t1; +a b c +1 NULL 1 +2 2 NULL +insert delayed ignore t1 values (NULL, NULL, 30); +Warnings: +Warning 1048 Column 'a' cannot be null +insert delayed ignore t1 values (1, 3, NULL); +Warnings: +Warning 1048 Column 'a' cannot be null +flush table t1; +select * from t1; +a b c +1 NULL 1 +2 2 NULL +0 NULL 30 +0 3 NULL +delete from t1; +alter table t1 add primary key (a); +create trigger trgu before update on t1 for each row set new.a=if(new.a is null,new.b,new.c); +insert t1 values (100,100,100), (200,200,200), (300,300,300); +insert t1 values (100,100,100) on duplicate key update a=10, b=NULL, c=1; +insert t1 values (200,200,200) on duplicate key update a=NULL, b=2, c=NULL; +insert t1 values (300,300,300) on duplicate key update a=NULL, b=NULL, c=20; +ERROR 23000: Column 'a' cannot be null +insert t1 values (300,300,300) on duplicate key update a=1, b=2, c=NULL; +ERROR 23000: Column 'a' cannot be null +select * from t1; +a b c +1 NULL 1 +2 2 NULL +300 300 300 +delete from t1; +insert t1 values (1,100,1), (2,200,2); +replace t1 values (10, NULL, 1); +replace t1 values (NULL, 2, NULL); +replace t1 values (NULL, NULL, 30); +ERROR 23000: Column 'a' cannot be null +replace t1 values (1, 3, NULL); +ERROR 23000: Column 'a' cannot be null +select * from t1; +a b c +1 NULL 1 +2 2 NULL +delete from t1; +insert t1 values (100,100,100), (200,200,200), (300,300,300); +update t1 set a=10, b=NULL, c=1 where a=100; +update t1 set a=NULL, b=2, c=NULL where a=200; +update t1 set a=NULL, b=NULL, c=20 where a=300; +ERROR 23000: Column 'a' cannot be null +update t1 set a=1, b=2, c=NULL where a=300; +ERROR 23000: Column 'a' cannot be null +select * from t1; +a b c +1 NULL 1 +2 2 NULL +300 300 300 +set statement sql_mode='' for update t1 set a=1, b=2, c=NULL where a > 1; +ERROR 23000: Duplicate entry '0' for key 'PRIMARY' +select * from t1; +a b c +1 NULL 1 +0 2 NULL +300 300 300 +update t1 set a=NULL, b=4, c=a where a=300; +select * from t1; +a b c +1 NULL 1 +0 2 NULL +4 4 NULL +delete from t1; +create table t2 (d int, e int); +insert t1 values (100,100,100), (200,200,200), (300,300,300); +insert t2 select a,b from t1; +update t1,t2 set a=10, b=NULL, c=1 where b=d and e=100; +update t1,t2 set a=NULL, b=2, c=NULL where b=d and e=200; +update t1,t2 set a=NULL, b=NULL, c=20 where b=d and e=300; +ERROR 23000: Column 'a' cannot be null +update t1,t2 set a=1, b=2, c=NULL where b=d and e=300; +ERROR 23000: Column 'a' cannot be null +select * from t1; +a b c +1 NULL 1 +2 2 NULL +300 300 300 +update t1,t2 set a=NULL, b=4, c=a where b=d and e=300; +select * from t1; +a b c +1 NULL 1 +2 2 NULL +4 4 300 +delete from t1; +insert t2 values (2,2); +create view v1 as select * from t1, t2 where d=2; +insert v1 (a,c) values (10, 1); +insert v1 (a,b) values (NULL, 2); +insert v1 (a,c) values (NULL, 20); +ERROR 23000: Column 'a' cannot be null +insert v1 (a,b) values (1, 2); +ERROR 23000: Column 'a' cannot be null +select * from v1; +a b c d e +1 NULL 1 2 2 +2 2 NULL 2 2 +delete from t1; +drop view v1; +drop table t2; +load data infile 'mdev8605.txt' into table t1 fields terminated by ','; +ERROR 23000: Column 'a' cannot be null +select * from t1; +a b c +1 NULL 1 +2 2 NULL +drop table t1; +create table t1 (a timestamp, b int auto_increment primary key); +create trigger trgi before insert on t1 for each row set new.a=if(new.a is null, '2000-10-20 10:20:30', NULL); +set statement timestamp=777777777 for insert t1 (a) values (NULL); +set statement timestamp=888888888 for insert t1 (a) values ('1999-12-11 10:9:8'); +select b, a, unix_timestamp(a) from t1; +b a unix_timestamp(a) +1 2000-10-20 10:20:30 972030030 +2 1998-03-03 03:34:48 888888888 +set statement timestamp=999999999 for update t1 set b=3 where b=2; +select b, a, unix_timestamp(a) from t1; +b a unix_timestamp(a) +1 2000-10-20 10:20:30 972030030 +3 2001-09-09 03:46:39 999999999 +create trigger trgu before update on t1 for each row set new.a='2011-11-11 11:11:11'; +update t1 set b=4 where b=3; +select b, a, unix_timestamp(a) from t1; +b a unix_timestamp(a) +1 2000-10-20 10:20:30 972030030 +4 2011-11-11 11:11:11 1321002671 +drop table t1; +create table t1 (a int auto_increment primary key); +create trigger trgi before insert on t1 for each row set new.a=if(new.a is null, 5, NULL); +insert t1 values (NULL); +insert t1 values (10); +select a from t1; +a +5 +6 +drop table t1; +create table t1 (a int, b int, c int); +create trigger trgi before insert on t1 for each row set new.a=if(new.a is null,new.b,new.c); +insert t1 values (10, NULL, 1); +insert t1 values (NULL, 2, NULL); +insert t1 values (NULL, NULL, 20); +insert t1 values (1, 2, NULL); +select * from t1; +a b c +1 NULL 1 +2 2 NULL +NULL NULL 20 +NULL 2 NULL +drop table t1; +create table t1 (a1 tinyint not null, a2 timestamp not null, +a3 tinyint not null auto_increment primary key, +b tinyint, c int not null); +create trigger trgi before insert on t1 for each row +begin +if new.b=1 then set new.a1=if(new.c,new.c,null); end if; +if new.b=2 then set new.a2=if(new.c,new.c,null); end if; +if new.b=3 then set new.a3=if(new.c,new.c,null); end if; +end| +set statement timestamp=777777777 for +load data infile 'sep8605.txt' into table t1 fields terminated by ','; +ERROR 23000: Column 'a1' cannot be null +select * from t1; +a1 a2 a3 b c +1 2010-11-12 01:02:03 10 0 0 +2 2010-11-12 01:02:03 11 1 2 +3 1994-08-25 03:22:57 12 0 0 +4 2000-09-08 07:06:05 13 2 908070605 +5 1994-08-25 03:22:57 14 2 0 +6 2010-11-12 01:02:03 15 0 0 +7 2010-11-12 01:02:03 20 3 20 +8 2010-11-12 01:02:03 21 3 0 +delete from t1; +set statement timestamp=777777777 for +load data infile 'sep8605.txt' into table t1 fields terminated by ',' + (@a,a2,a3,b,c) set a1=100-@a; +ERROR 23000: Column 'a1' cannot be null +select 100-a1,a2,a3,b,c from t1; +100-a1 a2 a3 b c +1 2010-11-12 01:02:03 10 0 0 +98 2010-11-12 01:02:03 11 1 2 +3 1994-08-25 03:22:57 12 0 0 +4 2000-09-08 07:06:05 13 2 908070605 +5 1994-08-25 03:22:57 14 2 0 +6 2010-11-12 01:02:03 22 0 0 +7 2010-11-12 01:02:03 20 3 20 +8 2010-11-12 01:02:03 23 3 0 +delete from t1; +set statement timestamp=777777777 for +load data infile 'fix8605.txt' into table t1 fields terminated by ''; +ERROR 23000: Column 'a1' cannot be null +select * from t1; +a1 a2 a3 b c +1 2010-11-12 01:02:03 10 0 0 +5 1994-08-25 03:22:57 14 2 0 +8 2010-11-12 01:02:03 24 3 0 +delete from t1; +set statement timestamp=777777777 for +load xml infile 'xml8605.txt' into table t1 rows identified by '<row>'; +ERROR 23000: Column 'a1' cannot be null +select * from t1; +a1 a2 a3 b c +1 2010-11-12 01:02:03 10 0 0 +2 2010-11-12 01:02:03 11 1 2 +3 1994-08-25 03:22:57 12 0 0 +4 2000-09-08 07:06:05 13 2 908070605 +5 1994-08-25 03:22:57 14 2 0 +6 2010-11-12 01:02:03 25 0 0 +7 2010-11-12 01:02:03 20 3 20 +8 2010-11-12 01:02:03 26 3 0 +drop table t1; +create table t1 (a int not null default 5, b int, c int); +create trigger trgi before insert on t1 for each row set new.b=new.c; +insert t1 values (DEFAULT,2,1); +select * from t1; +a b c +5 1 1 +drop table t1; +create table t1 (a int not null, b int not null default 5, c int); +create trigger trgi before insert on t1 for each row +begin +if new.c=1 then set new.a=1, new.b=1; end if; +if new.c=2 then set new.a=NULL, new.b=NULL; end if; +if new.c=3 then set new.a=2; end if; +end| +insert t1 values (9, 9, 1); +insert t1 values (9, 9, 2); +ERROR 23000: Column 'a' cannot be null +insert t1 (a,c) values (9, 3); +select * from t1; +a b c +1 1 1 +2 5 3 +drop table t1; diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 6a09df409da..132de86e27b 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -1002,9 +1002,42 @@ COUNT(*) DROP FUNCTION f1; DROP TABLE t1; End of 5.1 tests +# +# Start of 5.5 tests +# CREATE TABLE t1 ( f1 blob, f2 blob ); INSERT INTO t1 VALUES ('',''); SELECT f1,f2,"found row" FROM t1 WHERE f1 = f2 ; f1 f2 found row found row DROP TABLE t1; +# +# MDEV-9319 ALTER from a bigger to a smaller blob type truncates too much data +# +CREATE TABLE t1 (a MEDIUMBLOB); +INSERT INTO t1 VALUES (REPEAT(0x61,128000)); +SELECT LENGTH(a) FROM t1; +LENGTH(a) +128000 +ALTER TABLE t1 MODIFY a BLOB; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +SELECT LENGTH(a) FROM t1; +LENGTH(a) +65535 +DROP TABLE t1; +CREATE TABLE t1 (a BLOB); +INSERT INTO t1 VALUES (REPEAT(0x61,65000)); +SELECT LENGTH(a) FROM t1; +LENGTH(a) +65000 +ALTER TABLE t1 MODIFY a TINYBLOB; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +SELECT LENGTH(a) FROM t1; +LENGTH(a) +255 +DROP TABLE t1; +# +# End of 5.5 tests +# diff --git a/mysql-test/r/udf_notembedded.result b/mysql-test/r/udf_notembedded.result new file mode 100644 index 00000000000..3fdcdbbe9d3 --- /dev/null +++ b/mysql-test/r/udf_notembedded.result @@ -0,0 +1,6 @@ +create function sequence returns integer soname "UDF_EXAMPLE_LIB"; +create table t1 (n int key not null auto_increment, msg int as (sequence()) virtual); +select * from t1; +n msg +drop table t1; +drop function sequence; |