From 3ebbfd88a0360938e3a5a480265beb2a71b1268a Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 2 Aug 2022 16:23:08 +0400 Subject: 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. --- mysql-test/suite/innodb_gis/r/0.result | 4 ++-- mysql-test/suite/innodb_gis/r/1.result | 4 ++-- mysql-test/suite/innodb_gis/r/gis.result | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'mysql-test/suite/innodb_gis') diff --git a/mysql-test/suite/innodb_gis/r/0.result b/mysql-test/suite/innodb_gis/r/0.result index 3f72baadd12..355f8958018 100644 --- a/mysql-test/suite/innodb_gis/r/0.result +++ b/mysql-test/suite/innodb_gis/r/0.result @@ -452,9 +452,9 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field drop table t1; create table t1 (pk integer primary key auto_increment, fl geometry not null); insert into t1 (fl) values (1); -ERROR HY000: Illegal parameter data types geometry and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t1`.`fl` insert into t1 (fl) values (1.11); -ERROR HY000: Illegal parameter data types geometry and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'geometry' in assignment of `test`.`t1`.`fl` insert into t1 (fl) values ("qwerty"); ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field insert into t1 (fl) values (pointfromtext('point(1,1)')); diff --git a/mysql-test/suite/innodb_gis/r/1.result b/mysql-test/suite/innodb_gis/r/1.result index 1c286ff6ce4..1d7b188e0e3 100644 --- a/mysql-test/suite/innodb_gis/r/1.result +++ b/mysql-test/suite/innodb_gis/r/1.result @@ -660,9 +660,9 @@ object_id ST_geometrytype(geo) ST_ISSIMPLE(GEO) ST_ASTEXT(ST_centroid(geo)) drop table t1; create table t1 (fl geometry not null); insert into t1 values (1); -ERROR HY000: Illegal parameter data types geometry and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t1`.`fl` insert into t1 values (1.11); -ERROR HY000: Illegal parameter data types geometry and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'geometry' in assignment of `test`.`t1`.`fl` insert into t1 values ("qwerty"); ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field insert into t1 values (ST_pointfromtext('point(1,1)')); diff --git a/mysql-test/suite/innodb_gis/r/gis.result b/mysql-test/suite/innodb_gis/r/gis.result index a976bbccaa9..0aa379df487 100644 --- a/mysql-test/suite/innodb_gis/r/gis.result +++ b/mysql-test/suite/innodb_gis/r/gis.result @@ -661,9 +661,9 @@ object_id ST_geometrytype(geo) ST_ISSIMPLE(GEO) ST_ASTEXT(ST_centroid(geo)) drop table t1; create table t1 (fl geometry not null); insert into t1 values (1); -ERROR HY000: Illegal parameter data types geometry and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t1`.`fl` insert into t1 values (1.11); -ERROR HY000: Illegal parameter data types geometry and decimal for operation 'SET' +ERROR HY000: Cannot cast 'decimal' as 'geometry' in assignment of `test`.`t1`.`fl` insert into t1 values ("qwerty"); ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field insert into t1 values (ST_pointfromtext('point(1,1)')); -- cgit v1.2.1