Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.7(EOL), 10.8(EOL), 10.9(EOL)
-
None
Description
The patch MDEV-28918 disallowed incompatible data type assignment for columns of the GEOMETRY, INET6, UUID types when they are mixed with numeric or temporal values (and the other way around), so such wrong mixes get detected at the statement preparation time:
CREATE OR REPLACE TABLE t1 (a GEOMETRY); |
INSERT INTO t1 VALUES (1); |
ERROR 4078 (HY000): Illegal parameter data types geometry and int for operation 'SET'
|
CREATE OR REPLACE TABLE t1 (a UUID); |
INSERT INTO t1 VALUES (1); |
ERROR 4078 (HY000): Illegal parameter data types uuid and int for operation 'SET'
|
CREATE OR REPLACE TABLE t1 (a INET6); |
INSERT INTO t1 VALUES (1); |
ERROR 4078 (HY000): Illegal parameter data types inet6 and int for operation 'SET'
|
But wrong data type assignment is still possible through SP. Wrong types mixes do not detected at the preparation time:
CREATE OR REPLACE FUNCTION f1(a GEOMETRY) RETURNS INT RETURN NULL; |
SELECT f1(1); |
ERROR 1416 (22003): Cannot get geometry object from data you send to the GEOMETRY field
|
CREATE OR REPLACE PROCEDURE p1(a GEOMETRY) BEGIN END; |
CALL p1(1);
|
ERROR 1416 (22003): Cannot get geometry object from data you send to the GEOMETRY field
|
CREATE OR REPLACE FUNCTION f1(a UUID) RETURNS INT RETURN NULL; |
SELECT f1(1); |
ERROR 1292 (22007): Incorrect uuid value: '1' for column ``.``.`a` at row 1
|
CREATE OR REPLACE PROCEDURE p1(a UUID) BEGIN END; |
CALL p1(1);
|
ERROR 1292 (22007): Incorrect uuid value: '1' for column ``.``.`a` at row 0
|
Notice, an error does happen, but during the assignment statement execution time, which leads to a different error.
For consistency, all these cases when an assignment happens:
- Stored routine local variables
- Stored routine IN parameters
- Stored routine OUT parameters
- Stored function RETURN values
- Cursor IN parameters
- FETCH
should detect wrong data types mixes and raise the "Illegal parameter data types" error.
Attachments
Issue Links
- relates to
-
MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
- Closed