diff options
author | Alexander Barkov <bar@mariadb.com> | 2022-08-02 16:23:08 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2022-08-05 22:23:40 +0400 |
commit | 3ebbfd88a0360938e3a5a480265beb2a71b1268a (patch) | |
tree | 2168fd64b64e21aa391746019414055b326fb0b8 /plugin | |
parent | 97d16c7544c40430facda441dab89fa4b23468a0 (diff) | |
download | mariadb-git-3ebbfd88a0360938e3a5a480265beb2a71b1268a.tar.gz |
MDEV-29159 Patch for MDEV-28918 introduces more inconsistency than it solves, breaks usability
1. Store assignment failures on incompatible data types now raise errors if:
- STRICT_ALL_TABLES or STRICT_TRANS_TABLES sql_mode is used, and
- IGNORE is not used
Otherwise, only a warning is raised and the statement continues.
2. Changing the error/warning test as follows:
-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `db`.`t`.`col`
so in case of a big table it's easier to see which column has the problem.
The new error text is also applied to SP variables.
Diffstat (limited to 'plugin')
16 files changed, 1413 insertions, 465 deletions
diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6.result b/plugin/type_inet/mysql-test/type_inet/type_inet6.result index 570655a972b..cfb9189ea28 100644 --- a/plugin/type_inet/mysql-test/type_inet/type_inet6.result +++ b/plugin/type_inet/mysql-test/type_inet/type_inet6.result @@ -192,9 +192,9 @@ CREATE TABLE t1 (a INET6); INSERT INTO t1 VALUES ('x'); ERROR 22007: Incorrect inet6 value: 'x' for column `test`.`t1`.`a` at row 1 INSERT INTO t1 VALUES (1); -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t1`.`a` INSERT INTO t1 VALUES (TIME'10:20:30'); -ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t1`.`a` INSERT INTO t1 VALUES (0x00); ERROR 22007: Incorrect inet6 value: '\x00' for column `test`.`t1`.`a` at row 1 DROP TABLE t1; @@ -820,15 +820,15 @@ DROP TABLE t1; # CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (CAST('::' AS INET6)); -ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t1`.`a` DROP TABLE t1; CREATE TABLE t1 (a DOUBLE); INSERT INTO t1 VALUES (CAST('::' AS INET6)); -ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t1`.`a` DROP TABLE t1; CREATE TABLE t1 (a DECIMAL(32,0)); INSERT INTO t1 VALUES (CAST('::' AS INET6)); -ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t1`.`a` DROP TABLE t1; CREATE TABLE t1 (a VARCHAR(64)); INSERT INTO t1 VALUES (CAST('::' AS INET6)); @@ -1606,7 +1606,7 @@ DROP TABLE t1; CREATE TABLE t1 (a INET6, b INT); INSERT INTO t1 VALUES ('ffff::ffff', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -1614,7 +1614,7 @@ DROP TABLE t1; CREATE TABLE t1 (a INET6, b DOUBLE); INSERT INTO t1 VALUES ('ffff::ffff', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -1622,7 +1622,7 @@ DROP TABLE t1; CREATE TABLE t1 (a INET6, b DECIMAL(32,0)); INSERT INTO t1 VALUES ('ffff::ffff', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -1630,7 +1630,7 @@ DROP TABLE t1; CREATE TABLE t1 (a INET6, b YEAR); INSERT INTO t1 VALUES ('ffff::ffff', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types year and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'year' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -1641,7 +1641,7 @@ DROP TABLE t1; CREATE TABLE t1 (a INT, b INET6); INSERT INTO t1 VALUES (1, NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -1649,7 +1649,7 @@ DROP TABLE t1; CREATE TABLE t1 (a DOUBLE, b INET6); INSERT INTO t1 VALUES (1, NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -1657,7 +1657,7 @@ DROP TABLE t1; CREATE TABLE t1 (a DECIMAL(32,0), b INET6); INSERT INTO t1 VALUES (1, NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -1665,7 +1665,7 @@ DROP TABLE t1; CREATE TABLE t1 (a YEAR, b INET6); INSERT INTO t1 VALUES (1, NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types inet6 and year for operation 'SET' +ERROR HY000: Cannot cast 'year' as 'inet6' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -1676,7 +1676,7 @@ DROP TABLE t1; CREATE TABLE t1 (a INET6, b TIME); INSERT INTO t1 VALUES ('ffff::ffff', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -1684,7 +1684,7 @@ DROP TABLE t1; CREATE TABLE t1 (a INET6, b DATE); INSERT INTO t1 VALUES ('ffff::ffff', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types date and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'date' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -1692,7 +1692,7 @@ DROP TABLE t1; CREATE TABLE t1 (a INET6, b DATETIME); INSERT INTO t1 VALUES ('ffff::ffff', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types datetime and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'datetime' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -1700,7 +1700,7 @@ DROP TABLE t1; CREATE TABLE t1 (a INET6, b TIMESTAMP NULL DEFAULT NULL); INSERT INTO t1 VALUES ('ffff::ffff', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types timestamp and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'timestamp' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -1711,7 +1711,7 @@ DROP TABLE t1; CREATE TABLE t1 (a TIME, b INET6); INSERT INTO t1 VALUES ('00:00:00', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -1719,7 +1719,7 @@ DROP TABLE t1; CREATE TABLE t1 (a DATE, b INET6); INSERT INTO t1 VALUES ('2001-01:01', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types inet6 and date for operation 'SET' +ERROR HY000: Cannot cast 'date' as 'inet6' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -1727,7 +1727,7 @@ DROP TABLE t1; CREATE TABLE t1 (a DATETIME, b INET6); INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types inet6 and datetime for operation 'SET' +ERROR HY000: Cannot cast 'datetime' as 'inet6' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -1735,7 +1735,7 @@ DROP TABLE t1; CREATE TABLE t1 (a TIMESTAMP, b INET6); INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types inet6 and timestamp for operation 'SET' +ERROR HY000: Cannot cast 'timestamp' as 'inet6' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -1922,7 +1922,7 @@ DROP TABLE t1; CREATE TABLE t1 (a INET6, b INT); INSERT INTO t1 (a) VALUES ('::'); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t1`.`b` SELECT * FROM t1; a b :: NULL @@ -1931,7 +1931,7 @@ SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30'); CREATE TABLE t1 (a INET6, b TIMESTAMP); INSERT INTO t1 (a) VALUES ('::'); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types timestamp and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'timestamp' in assignment of `test`.`t1`.`b` SELECT * FROM t1; a b :: 2001-01-01 10:20:30 @@ -1940,7 +1940,7 @@ SET timestamp=DEFAULT; CREATE OR REPLACE TABLE t1 (a INET6); INSERT INTO t1 (a) VALUES ('::'); ALTER TABLE t1 MODIFY a DATE; -ERROR HY000: Illegal parameter data types date and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'date' in assignment of `test`.`t1`.`a` DROP TABLE t1; # # MDEV-20818 ER_CRASHED_ON_USAGE or Assertion `length <= column->length' failed in write_block_record on temporary table diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_decimal.result b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_decimal.result index 024b9d012be..230b19f5a42 100644 --- a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_decimal.result +++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_decimal.result @@ -6,6 +6,7 @@ # CREATE TABLE t1 (target INET6 DEFAULT '::0', source DECIMAL(38,0) DEFAULT 0); # Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='source' AND TABLE_NAME='t1' @@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='target' AND TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; CREATE TABLE t2 LIKE t1; ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); @@ -30,7 +35,7 @@ INSERT INTO t3 VALUES (1, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t3`.`target` DROP TABLE t3; SET sql_mode=''; CREATE TABLE t3 LIKE t2; @@ -62,37 +67,37 @@ INSERT INTO t3 VALUES (2, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -Got one of the listed errors +ERROR 22007: Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 2 SELECT * FROM v3; id target source 1 :: 0 TRUNCATE TABLE t3; -SET sql_mode=DEFAULT; +SET sql_mode=@sql_mode_save; DROP TABLE t3; DROP VIEW v3; CREATE TABLE t3 LIKE t2; INSERT INTO t3 SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t3`.`target` UPDATE t3 SET target=source; -ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t3`.`target` UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; -ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET' -SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type); +ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t3`.`target` +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); SELECT @alter; @alter ALTER TABLE t3 MODIFY target decimal(38,0) EXECUTE IMMEDIATE @alter; -ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t3`.`target` DROP TABLE t3; DROP TABLE t2; CREATE PROCEDURE p1() @@ -103,15 +108,15 @@ SET dst=src; END; $$ CALL p1; -ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `dst` DROP PROCEDURE p1; CREATE FUNCTION f1(a inet6) RETURNS INT RETURN NULL;; SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `a` DROP FUNCTION f1; CREATE PROCEDURE p1(a inet6) BEGIN END;; CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `a` DROP PROCEDURE p1; CREATE PROCEDURE p1(OUT dst inet6) BEGIN @@ -126,10 +131,10 @@ CALL p1(dst); END; $$ CALL p2(); -ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `dst` SHOW WARNINGS; Level Code Message -Error 4078 Illegal parameter data types inet6 and decimal for operation 'SET' +Error 4078 Cannot cast 'decimal' as 'inet6' in assignment of `dst` Note 4094 At line 4 in test.p1 Note 4094 At line 4 in test.p2 DROP PROCEDURE p2; @@ -141,7 +146,7 @@ RETURN rc; END; $$ SELECT f1(); -ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `f1()` DROP FUNCTION f1; CREATE PROCEDURE p1() BEGIN @@ -152,7 +157,7 @@ CLOSE cur1; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `t` DROP PROCEDURE p1; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (); @@ -166,13 +171,14 @@ CLOSE cur2; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `dst` DROP PROCEDURE p1; DROP TABLE t2; # End of type_store_assignment_incompatible.inc DROP TABLE t1; CREATE TABLE t1 (target DECIMAL(38,0) DEFAULT 0, source INET6 DEFAULT '::0'); # Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='source' AND TABLE_NAME='t1' @@ -181,6 +187,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='target' AND TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; CREATE TABLE t2 LIKE t1; ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); @@ -197,7 +207,7 @@ INSERT INTO t3 VALUES (1, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t3`.`target` DROP TABLE t3; SET sql_mode=''; CREATE TABLE t3 LIKE t2; @@ -229,37 +239,37 @@ INSERT INTO t3 VALUES (2, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -Got one of the listed errors +ERROR 22007: Incorrect decimal value: '::' for column `test`.`t3`.`target` at row 2 SELECT * FROM v3; id target source 1 0 :: TRUNCATE TABLE t3; -SET sql_mode=DEFAULT; +SET sql_mode=@sql_mode_save; DROP TABLE t3; DROP VIEW v3; CREATE TABLE t3 LIKE t2; INSERT INTO t3 SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t3`.`target` INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t3`.`target` INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t3`.`target` UPDATE t3 SET target=source; -ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t3`.`target` UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; -ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET' -SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type); +ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t3`.`target` +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); SELECT @alter; @alter ALTER TABLE t3 MODIFY target inet6 EXECUTE IMMEDIATE @alter; -ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t3`.`target` DROP TABLE t3; DROP TABLE t2; CREATE PROCEDURE p1() @@ -270,15 +280,15 @@ SET dst=src; END; $$ CALL p1; -ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `dst` DROP PROCEDURE p1; CREATE FUNCTION f1(a decimal(38,0)) RETURNS INT RETURN NULL;; SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `a` DROP FUNCTION f1; CREATE PROCEDURE p1(a decimal(38,0)) BEGIN END;; CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `a` DROP PROCEDURE p1; CREATE PROCEDURE p1(OUT dst decimal(38,0)) BEGIN @@ -293,10 +303,10 @@ CALL p1(dst); END; $$ CALL p2(); -ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `dst` SHOW WARNINGS; Level Code Message -Error 4078 Illegal parameter data types decimal and inet6 for operation 'SET' +Error 4078 Cannot cast 'inet6' as 'decimal' in assignment of `dst` Note 4094 At line 4 in test.p1 Note 4094 At line 4 in test.p2 DROP PROCEDURE p2; @@ -308,7 +318,7 @@ RETURN rc; END; $$ SELECT f1(); -ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `f1()` DROP FUNCTION f1; CREATE PROCEDURE p1() BEGIN @@ -319,7 +329,7 @@ CLOSE cur1; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `t` DROP PROCEDURE p1; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (); @@ -333,7 +343,7 @@ CLOSE cur2; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `dst` DROP PROCEDURE p1; DROP TABLE t2; # End of type_store_assignment_incompatible.inc diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double.result b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double.result index 41baf7b8ca3..f677e768a7d 100644 --- a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double.result +++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double.result @@ -6,6 +6,7 @@ # CREATE TABLE t1 (target INET6 DEFAULT '::0', source DOUBLE DEFAULT 0); # Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='source' AND TABLE_NAME='t1' @@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='target' AND TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; CREATE TABLE t2 LIKE t1; ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); @@ -30,7 +35,7 @@ INSERT INTO t3 VALUES (1, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` DROP TABLE t3; SET sql_mode=''; CREATE TABLE t3 LIKE t2; @@ -62,37 +67,37 @@ INSERT INTO t3 VALUES (2, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -Got one of the listed errors +ERROR 22007: Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 2 SELECT * FROM v3; id target source 1 :: 0 TRUNCATE TABLE t3; -SET sql_mode=DEFAULT; +SET sql_mode=@sql_mode_save; DROP TABLE t3; DROP VIEW v3; CREATE TABLE t3 LIKE t2; INSERT INTO t3 SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` UPDATE t3 SET target=source; -ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; -ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET' -SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type); +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); SELECT @alter; @alter ALTER TABLE t3 MODIFY target double EXECUTE IMMEDIATE @alter; -ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` DROP TABLE t3; DROP TABLE t2; CREATE PROCEDURE p1() @@ -103,15 +108,15 @@ SET dst=src; END; $$ CALL p1; -ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `dst` DROP PROCEDURE p1; CREATE FUNCTION f1(a inet6) RETURNS INT RETURN NULL;; SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `a` DROP FUNCTION f1; CREATE PROCEDURE p1(a inet6) BEGIN END;; CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `a` DROP PROCEDURE p1; CREATE PROCEDURE p1(OUT dst inet6) BEGIN @@ -126,10 +131,10 @@ CALL p1(dst); END; $$ CALL p2(); -ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `dst` SHOW WARNINGS; Level Code Message -Error 4078 Illegal parameter data types inet6 and double for operation 'SET' +Error 4078 Cannot cast 'double' as 'inet6' in assignment of `dst` Note 4094 At line 4 in test.p1 Note 4094 At line 4 in test.p2 DROP PROCEDURE p2; @@ -141,7 +146,7 @@ RETURN rc; END; $$ SELECT f1(); -ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `f1()` DROP FUNCTION f1; CREATE PROCEDURE p1() BEGIN @@ -152,7 +157,7 @@ CLOSE cur1; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `t` DROP PROCEDURE p1; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (); @@ -166,13 +171,14 @@ CLOSE cur2; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `dst` DROP PROCEDURE p1; DROP TABLE t2; # End of type_store_assignment_incompatible.inc DROP TABLE t1; CREATE TABLE t1 (target DOUBLE DEFAULT 0, source INET6 DEFAULT '::0'); # Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='source' AND TABLE_NAME='t1' @@ -181,6 +187,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='target' AND TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; CREATE TABLE t2 LIKE t1; ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); @@ -197,7 +207,7 @@ INSERT INTO t3 VALUES (1, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` DROP TABLE t3; SET sql_mode=''; CREATE TABLE t3 LIKE t2; @@ -229,37 +239,37 @@ INSERT INTO t3 VALUES (2, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -Got one of the listed errors +ERROR 22007: Incorrect double value: '::' for column `test`.`t3`.`target` at row 2 SELECT * FROM v3; id target source 1 0 :: TRUNCATE TABLE t3; -SET sql_mode=DEFAULT; +SET sql_mode=@sql_mode_save; DROP TABLE t3; DROP VIEW v3; CREATE TABLE t3 LIKE t2; INSERT INTO t3 SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` UPDATE t3 SET target=source; -ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; -ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET' -SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type); +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); SELECT @alter; @alter ALTER TABLE t3 MODIFY target inet6 EXECUTE IMMEDIATE @alter; -ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` DROP TABLE t3; DROP TABLE t2; CREATE PROCEDURE p1() @@ -270,15 +280,15 @@ SET dst=src; END; $$ CALL p1; -ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `dst` DROP PROCEDURE p1; CREATE FUNCTION f1(a double) RETURNS INT RETURN NULL;; SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `a` DROP FUNCTION f1; CREATE PROCEDURE p1(a double) BEGIN END;; CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `a` DROP PROCEDURE p1; CREATE PROCEDURE p1(OUT dst double) BEGIN @@ -293,10 +303,10 @@ CALL p1(dst); END; $$ CALL p2(); -ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `dst` SHOW WARNINGS; Level Code Message -Error 4078 Illegal parameter data types double and inet6 for operation 'SET' +Error 4078 Cannot cast 'inet6' as 'double' in assignment of `dst` Note 4094 At line 4 in test.p1 Note 4094 At line 4 in test.p2 DROP PROCEDURE p2; @@ -308,7 +318,7 @@ RETURN rc; END; $$ SELECT f1(); -ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `f1()` DROP FUNCTION f1; CREATE PROCEDURE p1() BEGIN @@ -319,7 +329,7 @@ CLOSE cur1; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `t` DROP PROCEDURE p1; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (); @@ -333,7 +343,7 @@ CLOSE cur2; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `dst` DROP PROCEDURE p1; DROP TABLE t2; # End of type_store_assignment_incompatible.inc diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_loose.result b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_loose.result new file mode 100644 index 00000000000..e624b95b980 --- /dev/null +++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_loose.result @@ -0,0 +1,406 @@ +# +# Start of 10.7 tests +# +# +# MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER +# +SET sql_mode=''; +CREATE TABLE t1 (target INET6 DEFAULT '::0', source DOUBLE DEFAULT 0); +# Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; +SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS +WHERE COLUMN_NAME='source' + AND TABLE_NAME='t1' + AND TABLE_SCHEMA='test'); +SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS +WHERE COLUMN_NAME='target' + AND TABLE_NAME='t1' + AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; +CREATE TABLE t2 LIKE t1; +ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; +INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL, + `target` inet6 DEFAULT '::', + `source` double DEFAULT 0, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +CREATE TABLE t3 LIKE t2; +INSERT INTO t3 VALUES +(1, +(SELECT source FROM t2 ORDER BY id LIMIT 1), +(SELECT source FROM t2 ORDER BY id LIMIT 1)); +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1 +DROP TABLE t3; +SET sql_mode=''; +CREATE TABLE t3 LIKE t2; +ALTER TABLE t3 ENGINE=MyISAM; +EXECUTE IMMEDIATE +CONCAT('CREATE VIEW v3 AS SELECT id,', +IF(@target_type='geometry','AsText(target)','target'), ' AS target,', +IF(@source_type='geometry','AsText(source)','source'), ' AS source ', +' FROM t3'); +INSERT INTO t3 VALUES +(1, +(SELECT target FROM t2 ORDER BY id LIMIT 1), +(SELECT source FROM t2 ORDER BY id LIMIT 1)), +(2, +(SELECT source FROM t2 ORDER BY id LIMIT 1), +(SELECT source FROM t2 ORDER BY id LIMIT 1)); +Warnings: +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 2 +SELECT * FROM v3; +id target source +1 :: 0 +2 :: 0 +TRUNCATE TABLE t3; +SET sql_mode=STRICT_ALL_TABLES; +INSERT INTO t3 VALUES +(1, +(SELECT target FROM t2 ORDER BY id LIMIT 1), +(SELECT source FROM t2 ORDER BY id LIMIT 1)), +(2, +(SELECT source FROM t2 ORDER BY id LIMIT 1), +(SELECT source FROM t2 ORDER BY id LIMIT 1)); +ERROR 22007: Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 2 +SELECT * FROM v3; +id target source +1 :: 0 +TRUNCATE TABLE t3; +SET sql_mode=@sql_mode_save; +DROP TABLE t3; +DROP VIEW v3; +CREATE TABLE t3 LIKE t2; +INSERT INTO t3 SELECT id,source,source FROM t2; +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1 +INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1 +INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1 +INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1 +INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1 +UPDATE t3 SET target=source; +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1 +UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` +Warning 1292 Incorrect inet6 value: '0' for column ``.`(temporary)`.`target` at row 1 +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); +SELECT @alter; +@alter +ALTER TABLE t3 MODIFY target double +EXECUTE IMMEDIATE @alter; +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` +Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1 +DROP TABLE t3; +DROP TABLE t2; +CREATE PROCEDURE p1() +BEGIN +DECLARE src double DEFAULT NULL; +DECLARE dst inet6 DEFAULT NULL; +SET dst=src; +END; +$$ +CALL p1; +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `dst` +DROP PROCEDURE p1; +CREATE FUNCTION f1(a inet6) RETURNS INT RETURN NULL;; +SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); +f1((SELECT source FROM t1 ORDER BY source LIMIT 1)) +NULL +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `a` +DROP FUNCTION f1; +CREATE PROCEDURE p1(a inet6) BEGIN END;; +CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `a` +DROP PROCEDURE p1; +CREATE PROCEDURE p1(OUT dst inet6) +BEGIN +DECLARE src double DEFAULT NULL; +SET dst=src; +END; +$$ +CREATE PROCEDURE p2() +BEGIN +DECLARE dst inet6 DEFAULT NULL; +CALL p1(dst); +END; +$$ +CALL p2(); +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `dst` +SHOW WARNINGS; +Level Code Message +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `dst` +DROP PROCEDURE p2; +DROP PROCEDURE p1; +CREATE FUNCTION f1() RETURNS inet6 +BEGIN +DECLARE rc double DEFAULT NULL; +RETURN rc; +END; +$$ +SELECT f1(); +f1() +NULL +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `f1()` +DROP FUNCTION f1; +CREATE PROCEDURE p1() +BEGIN +DECLARE src double DEFAULT NULL; +DECLARE cur1 CURSOR(t inet6) FOR SELECT * FROM t1 WHERE target=t; +OPEN cur1(src); +CLOSE cur1; +END; +$$ +CALL p1(); +DROP PROCEDURE p1; +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES (); +CREATE PROCEDURE p1() +BEGIN +DECLARE dst inet6 DEFAULT NULL; +DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1; +OPEN cur2; +FETCH cur2 INTO dst; +CLOSE cur2; +END; +$$ +CALL p1(); +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `dst` +Warning 1292 Incorrect inet6 value: '0' for column ``.``.`dst` at row 1 +DROP PROCEDURE p1; +DROP TABLE t2; +# End of type_store_assignment_incompatible.inc +DROP TABLE t1; +CREATE TABLE t1 (target DOUBLE DEFAULT 0, source INET6 DEFAULT '::0'); +# Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; +SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS +WHERE COLUMN_NAME='source' + AND TABLE_NAME='t1' + AND TABLE_SCHEMA='test'); +SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS +WHERE COLUMN_NAME='target' + AND TABLE_NAME='t1' + AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; +CREATE TABLE t2 LIKE t1; +ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; +INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL, + `target` double DEFAULT 0, + `source` inet6 DEFAULT '::', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +CREATE TABLE t3 LIKE t2; +INSERT INTO t3 VALUES +(1, +(SELECT source FROM t2 ORDER BY id LIMIT 1), +(SELECT source FROM t2 ORDER BY id LIMIT 1)); +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` +Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1 +DROP TABLE t3; +SET sql_mode=''; +CREATE TABLE t3 LIKE t2; +ALTER TABLE t3 ENGINE=MyISAM; +EXECUTE IMMEDIATE +CONCAT('CREATE VIEW v3 AS SELECT id,', +IF(@target_type='geometry','AsText(target)','target'), ' AS target,', +IF(@source_type='geometry','AsText(source)','source'), ' AS source ', +' FROM t3'); +INSERT INTO t3 VALUES +(1, +(SELECT target FROM t2 ORDER BY id LIMIT 1), +(SELECT source FROM t2 ORDER BY id LIMIT 1)), +(2, +(SELECT source FROM t2 ORDER BY id LIMIT 1), +(SELECT source FROM t2 ORDER BY id LIMIT 1)); +Warnings: +Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 2 +SELECT * FROM v3; +id target source +1 0 :: +2 0 :: +TRUNCATE TABLE t3; +SET sql_mode=STRICT_ALL_TABLES; +INSERT INTO t3 VALUES +(1, +(SELECT target FROM t2 ORDER BY id LIMIT 1), +(SELECT source FROM t2 ORDER BY id LIMIT 1)), +(2, +(SELECT source FROM t2 ORDER BY id LIMIT 1), +(SELECT source FROM t2 ORDER BY id LIMIT 1)); +ERROR 22007: Incorrect double value: '::' for column `test`.`t3`.`target` at row 2 +SELECT * FROM v3; +id target source +1 0 :: +TRUNCATE TABLE t3; +SET sql_mode=@sql_mode_save; +DROP TABLE t3; +DROP VIEW v3; +CREATE TABLE t3 LIKE t2; +INSERT INTO t3 SELECT id,source,source FROM t2; +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` +Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1 +INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` +Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1 +INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` +Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1 +INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` +Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1 +INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` +Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1 +UPDATE t3 SET target=source; +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` +Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1 +UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` +Warning 1366 Incorrect double value: '::' for column ``.`(temporary)`.`target` at row 1 +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); +SELECT @alter; +@alter +ALTER TABLE t3 MODIFY target inet6 +EXECUTE IMMEDIATE @alter; +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1 +DROP TABLE t3; +DROP TABLE t2; +CREATE PROCEDURE p1() +BEGIN +DECLARE src inet6 DEFAULT NULL; +DECLARE dst double DEFAULT NULL; +SET dst=src; +END; +$$ +CALL p1; +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `dst` +DROP PROCEDURE p1; +CREATE FUNCTION f1(a double) RETURNS INT RETURN NULL;; +SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); +f1((SELECT source FROM t1 ORDER BY source LIMIT 1)) +NULL +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `a` +DROP FUNCTION f1; +CREATE PROCEDURE p1(a double) BEGIN END;; +CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `a` +DROP PROCEDURE p1; +CREATE PROCEDURE p1(OUT dst double) +BEGIN +DECLARE src inet6 DEFAULT NULL; +SET dst=src; +END; +$$ +CREATE PROCEDURE p2() +BEGIN +DECLARE dst double DEFAULT NULL; +CALL p1(dst); +END; +$$ +CALL p2(); +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `dst` +SHOW WARNINGS; +Level Code Message +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `dst` +DROP PROCEDURE p2; +DROP PROCEDURE p1; +CREATE FUNCTION f1() RETURNS double +BEGIN +DECLARE rc inet6 DEFAULT NULL; +RETURN rc; +END; +$$ +SELECT f1(); +f1() +NULL +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `f1()` +DROP FUNCTION f1; +CREATE PROCEDURE p1() +BEGIN +DECLARE src inet6 DEFAULT NULL; +DECLARE cur1 CURSOR(t double) FOR SELECT * FROM t1 WHERE target=t; +OPEN cur1(src); +CLOSE cur1; +END; +$$ +CALL p1(); +DROP PROCEDURE p1; +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES (); +CREATE PROCEDURE p1() +BEGIN +DECLARE dst double DEFAULT NULL; +DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1; +OPEN cur2; +FETCH cur2 INTO dst; +CLOSE cur2; +END; +$$ +CALL p1(); +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `dst` +Warning 1366 Incorrect double value: '::' for column ``.``.`dst` at row 1 +DROP PROCEDURE p1; +DROP TABLE t2; +# End of type_store_assignment_incompatible.inc +DROP TABLE t1; +# +# End of 10.7 tests +# diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_loose.test b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_loose.test new file mode 100644 index 00000000000..2721d9c5643 --- /dev/null +++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_loose.test @@ -0,0 +1,21 @@ +--echo # +--echo # Start of 10.7 tests +--echo # + +--echo # +--echo # MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER +--echo # + +SET sql_mode=''; + +CREATE TABLE t1 (target INET6 DEFAULT '::0', source DOUBLE DEFAULT 0); +--source include/type_mix_incompatible.inc +DROP TABLE t1; + +CREATE TABLE t1 (target DOUBLE DEFAULT 0, source INET6 DEFAULT '::0'); +--source include/type_mix_incompatible.inc +DROP TABLE t1; + +--echo # +--echo # End of 10.7 tests +--echo # diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_strict_ignore.result b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_strict_ignore.result new file mode 100644 index 00000000000..9b76306d510 --- /dev/null +++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_strict_ignore.result @@ -0,0 +1,400 @@ +# +# Start of 10.7 tests +# +# +# MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER +# +SET @ignore='IGNORE'; +CREATE TABLE t1 (target INET6 DEFAULT '::0', source DOUBLE DEFAULT 0); +# Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; +SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS +WHERE COLUMN_NAME='source' + AND TABLE_NAME='t1' + AND TABLE_SCHEMA='test'); +SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS +WHERE COLUMN_NAME='target' + AND TABLE_NAME='t1' + AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; +CREATE TABLE t2 LIKE t1; +ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; +INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL, + `target` inet6 DEFAULT '::', + `source` double DEFAULT 0, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +CREATE TABLE t3 LIKE t2; +INSERT IGNORE INTO t3 VALUES +(1, +(SELECT source FROM t2 ORDER BY id LIMIT 1), +(SELECT source FROM t2 ORDER BY id LIMIT 1)); +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1 +DROP TABLE t3; +SET sql_mode=''; +CREATE TABLE t3 LIKE t2; +ALTER TABLE t3 ENGINE=MyISAM; +EXECUTE IMMEDIATE +CONCAT('CREATE VIEW v3 AS SELECT id,', +IF(@target_type='geometry','AsText(target)','target'), ' AS target,', +IF(@source_type='geometry','AsText(source)','source'), ' AS source ', +' FROM t3'); +INSERT IGNORE INTO t3 VALUES +(1, +(SELECT target FROM t2 ORDER BY id LIMIT 1), +(SELECT source FROM t2 ORDER BY id LIMIT 1)), +(2, +(SELECT source FROM t2 ORDER BY id LIMIT 1), +(SELECT source FROM t2 ORDER BY id LIMIT 1)); +Warnings: +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 2 +SELECT * FROM v3; +id target source +1 :: 0 +2 :: 0 +TRUNCATE TABLE t3; +SET sql_mode=STRICT_ALL_TABLES; +INSERT IGNORE INTO t3 VALUES +(1, +(SELECT target FROM t2 ORDER BY id LIMIT 1), +(SELECT source FROM t2 ORDER BY id LIMIT 1)), +(2, +(SELECT source FROM t2 ORDER BY id LIMIT 1), +(SELECT source FROM t2 ORDER BY id LIMIT 1)); +Warnings: +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 2 +SELECT * FROM v3; +id target source +1 :: 0 +2 :: 0 +TRUNCATE TABLE t3; +SET sql_mode=@sql_mode_save; +DROP TABLE t3; +DROP VIEW v3; +CREATE TABLE t3 LIKE t2; +INSERT IGNORE INTO t3 SELECT id,source,source FROM t2; +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1 +INSERT IGNORE INTO t3 (id,target,source) SELECT id,source,source FROM t2; +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1 +Warning 1062 Duplicate entry '1' for key 'PRIMARY' +INSERT IGNORE INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1 +INSERT IGNORE INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1 +INSERT IGNORE INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1 +INSERT IGNORE INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1 +UPDATE IGNORE t3 SET target=source; +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1 +UPDATE IGNORE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` +Warning 1292 Incorrect inet6 value: '0' for column ``.`(temporary)`.`target` at row 1 +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); +SELECT @alter; +@alter +ALTER IGNORE TABLE t3 MODIFY target double +EXECUTE IMMEDIATE @alter; +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` +Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1 +DROP TABLE t3; +DROP TABLE t2; +CREATE PROCEDURE p1() +BEGIN +DECLARE src double DEFAULT NULL; +DECLARE dst inet6 DEFAULT NULL; +SET dst=src; +END; +$$ +CALL p1; +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `dst` +DROP PROCEDURE p1; +CREATE FUNCTION f1(a inet6) RETURNS INT RETURN NULL;; +SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `a` +DROP FUNCTION f1; +CREATE PROCEDURE p1(a inet6) BEGIN END;; +CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `a` +DROP PROCEDURE p1; +CREATE PROCEDURE p1(OUT dst inet6) +BEGIN +DECLARE src double DEFAULT NULL; +SET dst=src; +END; +$$ +CREATE PROCEDURE p2() +BEGIN +DECLARE dst inet6 DEFAULT NULL; +CALL p1(dst); +END; +$$ +CALL p2(); +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `dst` +SHOW WARNINGS; +Level Code Message +Error 4078 Cannot cast 'double' as 'inet6' in assignment of `dst` +Note 4094 At line 4 in test.p1 +Note 4094 At line 4 in test.p2 +DROP PROCEDURE p2; +DROP PROCEDURE p1; +CREATE FUNCTION f1() RETURNS inet6 +BEGIN +DECLARE rc double DEFAULT NULL; +RETURN rc; +END; +$$ +SELECT f1(); +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `f1()` +DROP FUNCTION f1; +CREATE PROCEDURE p1() +BEGIN +DECLARE src double DEFAULT NULL; +DECLARE cur1 CURSOR(t inet6) FOR SELECT * FROM t1 WHERE target=t; +OPEN cur1(src); +CLOSE cur1; +END; +$$ +CALL p1(); +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `t` +DROP PROCEDURE p1; +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES (); +CREATE PROCEDURE p1() +BEGIN +DECLARE dst inet6 DEFAULT NULL; +DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1; +OPEN cur2; +FETCH cur2 INTO dst; +CLOSE cur2; +END; +$$ +CALL p1(); +ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `dst` +DROP PROCEDURE p1; +DROP TABLE t2; +# End of type_store_assignment_incompatible.inc +DROP TABLE t1; +CREATE TABLE t1 (target DOUBLE DEFAULT 0, source INET6 DEFAULT '::0'); +# Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; +SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS +WHERE COLUMN_NAME='source' + AND TABLE_NAME='t1' + AND TABLE_SCHEMA='test'); +SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS +WHERE COLUMN_NAME='target' + AND TABLE_NAME='t1' + AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; +CREATE TABLE t2 LIKE t1; +ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; +INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL, + `target` double DEFAULT 0, + `source` inet6 DEFAULT '::', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +CREATE TABLE t3 LIKE t2; +INSERT IGNORE INTO t3 VALUES +(1, +(SELECT source FROM t2 ORDER BY id LIMIT 1), +(SELECT source FROM t2 ORDER BY id LIMIT 1)); +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` +Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1 +DROP TABLE t3; +SET sql_mode=''; +CREATE TABLE t3 LIKE t2; +ALTER TABLE t3 ENGINE=MyISAM; +EXECUTE IMMEDIATE +CONCAT('CREATE VIEW v3 AS SELECT id,', +IF(@target_type='geometry','AsText(target)','target'), ' AS target,', +IF(@source_type='geometry','AsText(source)','source'), ' AS source ', +' FROM t3'); +INSERT IGNORE INTO t3 VALUES +(1, +(SELECT target FROM t2 ORDER BY id LIMIT 1), +(SELECT source FROM t2 ORDER BY id LIMIT 1)), +(2, +(SELECT source FROM t2 ORDER BY id LIMIT 1), +(SELECT source FROM t2 ORDER BY id LIMIT 1)); +Warnings: +Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 2 +SELECT * FROM v3; +id target source +1 0 :: +2 0 :: +TRUNCATE TABLE t3; +SET sql_mode=STRICT_ALL_TABLES; +INSERT IGNORE INTO t3 VALUES +(1, +(SELECT target FROM t2 ORDER BY id LIMIT 1), +(SELECT source FROM t2 ORDER BY id LIMIT 1)), +(2, +(SELECT source FROM t2 ORDER BY id LIMIT 1), +(SELECT source FROM t2 ORDER BY id LIMIT 1)); +Warnings: +Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 2 +SELECT * FROM v3; +id target source +1 0 :: +2 0 :: +TRUNCATE TABLE t3; +SET sql_mode=@sql_mode_save; +DROP TABLE t3; +DROP VIEW v3; +CREATE TABLE t3 LIKE t2; +INSERT IGNORE INTO t3 SELECT id,source,source FROM t2; +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` +Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1 +INSERT IGNORE INTO t3 (id,target,source) SELECT id,source,source FROM t2; +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` +Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1 +Warning 1062 Duplicate entry '1' for key 'PRIMARY' +INSERT IGNORE INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` +Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1 +INSERT IGNORE INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` +Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1 +INSERT IGNORE INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` +Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1 +INSERT IGNORE INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` +Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1 +UPDATE IGNORE t3 SET target=source; +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` +Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1 +UPDATE IGNORE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; +Warnings: +Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target` +Warning 1366 Incorrect double value: '::' for column ``.`(temporary)`.`target` at row 1 +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); +SELECT @alter; +@alter +ALTER IGNORE TABLE t3 MODIFY target inet6 +EXECUTE IMMEDIATE @alter; +Warnings: +Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target` +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1 +DROP TABLE t3; +DROP TABLE t2; +CREATE PROCEDURE p1() +BEGIN +DECLARE src inet6 DEFAULT NULL; +DECLARE dst double DEFAULT NULL; +SET dst=src; +END; +$$ +CALL p1; +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `dst` +DROP PROCEDURE p1; +CREATE FUNCTION f1(a double) RETURNS INT RETURN NULL;; +SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `a` +DROP FUNCTION f1; +CREATE PROCEDURE p1(a double) BEGIN END;; +CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `a` +DROP PROCEDURE p1; +CREATE PROCEDURE p1(OUT dst double) +BEGIN +DECLARE src inet6 DEFAULT NULL; +SET dst=src; +END; +$$ +CREATE PROCEDURE p2() +BEGIN +DECLARE dst double DEFAULT NULL; +CALL p1(dst); +END; +$$ +CALL p2(); +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `dst` +SHOW WARNINGS; +Level Code Message +Error 4078 Cannot cast 'inet6' as 'double' in assignment of `dst` +Note 4094 At line 4 in test.p1 +Note 4094 At line 4 in test.p2 +DROP PROCEDURE p2; +DROP PROCEDURE p1; +CREATE FUNCTION f1() RETURNS double +BEGIN +DECLARE rc inet6 DEFAULT NULL; +RETURN rc; +END; +$$ +SELECT f1(); +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `f1()` +DROP FUNCTION f1; +CREATE PROCEDURE p1() +BEGIN +DECLARE src inet6 DEFAULT NULL; +DECLARE cur1 CURSOR(t double) FOR SELECT * FROM t1 WHERE target=t; +OPEN cur1(src); +CLOSE cur1; +END; +$$ +CALL p1(); +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `t` +DROP PROCEDURE p1; +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES (); +CREATE PROCEDURE p1() +BEGIN +DECLARE dst double DEFAULT NULL; +DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1; +OPEN cur2; +FETCH cur2 INTO dst; +CLOSE cur2; +END; +$$ +CALL p1(); +ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `dst` +DROP PROCEDURE p1; +DROP TABLE t2; +# End of type_store_assignment_incompatible.inc +DROP TABLE t1; +# +# End of 10.7 tests +# diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_strict_ignore.test b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_strict_ignore.test new file mode 100644 index 00000000000..ebb41854df2 --- /dev/null +++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_strict_ignore.test @@ -0,0 +1,21 @@ +--echo # +--echo # Start of 10.7 tests +--echo # + +--echo # +--echo # MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER +--echo # + +SET @ignore='IGNORE'; + +CREATE TABLE t1 (target INET6 DEFAULT '::0', source DOUBLE DEFAULT 0); +--source include/type_mix_incompatible.inc +DROP TABLE t1; + +CREATE TABLE t1 (target DOUBLE DEFAULT 0, source INET6 DEFAULT '::0'); +--source include/type_mix_incompatible.inc +DROP TABLE t1; + +--echo # +--echo # End of 10.7 tests +--echo # diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_int.result b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_int.result index 80a2e70cd7a..dd078efc38f 100644 --- a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_int.result +++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_int.result @@ -6,6 +6,7 @@ # CREATE TABLE t1 (target INET6 DEFAULT '::0', source INT DEFAULT 0); # Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='source' AND TABLE_NAME='t1' @@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='target' AND TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; CREATE TABLE t2 LIKE t1; ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); @@ -30,7 +35,7 @@ INSERT INTO t3 VALUES (1, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t3`.`target` DROP TABLE t3; SET sql_mode=''; CREATE TABLE t3 LIKE t2; @@ -62,37 +67,37 @@ INSERT INTO t3 VALUES (2, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -Got one of the listed errors +ERROR 22007: Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 2 SELECT * FROM v3; id target source 1 :: 0 TRUNCATE TABLE t3; -SET sql_mode=DEFAULT; +SET sql_mode=@sql_mode_save; DROP TABLE t3; DROP VIEW v3; CREATE TABLE t3 LIKE t2; INSERT INTO t3 SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t3`.`target` UPDATE t3 SET target=source; -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t3`.`target` UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' -SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type); +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t3`.`target` +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); SELECT @alter; @alter ALTER TABLE t3 MODIFY target int(11) EXECUTE IMMEDIATE @alter; -ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t3`.`target` DROP TABLE t3; DROP TABLE t2; CREATE PROCEDURE p1() @@ -103,15 +108,15 @@ SET dst=src; END; $$ CALL p1; -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `dst` DROP PROCEDURE p1; CREATE FUNCTION f1(a inet6) RETURNS INT RETURN NULL;; SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `a` DROP FUNCTION f1; CREATE PROCEDURE p1(a inet6) BEGIN END;; CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `a` DROP PROCEDURE p1; CREATE PROCEDURE p1(OUT dst inet6) BEGIN @@ -126,10 +131,10 @@ CALL p1(dst); END; $$ CALL p2(); -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `dst` SHOW WARNINGS; Level Code Message -Error 4078 Illegal parameter data types inet6 and int for operation 'SET' +Error 4078 Cannot cast 'int' as 'inet6' in assignment of `dst` Note 4094 At line 4 in test.p1 Note 4094 At line 4 in test.p2 DROP PROCEDURE p2; @@ -141,7 +146,7 @@ RETURN rc; END; $$ SELECT f1(); -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `f1()` DROP FUNCTION f1; CREATE PROCEDURE p1() BEGIN @@ -152,7 +157,7 @@ CLOSE cur1; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `t` DROP PROCEDURE p1; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (); @@ -166,13 +171,14 @@ CLOSE cur2; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `dst` DROP PROCEDURE p1; DROP TABLE t2; # End of type_store_assignment_incompatible.inc DROP TABLE t1; CREATE TABLE t1 (target INT DEFAULT 0, source INET6 DEFAULT '::0'); # Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='source' AND TABLE_NAME='t1' @@ -181,6 +187,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='target' AND TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; CREATE TABLE t2 LIKE t1; ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); @@ -197,7 +207,7 @@ INSERT INTO t3 VALUES (1, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t3`.`target` DROP TABLE t3; SET sql_mode=''; CREATE TABLE t3 LIKE t2; @@ -229,37 +239,37 @@ INSERT INTO t3 VALUES (2, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -Got one of the listed errors +ERROR 22007: Incorrect integer value: '::' for column `test`.`t3`.`target` at row 2 SELECT * FROM v3; id target source 1 0 :: TRUNCATE TABLE t3; -SET sql_mode=DEFAULT; +SET sql_mode=@sql_mode_save; DROP TABLE t3; DROP VIEW v3; CREATE TABLE t3 LIKE t2; INSERT INTO t3 SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t3`.`target` INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t3`.`target` INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t3`.`target` UPDATE t3 SET target=source; -ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t3`.`target` UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; -ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET' -SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type); +ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t3`.`target` +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); SELECT @alter; @alter ALTER TABLE t3 MODIFY target inet6 EXECUTE IMMEDIATE @alter; -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t3`.`target` DROP TABLE t3; DROP TABLE t2; CREATE PROCEDURE p1() @@ -270,15 +280,15 @@ SET dst=src; END; $$ CALL p1; -ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `dst` DROP PROCEDURE p1; CREATE FUNCTION f1(a int(11)) RETURNS INT RETURN NULL;; SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `a` DROP FUNCTION f1; CREATE PROCEDURE p1(a int(11)) BEGIN END;; CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `a` DROP PROCEDURE p1; CREATE PROCEDURE p1(OUT dst int(11)) BEGIN @@ -293,10 +303,10 @@ CALL p1(dst); END; $$ CALL p2(); -ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `dst` SHOW WARNINGS; Level Code Message -Error 4078 Illegal parameter data types int and inet6 for operation 'SET' +Error 4078 Cannot cast 'inet6' as 'int' in assignment of `dst` Note 4094 At line 4 in test.p1 Note 4094 At line 4 in test.p2 DROP PROCEDURE p2; @@ -308,7 +318,7 @@ RETURN rc; END; $$ SELECT f1(); -ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `f1()` DROP FUNCTION f1; CREATE PROCEDURE p1() BEGIN @@ -319,7 +329,7 @@ CLOSE cur1; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `t` DROP PROCEDURE p1; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (); @@ -333,7 +343,7 @@ CLOSE cur2; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `dst` DROP PROCEDURE p1; DROP TABLE t2; # End of type_store_assignment_incompatible.inc diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_time.result b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_time.result index ffca3fb441f..afdbd9e1999 100644 --- a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_time.result +++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_time.result @@ -6,6 +6,7 @@ # CREATE TABLE t1 (target INET6 DEFAULT '::0', source TIME DEFAULT '00:00:00'); # Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='source' AND TABLE_NAME='t1' @@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='target' AND TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; CREATE TABLE t2 LIKE t1; ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); @@ -30,7 +35,7 @@ INSERT INTO t3 VALUES (1, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t3`.`target` DROP TABLE t3; SET sql_mode=''; CREATE TABLE t3 LIKE t2; @@ -62,37 +67,37 @@ INSERT INTO t3 VALUES (2, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -Got one of the listed errors +ERROR 22007: Incorrect inet6 value: '00:00:00' for column `test`.`t3`.`target` at row 2 SELECT * FROM v3; id target source 1 :: 00:00:00 TRUNCATE TABLE t3; -SET sql_mode=DEFAULT; +SET sql_mode=@sql_mode_save; DROP TABLE t3; DROP VIEW v3; CREATE TABLE t3 LIKE t2; INSERT INTO t3 SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t3`.`target` UPDATE t3 SET target=source; -ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t3`.`target` UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; -ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET' -SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type); +ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t3`.`target` +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); SELECT @alter; @alter ALTER TABLE t3 MODIFY target time EXECUTE IMMEDIATE @alter; -ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t3`.`target` DROP TABLE t3; DROP TABLE t2; CREATE PROCEDURE p1() @@ -103,15 +108,15 @@ SET dst=src; END; $$ CALL p1; -ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `dst` DROP PROCEDURE p1; CREATE FUNCTION f1(a inet6) RETURNS INT RETURN NULL;; SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `a` DROP FUNCTION f1; CREATE PROCEDURE p1(a inet6) BEGIN END;; CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `a` DROP PROCEDURE p1; CREATE PROCEDURE p1(OUT dst inet6) BEGIN @@ -126,10 +131,10 @@ CALL p1(dst); END; $$ CALL p2(); -ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `dst` SHOW WARNINGS; Level Code Message -Error 4078 Illegal parameter data types inet6 and time for operation 'SET' +Error 4078 Cannot cast 'time' as 'inet6' in assignment of `dst` Note 4094 At line 4 in test.p1 Note 4094 At line 4 in test.p2 DROP PROCEDURE p2; @@ -141,7 +146,7 @@ RETURN rc; END; $$ SELECT f1(); -ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `f1()` DROP FUNCTION f1; CREATE PROCEDURE p1() BEGIN @@ -152,7 +157,7 @@ CLOSE cur1; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `t` DROP PROCEDURE p1; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (); @@ -166,13 +171,14 @@ CLOSE cur2; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `dst` DROP PROCEDURE p1; DROP TABLE t2; # End of type_store_assignment_incompatible.inc DROP TABLE t1; CREATE TABLE t1 (target TIME DEFAULT '00:00:00', source INET6 DEFAULT '::0'); # Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='source' AND TABLE_NAME='t1' @@ -181,6 +187,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='target' AND TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; CREATE TABLE t2 LIKE t1; ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); @@ -197,7 +207,7 @@ INSERT INTO t3 VALUES (1, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t3`.`target` DROP TABLE t3; SET sql_mode=''; CREATE TABLE t3 LIKE t2; @@ -229,37 +239,37 @@ INSERT INTO t3 VALUES (2, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -Got one of the listed errors +ERROR 22007: Incorrect time value: '::' for column `test`.`t3`.`target` at row 2 SELECT * FROM v3; id target source 1 00:00:00 :: TRUNCATE TABLE t3; -SET sql_mode=DEFAULT; +SET sql_mode=@sql_mode_save; DROP TABLE t3; DROP VIEW v3; CREATE TABLE t3 LIKE t2; INSERT INTO t3 SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t3`.`target` INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t3`.`target` INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t3`.`target` UPDATE t3 SET target=source; -ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t3`.`target` UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; -ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET' -SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type); +ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t3`.`target` +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); SELECT @alter; @alter ALTER TABLE t3 MODIFY target inet6 EXECUTE IMMEDIATE @alter; -ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t3`.`target` DROP TABLE t3; DROP TABLE t2; CREATE PROCEDURE p1() @@ -270,15 +280,15 @@ SET dst=src; END; $$ CALL p1; -ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `dst` DROP PROCEDURE p1; CREATE FUNCTION f1(a time) RETURNS INT RETURN NULL;; SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `a` DROP FUNCTION f1; CREATE PROCEDURE p1(a time) BEGIN END;; CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `a` DROP PROCEDURE p1; CREATE PROCEDURE p1(OUT dst time) BEGIN @@ -293,10 +303,10 @@ CALL p1(dst); END; $$ CALL p2(); -ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `dst` SHOW WARNINGS; Level Code Message -Error 4078 Illegal parameter data types time and inet6 for operation 'SET' +Error 4078 Cannot cast 'inet6' as 'time' in assignment of `dst` Note 4094 At line 4 in test.p1 Note 4094 At line 4 in test.p2 DROP PROCEDURE p2; @@ -308,7 +318,7 @@ RETURN rc; END; $$ SELECT f1(); -ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `f1()` DROP FUNCTION f1; CREATE PROCEDURE p1() BEGIN @@ -319,7 +329,7 @@ CLOSE cur1; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `t` DROP PROCEDURE p1; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (); @@ -333,7 +343,7 @@ CLOSE cur2; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `dst` DROP PROCEDURE p1; DROP TABLE t2; # End of type_store_assignment_incompatible.inc diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_uint.result b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_uint.result index 7fa4df73dab..88439222de2 100644 --- a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_uint.result +++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_uint.result @@ -6,6 +6,7 @@ # CREATE TABLE t1 (target INET6 DEFAULT '::0', source INT UNSIGNED DEFAULT 0); # Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='source' AND TABLE_NAME='t1' @@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='target' AND TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; CREATE TABLE t2 LIKE t1; ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); @@ -30,7 +35,7 @@ INSERT INTO t3 VALUES (1, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `test`.`t3`.`target` DROP TABLE t3; SET sql_mode=''; CREATE TABLE t3 LIKE t2; @@ -62,37 +67,37 @@ INSERT INTO t3 VALUES (2, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -Got one of the listed errors +ERROR 22007: Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 2 SELECT * FROM v3; id target source 1 :: 0 TRUNCATE TABLE t3; -SET sql_mode=DEFAULT; +SET sql_mode=@sql_mode_save; DROP TABLE t3; DROP VIEW v3; CREATE TABLE t3 LIKE t2; INSERT INTO t3 SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `test`.`t3`.`target` UPDATE t3 SET target=source; -ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `test`.`t3`.`target` UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; -ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET' -SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type); +ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `test`.`t3`.`target` +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); SELECT @alter; @alter ALTER TABLE t3 MODIFY target int(10) unsigned EXECUTE IMMEDIATE @alter; -ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `test`.`t3`.`target` DROP TABLE t3; DROP TABLE t2; CREATE PROCEDURE p1() @@ -103,15 +108,15 @@ SET dst=src; END; $$ CALL p1; -ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `dst` DROP PROCEDURE p1; CREATE FUNCTION f1(a inet6) RETURNS INT RETURN NULL;; SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `a` DROP FUNCTION f1; CREATE PROCEDURE p1(a inet6) BEGIN END;; CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `a` DROP PROCEDURE p1; CREATE PROCEDURE p1(OUT dst inet6) BEGIN @@ -126,10 +131,10 @@ CALL p1(dst); END; $$ CALL p2(); -ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `dst` SHOW WARNINGS; Level Code Message -Error 4078 Illegal parameter data types inet6 and int unsigned for operation 'SET' +Error 4078 Cannot cast 'int unsigned' as 'inet6' in assignment of `dst` Note 4094 At line 4 in test.p1 Note 4094 At line 4 in test.p2 DROP PROCEDURE p2; @@ -141,7 +146,7 @@ RETURN rc; END; $$ SELECT f1(); -ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `f1()` DROP FUNCTION f1; CREATE PROCEDURE p1() BEGIN @@ -152,7 +157,7 @@ CLOSE cur1; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `t` DROP PROCEDURE p1; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (); @@ -166,13 +171,14 @@ CLOSE cur2; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `dst` DROP PROCEDURE p1; DROP TABLE t2; # End of type_store_assignment_incompatible.inc DROP TABLE t1; CREATE TABLE t1 (target INT UNSIGNED DEFAULT 0, source INET6 DEFAULT '::0'); # Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='source' AND TABLE_NAME='t1' @@ -181,6 +187,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='target' AND TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; CREATE TABLE t2 LIKE t1; ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); @@ -197,7 +207,7 @@ INSERT INTO t3 VALUES (1, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `test`.`t3`.`target` DROP TABLE t3; SET sql_mode=''; CREATE TABLE t3 LIKE t2; @@ -229,37 +239,37 @@ INSERT INTO t3 VALUES (2, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -Got one of the listed errors +ERROR 22007: Incorrect integer value: '::' for column `test`.`t3`.`target` at row 2 SELECT * FROM v3; id target source 1 0 :: TRUNCATE TABLE t3; -SET sql_mode=DEFAULT; +SET sql_mode=@sql_mode_save; DROP TABLE t3; DROP VIEW v3; CREATE TABLE t3 LIKE t2; INSERT INTO t3 SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `test`.`t3`.`target` INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `test`.`t3`.`target` INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `test`.`t3`.`target` UPDATE t3 SET target=source; -ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `test`.`t3`.`target` UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; -ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET' -SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type); +ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `test`.`t3`.`target` +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); SELECT @alter; @alter ALTER TABLE t3 MODIFY target inet6 EXECUTE IMMEDIATE @alter; -ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `test`.`t3`.`target` DROP TABLE t3; DROP TABLE t2; CREATE PROCEDURE p1() @@ -270,15 +280,15 @@ SET dst=src; END; $$ CALL p1; -ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `dst` DROP PROCEDURE p1; CREATE FUNCTION f1(a int(10) unsigned) RETURNS INT RETURN NULL;; SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `a` DROP FUNCTION f1; CREATE PROCEDURE p1(a int(10) unsigned) BEGIN END;; CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `a` DROP PROCEDURE p1; CREATE PROCEDURE p1(OUT dst int(10) unsigned) BEGIN @@ -293,10 +303,10 @@ CALL p1(dst); END; $$ CALL p2(); -ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `dst` SHOW WARNINGS; Level Code Message -Error 4078 Illegal parameter data types int unsigned and inet6 for operation 'SET' +Error 4078 Cannot cast 'inet6' as 'int unsigned' in assignment of `dst` Note 4094 At line 4 in test.p1 Note 4094 At line 4 in test.p2 DROP PROCEDURE p2; @@ -308,7 +318,7 @@ RETURN rc; END; $$ SELECT f1(); -ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `f1()` DROP FUNCTION f1; CREATE PROCEDURE p1() BEGIN @@ -319,7 +329,7 @@ CLOSE cur1; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `t` DROP PROCEDURE p1; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (); @@ -333,7 +343,7 @@ CLOSE cur2; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET' +ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `dst` DROP PROCEDURE p1; DROP TABLE t2; # End of type_store_assignment_incompatible.inc diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid.result index adcafc51ece..2a96b2df592 100644 --- a/plugin/type_uuid/mysql-test/type_uuid/type_uuid.result +++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid.result @@ -195,9 +195,9 @@ CREATE TABLE t1 (a UUID); INSERT INTO t1 VALUES ('x'); ERROR 22007: Incorrect uuid value: 'x' for column `test`.`t1`.`a` at row 1 INSERT INTO t1 VALUES (1); -ERROR HY000: Illegal parameter data types uuid and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t1`.`a` INSERT INTO t1 VALUES (TIME'10:20:30'); -ERROR HY000: Illegal parameter data types uuid and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t1`.`a` INSERT INTO t1 VALUES (0x00); ERROR 22007: Incorrect uuid value: '\x00' for column `test`.`t1`.`a` at row 1 DROP TABLE t1; @@ -1931,15 +1931,15 @@ DROP TABLE t1; # CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID)); -ERROR HY000: Illegal parameter data types int and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t1`.`a` DROP TABLE t1; CREATE TABLE t1 (a DOUBLE); INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID)); -ERROR HY000: Illegal parameter data types double and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t1`.`a` DROP TABLE t1; CREATE TABLE t1 (a DECIMAL(32,0)); INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID)); -ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t1`.`a` DROP TABLE t1; CREATE TABLE t1 (a VARCHAR(64)); INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID)); @@ -2762,7 +2762,7 @@ DROP TABLE t1; CREATE TABLE t1 (a UUID, b INT); INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types int and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -2770,7 +2770,7 @@ DROP TABLE t1; CREATE TABLE t1 (a UUID, b DOUBLE); INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types double and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -2778,7 +2778,7 @@ DROP TABLE t1; CREATE TABLE t1 (a UUID, b DECIMAL(32,0)); INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -2786,7 +2786,7 @@ DROP TABLE t1; CREATE TABLE t1 (a UUID, b YEAR); INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types year and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'year' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -2797,7 +2797,7 @@ DROP TABLE t1; CREATE TABLE t1 (a INT, b UUID); INSERT INTO t1 VALUES (1, NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types uuid and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -2805,7 +2805,7 @@ DROP TABLE t1; CREATE TABLE t1 (a DOUBLE, b UUID); INSERT INTO t1 VALUES (1, NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types uuid and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -2813,7 +2813,7 @@ DROP TABLE t1; CREATE TABLE t1 (a DECIMAL(32,0), b UUID); INSERT INTO t1 VALUES (1, NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -2821,7 +2821,7 @@ DROP TABLE t1; CREATE TABLE t1 (a YEAR, b UUID); INSERT INTO t1 VALUES (1, NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types uuid and year for operation 'SET' +ERROR HY000: Cannot cast 'year' as 'uuid' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -2832,7 +2832,7 @@ DROP TABLE t1; CREATE TABLE t1 (a UUID, b TIME); INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types time and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -2840,7 +2840,7 @@ DROP TABLE t1; CREATE TABLE t1 (a UUID, b DATE); INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types date and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'date' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -2848,7 +2848,7 @@ DROP TABLE t1; CREATE TABLE t1 (a UUID, b DATETIME); INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types datetime and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'datetime' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -2856,7 +2856,7 @@ DROP TABLE t1; CREATE TABLE t1 (a UUID, b TIMESTAMP NULL DEFAULT NULL); INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types timestamp and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'timestamp' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -2867,7 +2867,7 @@ DROP TABLE t1; CREATE TABLE t1 (a TIME, b UUID); INSERT INTO t1 VALUES ('00:00:00', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types uuid and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -2875,7 +2875,7 @@ DROP TABLE t1; CREATE TABLE t1 (a DATE, b UUID); INSERT INTO t1 VALUES ('2001-01:01', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types uuid and date for operation 'SET' +ERROR HY000: Cannot cast 'date' as 'uuid' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -2883,7 +2883,7 @@ DROP TABLE t1; CREATE TABLE t1 (a DATETIME, b UUID); INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types uuid and datetime for operation 'SET' +ERROR HY000: Cannot cast 'datetime' as 'uuid' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL @@ -2891,7 +2891,7 @@ DROP TABLE t1; CREATE TABLE t1 (a TIMESTAMP, b UUID); INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL); UPDATE t1 SET b=a; -ERROR HY000: Illegal parameter data types uuid and timestamp for operation 'SET' +ERROR HY000: Cannot cast 'timestamp' as 'uuid' in assignment of `test`.`t1`.`b` SELECT b FROM t1; b NULL diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_decimal.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_decimal.result index 91519b1e677..4eae75fbfc3 100644 --- a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_decimal.result +++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_decimal.result @@ -6,6 +6,7 @@ # CREATE TABLE t1 (target UUID DEFAULT '00000000-0000-0000-0000-000000000000', source DECIMAL(38,0) DEFAULT 0); # Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='source' AND TABLE_NAME='t1' @@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='target' AND TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; CREATE TABLE t2 LIKE t1; ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); @@ -30,7 +35,7 @@ INSERT INTO t3 VALUES (1, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t3`.`target` DROP TABLE t3; SET sql_mode=''; CREATE TABLE t3 LIKE t2; @@ -62,37 +67,37 @@ INSERT INTO t3 VALUES (2, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -Got one of the listed errors +ERROR 22007: Incorrect uuid value: '0' for column `test`.`t3`.`target` at row 2 SELECT * FROM v3; id target source 1 00000000-0000-0000-0000-000000000000 0 TRUNCATE TABLE t3; -SET sql_mode=DEFAULT; +SET sql_mode=@sql_mode_save; DROP TABLE t3; DROP VIEW v3; CREATE TABLE t3 LIKE t2; INSERT INTO t3 SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t3`.`target` UPDATE t3 SET target=source; -ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t3`.`target` UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; -ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET' -SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type); +ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t3`.`target` +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); SELECT @alter; @alter ALTER TABLE t3 MODIFY target decimal(38,0) EXECUTE IMMEDIATE @alter; -ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t3`.`target` DROP TABLE t3; DROP TABLE t2; CREATE PROCEDURE p1() @@ -103,15 +108,15 @@ SET dst=src; END; $$ CALL p1; -ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `dst` DROP PROCEDURE p1; CREATE FUNCTION f1(a uuid) RETURNS INT RETURN NULL;; SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `a` DROP FUNCTION f1; CREATE PROCEDURE p1(a uuid) BEGIN END;; CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `a` DROP PROCEDURE p1; CREATE PROCEDURE p1(OUT dst uuid) BEGIN @@ -126,10 +131,10 @@ CALL p1(dst); END; $$ CALL p2(); -ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `dst` SHOW WARNINGS; Level Code Message -Error 4078 Illegal parameter data types uuid and decimal for operation 'SET' +Error 4078 Cannot cast 'decimal' as 'uuid' in assignment of `dst` Note 4094 At line 4 in test.p1 Note 4094 At line 4 in test.p2 DROP PROCEDURE p2; @@ -141,7 +146,7 @@ RETURN rc; END; $$ SELECT f1(); -ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `f1()` DROP FUNCTION f1; CREATE PROCEDURE p1() BEGIN @@ -152,7 +157,7 @@ CLOSE cur1; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `t` DROP PROCEDURE p1; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (); @@ -166,13 +171,14 @@ CLOSE cur2; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `dst` DROP PROCEDURE p1; DROP TABLE t2; # End of type_store_assignment_incompatible.inc DROP TABLE t1; CREATE TABLE t1 (target DECIMAL(38,0) DEFAULT 0, source UUID DEFAULT '00000000-0000-0000-0000-000000000000'); # Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='source' AND TABLE_NAME='t1' @@ -181,6 +187,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='target' AND TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; CREATE TABLE t2 LIKE t1; ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); @@ -197,7 +207,7 @@ INSERT INTO t3 VALUES (1, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t3`.`target` DROP TABLE t3; SET sql_mode=''; CREATE TABLE t3 LIKE t2; @@ -229,37 +239,37 @@ INSERT INTO t3 VALUES (2, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -Got one of the listed errors +ERROR 01000: Data truncated for column 'target' at row 2 SELECT * FROM v3; id target source 1 0 00000000-0000-0000-0000-000000000000 TRUNCATE TABLE t3; -SET sql_mode=DEFAULT; +SET sql_mode=@sql_mode_save; DROP TABLE t3; DROP VIEW v3; CREATE TABLE t3 LIKE t2; INSERT INTO t3 SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t3`.`target` INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t3`.`target` INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t3`.`target` UPDATE t3 SET target=source; -ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t3`.`target` UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; -ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET' -SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type); +ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t3`.`target` +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); SELECT @alter; @alter ALTER TABLE t3 MODIFY target uuid EXECUTE IMMEDIATE @alter; -ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t3`.`target` DROP TABLE t3; DROP TABLE t2; CREATE PROCEDURE p1() @@ -270,15 +280,15 @@ SET dst=src; END; $$ CALL p1; -ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `dst` DROP PROCEDURE p1; CREATE FUNCTION f1(a decimal(38,0)) RETURNS INT RETURN NULL;; SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `a` DROP FUNCTION f1; CREATE PROCEDURE p1(a decimal(38,0)) BEGIN END;; CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `a` DROP PROCEDURE p1; CREATE PROCEDURE p1(OUT dst decimal(38,0)) BEGIN @@ -293,10 +303,10 @@ CALL p1(dst); END; $$ CALL p2(); -ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `dst` SHOW WARNINGS; Level Code Message -Error 4078 Illegal parameter data types decimal and uuid for operation 'SET' +Error 4078 Cannot cast 'uuid' as 'decimal' in assignment of `dst` Note 4094 At line 4 in test.p1 Note 4094 At line 4 in test.p2 DROP PROCEDURE p2; @@ -308,7 +318,7 @@ RETURN rc; END; $$ SELECT f1(); -ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `f1()` DROP FUNCTION f1; CREATE PROCEDURE p1() BEGIN @@ -319,7 +329,7 @@ CLOSE cur1; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `t` DROP PROCEDURE p1; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (); @@ -333,7 +343,7 @@ CLOSE cur2; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `dst` DROP PROCEDURE p1; DROP TABLE t2; # End of type_store_assignment_incompatible.inc diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_double.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_double.result index 2f045078eb7..60f1a1a09ae 100644 --- a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_double.result +++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_double.result @@ -6,6 +6,7 @@ # CREATE TABLE t1 (target UUID DEFAULT '00000000-0000-0000-0000-000000000000', source DOUBLE DEFAULT 0); # Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='source' AND TABLE_NAME='t1' @@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='target' AND TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; CREATE TABLE t2 LIKE t1; ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); @@ -30,7 +35,7 @@ INSERT INTO t3 VALUES (1, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -ERROR HY000: Illegal parameter data types uuid and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t3`.`target` DROP TABLE t3; SET sql_mode=''; CREATE TABLE t3 LIKE t2; @@ -62,37 +67,37 @@ INSERT INTO t3 VALUES (2, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -Got one of the listed errors +ERROR 22007: Incorrect uuid value: '0' for column `test`.`t3`.`target` at row 2 SELECT * FROM v3; id target source 1 00000000-0000-0000-0000-000000000000 0 TRUNCATE TABLE t3; -SET sql_mode=DEFAULT; +SET sql_mode=@sql_mode_save; DROP TABLE t3; DROP VIEW v3; CREATE TABLE t3 LIKE t2; INSERT INTO t3 SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types uuid and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types uuid and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types uuid and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types uuid and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types uuid and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types uuid and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t3`.`target` UPDATE t3 SET target=source; -ERROR HY000: Illegal parameter data types uuid and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t3`.`target` UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; -ERROR HY000: Illegal parameter data types uuid and double for operation 'SET' -SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type); +ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t3`.`target` +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); SELECT @alter; @alter ALTER TABLE t3 MODIFY target double EXECUTE IMMEDIATE @alter; -ERROR HY000: Illegal parameter data types double and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t3`.`target` DROP TABLE t3; DROP TABLE t2; CREATE PROCEDURE p1() @@ -103,15 +108,15 @@ SET dst=src; END; $$ CALL p1; -ERROR HY000: Illegal parameter data types uuid and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `dst` DROP PROCEDURE p1; CREATE FUNCTION f1(a uuid) RETURNS INT RETURN NULL;; SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types uuid and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `a` DROP FUNCTION f1; CREATE PROCEDURE p1(a uuid) BEGIN END;; CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types uuid and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `a` DROP PROCEDURE p1; CREATE PROCEDURE p1(OUT dst uuid) BEGIN @@ -126,10 +131,10 @@ CALL p1(dst); END; $$ CALL p2(); -ERROR HY000: Illegal parameter data types uuid and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `dst` SHOW WARNINGS; Level Code Message -Error 4078 Illegal parameter data types uuid and double for operation 'SET' +Error 4078 Cannot cast 'double' as 'uuid' in assignment of `dst` Note 4094 At line 4 in test.p1 Note 4094 At line 4 in test.p2 DROP PROCEDURE p2; @@ -141,7 +146,7 @@ RETURN rc; END; $$ SELECT f1(); -ERROR HY000: Illegal parameter data types uuid and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `f1()` DROP FUNCTION f1; CREATE PROCEDURE p1() BEGIN @@ -152,7 +157,7 @@ CLOSE cur1; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types uuid and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `t` DROP PROCEDURE p1; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (); @@ -166,13 +171,14 @@ CLOSE cur2; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types uuid and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `dst` DROP PROCEDURE p1; DROP TABLE t2; # End of type_store_assignment_incompatible.inc DROP TABLE t1; CREATE TABLE t1 (target DOUBLE DEFAULT 0, source UUID DEFAULT '00000000-0000-0000-0000-000000000000'); # Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='source' AND TABLE_NAME='t1' @@ -181,6 +187,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='target' AND TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; CREATE TABLE t2 LIKE t1; ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); @@ -197,7 +207,7 @@ INSERT INTO t3 VALUES (1, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -ERROR HY000: Illegal parameter data types double and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t3`.`target` DROP TABLE t3; SET sql_mode=''; CREATE TABLE t3 LIKE t2; @@ -229,37 +239,37 @@ INSERT INTO t3 VALUES (2, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -Got one of the listed errors +ERROR 01000: Data truncated for column 'target' at row 2 SELECT * FROM v3; id target source 1 0 00000000-0000-0000-0000-000000000000 TRUNCATE TABLE t3; -SET sql_mode=DEFAULT; +SET sql_mode=@sql_mode_save; DROP TABLE t3; DROP VIEW v3; CREATE TABLE t3 LIKE t2; INSERT INTO t3 SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types double and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types double and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t3`.`target` INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types double and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types double and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t3`.`target` INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types double and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types double and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t3`.`target` UPDATE t3 SET target=source; -ERROR HY000: Illegal parameter data types double and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t3`.`target` UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; -ERROR HY000: Illegal parameter data types double and uuid for operation 'SET' -SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type); +ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t3`.`target` +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); SELECT @alter; @alter ALTER TABLE t3 MODIFY target uuid EXECUTE IMMEDIATE @alter; -ERROR HY000: Illegal parameter data types uuid and double for operation 'SET' +ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t3`.`target` DROP TABLE t3; DROP TABLE t2; CREATE PROCEDURE p1() @@ -270,15 +280,15 @@ SET dst=src; END; $$ CALL p1; -ERROR HY000: Illegal parameter data types double and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `dst` DROP PROCEDURE p1; CREATE FUNCTION f1(a double) RETURNS INT RETURN NULL;; SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types double and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `a` DROP FUNCTION f1; CREATE PROCEDURE p1(a double) BEGIN END;; CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types double and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `a` DROP PROCEDURE p1; CREATE PROCEDURE p1(OUT dst double) BEGIN @@ -293,10 +303,10 @@ CALL p1(dst); END; $$ CALL p2(); -ERROR HY000: Illegal parameter data types double and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `dst` SHOW WARNINGS; Level Code Message -Error 4078 Illegal parameter data types double and uuid for operation 'SET' +Error 4078 Cannot cast 'uuid' as 'double' in assignment of `dst` Note 4094 At line 4 in test.p1 Note 4094 At line 4 in test.p2 DROP PROCEDURE p2; @@ -308,7 +318,7 @@ RETURN rc; END; $$ SELECT f1(); -ERROR HY000: Illegal parameter data types double and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `f1()` DROP FUNCTION f1; CREATE PROCEDURE p1() BEGIN @@ -319,7 +329,7 @@ CLOSE cur1; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types double and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `t` DROP PROCEDURE p1; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (); @@ -333,7 +343,7 @@ CLOSE cur2; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types double and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `dst` DROP PROCEDURE p1; DROP TABLE t2; # End of type_store_assignment_incompatible.inc diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_int.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_int.result index 4eb2b803a98..cb3f4c282e3 100644 --- a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_int.result +++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_int.result @@ -6,6 +6,7 @@ # CREATE TABLE t1 (target UUID DEFAULT '00000000-0000-0000-0000-000000000000', source INT DEFAULT 0); # Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='source' AND TABLE_NAME='t1' @@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='target' AND TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; CREATE TABLE t2 LIKE t1; ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); @@ -30,7 +35,7 @@ INSERT INTO t3 VALUES (1, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -ERROR HY000: Illegal parameter data types uuid and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t3`.`target` DROP TABLE t3; SET sql_mode=''; CREATE TABLE t3 LIKE t2; @@ -62,37 +67,37 @@ INSERT INTO t3 VALUES (2, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -Got one of the listed errors +ERROR 22007: Incorrect uuid value: '0' for column `test`.`t3`.`target` at row 2 SELECT * FROM v3; id target source 1 00000000-0000-0000-0000-000000000000 0 TRUNCATE TABLE t3; -SET sql_mode=DEFAULT; +SET sql_mode=@sql_mode_save; DROP TABLE t3; DROP VIEW v3; CREATE TABLE t3 LIKE t2; INSERT INTO t3 SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types uuid and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types uuid and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types uuid and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types uuid and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types uuid and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types uuid and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t3`.`target` UPDATE t3 SET target=source; -ERROR HY000: Illegal parameter data types uuid and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t3`.`target` UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; -ERROR HY000: Illegal parameter data types uuid and int for operation 'SET' -SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type); +ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t3`.`target` +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); SELECT @alter; @alter ALTER TABLE t3 MODIFY target int(11) EXECUTE IMMEDIATE @alter; -ERROR HY000: Illegal parameter data types int and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t3`.`target` DROP TABLE t3; DROP TABLE t2; CREATE PROCEDURE p1() @@ -103,15 +108,15 @@ SET dst=src; END; $$ CALL p1; -ERROR HY000: Illegal parameter data types uuid and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `dst` DROP PROCEDURE p1; CREATE FUNCTION f1(a uuid) RETURNS INT RETURN NULL;; SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types uuid and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `a` DROP FUNCTION f1; CREATE PROCEDURE p1(a uuid) BEGIN END;; CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types uuid and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `a` DROP PROCEDURE p1; CREATE PROCEDURE p1(OUT dst uuid) BEGIN @@ -126,10 +131,10 @@ CALL p1(dst); END; $$ CALL p2(); -ERROR HY000: Illegal parameter data types uuid and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `dst` SHOW WARNINGS; Level Code Message -Error 4078 Illegal parameter data types uuid and int for operation 'SET' +Error 4078 Cannot cast 'int' as 'uuid' in assignment of `dst` Note 4094 At line 4 in test.p1 Note 4094 At line 4 in test.p2 DROP PROCEDURE p2; @@ -141,7 +146,7 @@ RETURN rc; END; $$ SELECT f1(); -ERROR HY000: Illegal parameter data types uuid and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `f1()` DROP FUNCTION f1; CREATE PROCEDURE p1() BEGIN @@ -152,7 +157,7 @@ CLOSE cur1; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types uuid and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `t` DROP PROCEDURE p1; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (); @@ -166,13 +171,14 @@ CLOSE cur2; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types uuid and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `dst` DROP PROCEDURE p1; DROP TABLE t2; # End of type_store_assignment_incompatible.inc DROP TABLE t1; CREATE TABLE t1 (target INT DEFAULT 0, source UUID DEFAULT '00000000-0000-0000-0000-000000000000'); # Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='source' AND TABLE_NAME='t1' @@ -181,6 +187,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='target' AND TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; CREATE TABLE t2 LIKE t1; ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); @@ -197,7 +207,7 @@ INSERT INTO t3 VALUES (1, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -ERROR HY000: Illegal parameter data types int and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t3`.`target` DROP TABLE t3; SET sql_mode=''; CREATE TABLE t3 LIKE t2; @@ -229,37 +239,37 @@ INSERT INTO t3 VALUES (2, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -Got one of the listed errors +ERROR 01000: Data truncated for column 'target' at row 2 SELECT * FROM v3; id target source 1 0 00000000-0000-0000-0000-000000000000 TRUNCATE TABLE t3; -SET sql_mode=DEFAULT; +SET sql_mode=@sql_mode_save; DROP TABLE t3; DROP VIEW v3; CREATE TABLE t3 LIKE t2; INSERT INTO t3 SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types int and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types int and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t3`.`target` INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types int and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types int and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t3`.`target` INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types int and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types int and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t3`.`target` UPDATE t3 SET target=source; -ERROR HY000: Illegal parameter data types int and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t3`.`target` UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; -ERROR HY000: Illegal parameter data types int and uuid for operation 'SET' -SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type); +ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t3`.`target` +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); SELECT @alter; @alter ALTER TABLE t3 MODIFY target uuid EXECUTE IMMEDIATE @alter; -ERROR HY000: Illegal parameter data types uuid and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t3`.`target` DROP TABLE t3; DROP TABLE t2; CREATE PROCEDURE p1() @@ -270,15 +280,15 @@ SET dst=src; END; $$ CALL p1; -ERROR HY000: Illegal parameter data types int and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `dst` DROP PROCEDURE p1; CREATE FUNCTION f1(a int(11)) RETURNS INT RETURN NULL;; SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types int and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `a` DROP FUNCTION f1; CREATE PROCEDURE p1(a int(11)) BEGIN END;; CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types int and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `a` DROP PROCEDURE p1; CREATE PROCEDURE p1(OUT dst int(11)) BEGIN @@ -293,10 +303,10 @@ CALL p1(dst); END; $$ CALL p2(); -ERROR HY000: Illegal parameter data types int and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `dst` SHOW WARNINGS; Level Code Message -Error 4078 Illegal parameter data types int and uuid for operation 'SET' +Error 4078 Cannot cast 'uuid' as 'int' in assignment of `dst` Note 4094 At line 4 in test.p1 Note 4094 At line 4 in test.p2 DROP PROCEDURE p2; @@ -308,7 +318,7 @@ RETURN rc; END; $$ SELECT f1(); -ERROR HY000: Illegal parameter data types int and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `f1()` DROP FUNCTION f1; CREATE PROCEDURE p1() BEGIN @@ -319,7 +329,7 @@ CLOSE cur1; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types int and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `t` DROP PROCEDURE p1; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (); @@ -333,7 +343,7 @@ CLOSE cur2; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types int and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `dst` DROP PROCEDURE p1; DROP TABLE t2; # End of type_store_assignment_incompatible.inc diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_time.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_time.result index bb41af1ebf0..c86d46085e9 100644 --- a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_time.result +++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_time.result @@ -6,6 +6,7 @@ # CREATE TABLE t1 (target UUID DEFAULT '00000000-0000-0000-0000-000000000000', source TIME DEFAULT '00:00:00'); # Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='source' AND TABLE_NAME='t1' @@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='target' AND TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; CREATE TABLE t2 LIKE t1; ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); @@ -30,7 +35,7 @@ INSERT INTO t3 VALUES (1, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -ERROR HY000: Illegal parameter data types uuid and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t3`.`target` DROP TABLE t3; SET sql_mode=''; CREATE TABLE t3 LIKE t2; @@ -62,37 +67,37 @@ INSERT INTO t3 VALUES (2, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -Got one of the listed errors +ERROR 22007: Incorrect uuid value: '00:00:00' for column `test`.`t3`.`target` at row 2 SELECT * FROM v3; id target source 1 00000000-0000-0000-0000-000000000000 00:00:00 TRUNCATE TABLE t3; -SET sql_mode=DEFAULT; +SET sql_mode=@sql_mode_save; DROP TABLE t3; DROP VIEW v3; CREATE TABLE t3 LIKE t2; INSERT INTO t3 SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types uuid and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types uuid and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types uuid and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types uuid and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types uuid and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types uuid and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t3`.`target` UPDATE t3 SET target=source; -ERROR HY000: Illegal parameter data types uuid and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t3`.`target` UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; -ERROR HY000: Illegal parameter data types uuid and time for operation 'SET' -SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type); +ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t3`.`target` +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); SELECT @alter; @alter ALTER TABLE t3 MODIFY target time EXECUTE IMMEDIATE @alter; -ERROR HY000: Illegal parameter data types time and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t3`.`target` DROP TABLE t3; DROP TABLE t2; CREATE PROCEDURE p1() @@ -103,15 +108,15 @@ SET dst=src; END; $$ CALL p1; -ERROR HY000: Illegal parameter data types uuid and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `dst` DROP PROCEDURE p1; CREATE FUNCTION f1(a uuid) RETURNS INT RETURN NULL;; SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types uuid and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `a` DROP FUNCTION f1; CREATE PROCEDURE p1(a uuid) BEGIN END;; CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types uuid and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `a` DROP PROCEDURE p1; CREATE PROCEDURE p1(OUT dst uuid) BEGIN @@ -126,10 +131,10 @@ CALL p1(dst); END; $$ CALL p2(); -ERROR HY000: Illegal parameter data types uuid and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `dst` SHOW WARNINGS; Level Code Message -Error 4078 Illegal parameter data types uuid and time for operation 'SET' +Error 4078 Cannot cast 'time' as 'uuid' in assignment of `dst` Note 4094 At line 4 in test.p1 Note 4094 At line 4 in test.p2 DROP PROCEDURE p2; @@ -141,7 +146,7 @@ RETURN rc; END; $$ SELECT f1(); -ERROR HY000: Illegal parameter data types uuid and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `f1()` DROP FUNCTION f1; CREATE PROCEDURE p1() BEGIN @@ -152,7 +157,7 @@ CLOSE cur1; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types uuid and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `t` DROP PROCEDURE p1; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (); @@ -166,13 +171,14 @@ CLOSE cur2; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types uuid and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `dst` DROP PROCEDURE p1; DROP TABLE t2; # End of type_store_assignment_incompatible.inc DROP TABLE t1; CREATE TABLE t1 (target TIME DEFAULT '00:00:00', source UUID DEFAULT '00000000-0000-0000-0000-000000000000'); # Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='source' AND TABLE_NAME='t1' @@ -181,6 +187,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='target' AND TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; CREATE TABLE t2 LIKE t1; ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); @@ -197,7 +207,7 @@ INSERT INTO t3 VALUES (1, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -ERROR HY000: Illegal parameter data types time and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t3`.`target` DROP TABLE t3; SET sql_mode=''; CREATE TABLE t3 LIKE t2; @@ -229,37 +239,37 @@ INSERT INTO t3 VALUES (2, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -Got one of the listed errors +ERROR 22007: Incorrect time value: '00000000-0000-0000-0000-000000000000' for column `test`.`t3`.`target` at row 2 SELECT * FROM v3; id target source 1 00:00:00 00000000-0000-0000-0000-000000000000 TRUNCATE TABLE t3; -SET sql_mode=DEFAULT; +SET sql_mode=@sql_mode_save; DROP TABLE t3; DROP VIEW v3; CREATE TABLE t3 LIKE t2; INSERT INTO t3 SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types time and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types time and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t3`.`target` INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types time and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types time and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t3`.`target` INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types time and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types time and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t3`.`target` UPDATE t3 SET target=source; -ERROR HY000: Illegal parameter data types time and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t3`.`target` UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; -ERROR HY000: Illegal parameter data types time and uuid for operation 'SET' -SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type); +ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t3`.`target` +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); SELECT @alter; @alter ALTER TABLE t3 MODIFY target uuid EXECUTE IMMEDIATE @alter; -ERROR HY000: Illegal parameter data types uuid and time for operation 'SET' +ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t3`.`target` DROP TABLE t3; DROP TABLE t2; CREATE PROCEDURE p1() @@ -270,15 +280,15 @@ SET dst=src; END; $$ CALL p1; -ERROR HY000: Illegal parameter data types time and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `dst` DROP PROCEDURE p1; CREATE FUNCTION f1(a time) RETURNS INT RETURN NULL;; SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types time and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `a` DROP FUNCTION f1; CREATE PROCEDURE p1(a time) BEGIN END;; CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types time and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `a` DROP PROCEDURE p1; CREATE PROCEDURE p1(OUT dst time) BEGIN @@ -293,10 +303,10 @@ CALL p1(dst); END; $$ CALL p2(); -ERROR HY000: Illegal parameter data types time and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `dst` SHOW WARNINGS; Level Code Message -Error 4078 Illegal parameter data types time and uuid for operation 'SET' +Error 4078 Cannot cast 'uuid' as 'time' in assignment of `dst` Note 4094 At line 4 in test.p1 Note 4094 At line 4 in test.p2 DROP PROCEDURE p2; @@ -308,7 +318,7 @@ RETURN rc; END; $$ SELECT f1(); -ERROR HY000: Illegal parameter data types time and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `f1()` DROP FUNCTION f1; CREATE PROCEDURE p1() BEGIN @@ -319,7 +329,7 @@ CLOSE cur1; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types time and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `t` DROP PROCEDURE p1; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (); @@ -333,7 +343,7 @@ CLOSE cur2; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types time and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `dst` DROP PROCEDURE p1; DROP TABLE t2; # End of type_store_assignment_incompatible.inc diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_uint.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_uint.result index 9c61cfb1171..5202cd83865 100644 --- a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_uint.result +++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_uint.result @@ -6,6 +6,7 @@ # CREATE TABLE t1 (target UUID DEFAULT '00000000-0000-0000-0000-000000000000', source INT UNSIGNED DEFAULT 0); # Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='source' AND TABLE_NAME='t1' @@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='target' AND TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; CREATE TABLE t2 LIKE t1; ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); @@ -30,7 +35,7 @@ INSERT INTO t3 VALUES (1, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `test`.`t3`.`target` DROP TABLE t3; SET sql_mode=''; CREATE TABLE t3 LIKE t2; @@ -62,37 +67,37 @@ INSERT INTO t3 VALUES (2, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -Got one of the listed errors +ERROR 22007: Incorrect uuid value: '0' for column `test`.`t3`.`target` at row 2 SELECT * FROM v3; id target source 1 00000000-0000-0000-0000-000000000000 0 TRUNCATE TABLE t3; -SET sql_mode=DEFAULT; +SET sql_mode=@sql_mode_save; DROP TABLE t3; DROP VIEW v3; CREATE TABLE t3 LIKE t2; INSERT INTO t3 SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `test`.`t3`.`target` UPDATE t3 SET target=source; -ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `test`.`t3`.`target` UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; -ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET' -SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type); +ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `test`.`t3`.`target` +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); SELECT @alter; @alter ALTER TABLE t3 MODIFY target int(10) unsigned EXECUTE IMMEDIATE @alter; -ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `test`.`t3`.`target` DROP TABLE t3; DROP TABLE t2; CREATE PROCEDURE p1() @@ -103,15 +108,15 @@ SET dst=src; END; $$ CALL p1; -ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `dst` DROP PROCEDURE p1; CREATE FUNCTION f1(a uuid) RETURNS INT RETURN NULL;; SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `a` DROP FUNCTION f1; CREATE PROCEDURE p1(a uuid) BEGIN END;; CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `a` DROP PROCEDURE p1; CREATE PROCEDURE p1(OUT dst uuid) BEGIN @@ -126,10 +131,10 @@ CALL p1(dst); END; $$ CALL p2(); -ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `dst` SHOW WARNINGS; Level Code Message -Error 4078 Illegal parameter data types uuid and int unsigned for operation 'SET' +Error 4078 Cannot cast 'int unsigned' as 'uuid' in assignment of `dst` Note 4094 At line 4 in test.p1 Note 4094 At line 4 in test.p2 DROP PROCEDURE p2; @@ -141,7 +146,7 @@ RETURN rc; END; $$ SELECT f1(); -ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `f1()` DROP FUNCTION f1; CREATE PROCEDURE p1() BEGIN @@ -152,7 +157,7 @@ CLOSE cur1; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `t` DROP PROCEDURE p1; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (); @@ -166,13 +171,14 @@ CLOSE cur2; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `dst` DROP PROCEDURE p1; DROP TABLE t2; # End of type_store_assignment_incompatible.inc DROP TABLE t1; CREATE TABLE t1 (target INT UNSIGNED DEFAULT 0, source UUID DEFAULT '00000000-0000-0000-0000-000000000000'); # Start of type_store_assignment_incompatible.inc +SET @sql_mode_save= @@sql_mode; SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='source' AND TABLE_NAME='t1' @@ -181,6 +187,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='target' AND TABLE_NAME='t1' AND TABLE_SCHEMA='test'); +SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN '' + WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore) +ELSE @ignore +END; CREATE TABLE t2 LIKE t1; ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST; INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT); @@ -197,7 +207,7 @@ INSERT INTO t3 VALUES (1, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `test`.`t3`.`target` DROP TABLE t3; SET sql_mode=''; CREATE TABLE t3 LIKE t2; @@ -229,37 +239,37 @@ INSERT INTO t3 VALUES (2, (SELECT source FROM t2 ORDER BY id LIMIT 1), (SELECT source FROM t2 ORDER BY id LIMIT 1)); -Got one of the listed errors +ERROR 01000: Data truncated for column 'target' at row 2 SELECT * FROM v3; id target source 1 0 00000000-0000-0000-0000-000000000000 TRUNCATE TABLE t3; -SET sql_mode=DEFAULT; +SET sql_mode=@sql_mode_save; DROP TABLE t3; DROP VIEW v3; CREATE TABLE t3 LIKE t2; INSERT INTO t3 SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2; -ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `test`.`t3`.`target` INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source; -ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `test`.`t3`.`target` INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `test`.`t3`.`target` INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source; -ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `test`.`t3`.`target` UPDATE t3 SET target=source; -ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `test`.`t3`.`target` UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id; -ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET' -SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type); +ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `test`.`t3`.`target` +SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type); SELECT @alter; @alter ALTER TABLE t3 MODIFY target uuid EXECUTE IMMEDIATE @alter; -ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET' +ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `test`.`t3`.`target` DROP TABLE t3; DROP TABLE t2; CREATE PROCEDURE p1() @@ -270,15 +280,15 @@ SET dst=src; END; $$ CALL p1; -ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `dst` DROP PROCEDURE p1; CREATE FUNCTION f1(a int(10) unsigned) RETURNS INT RETURN NULL;; SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `a` DROP FUNCTION f1; CREATE PROCEDURE p1(a int(10) unsigned) BEGIN END;; CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1)); -ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `a` DROP PROCEDURE p1; CREATE PROCEDURE p1(OUT dst int(10) unsigned) BEGIN @@ -293,10 +303,10 @@ CALL p1(dst); END; $$ CALL p2(); -ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `dst` SHOW WARNINGS; Level Code Message -Error 4078 Illegal parameter data types int unsigned and uuid for operation 'SET' +Error 4078 Cannot cast 'uuid' as 'int unsigned' in assignment of `dst` Note 4094 At line 4 in test.p1 Note 4094 At line 4 in test.p2 DROP PROCEDURE p2; @@ -308,7 +318,7 @@ RETURN rc; END; $$ SELECT f1(); -ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `f1()` DROP FUNCTION f1; CREATE PROCEDURE p1() BEGIN @@ -319,7 +329,7 @@ CLOSE cur1; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `t` DROP PROCEDURE p1; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (); @@ -333,7 +343,7 @@ CLOSE cur2; END; $$ CALL p1(); -ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET' +ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `dst` DROP PROCEDURE p1; DROP TABLE t2; # End of type_store_assignment_incompatible.inc |