Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.5, 10.6, 10.11, 11.1(EOL), 11.2, 11.4, 10.4(EOL), 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 11.0(EOL), 11.3(EOL), 11.5(EOL)
-
None
Description
Direct assignment between some data types is now allowed. For example, it's not possible to store an INT into a POINT:
CREATE OR REPLACE TABLE t1 (b POINT); |
INSERT INTO t1 VALUES (1); |
ERROR 4078 (HY000): Cannot cast 'int' as 'point' in assignment of `test`.`t1`.`b` |
CREATE OR REPLACE TABLE t1 (a INT, b POINT); |
UPDATE t1 SET b=a; |
ERROR 4078 (HY000): Cannot cast 'int' as 'point' in assignment of `test`.`t1`.`b` |
However, virtual columns do not check if the assignment is OK:
CREATE OR REPLACE TABLE t1 (a INT, b POINT GENERATED ALWAYS AS (a)); |
INSERT INTO t1 (a) VALUES (1); |
SELECT a, AsText(b) FROM t1; |
SHOW WARNINGS;
|
+---------+------+---------------------------------------------------------------------+ |
| Level | Code | Message | |
+---------+------+---------------------------------------------------------------------+ |
| Warning | 1416 | Cannot get geometry object from data you send to the GEOMETRY field | |
+---------+------+---------------------------------------------------------------------+ |
This looks incorrect. The 'Cannot cast' error should be displayed at CREATE TABLE time.
Attachments
Issue Links
- relates to
-
MDEV-20610 Assertion failed or btr_validate_index(..) in row_upd_sec_index_entry on a time_zone change
- Stalled