[MDEV-27741] No datatype validation for indexed column on UPDATE Created: 2022-02-03  Updated: 2022-02-10

Status: Open
Project: MariaDB Server
Component/s: Parser
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Ralf Gebhardt Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

The server is behaving differently regarding the validation of data types for indexed and non indexed columns.

MariaDB [test]> CREATE TABLE `tc4091` (
    ->     `int_1` int,
    ->     `int_2` int,
    ->     KEY (`int_1`)
    ->     );
Query OK, 0 rows affected (0.017 sec)
 
MariaDB [test]>     INSERT INTO tc4091 (int_1,int_2) values (1,1);
Query OK, 1 row affected (0.001 sec)
 
MariaDB [test]>     UPDATE tc4091 SET int_2 = 4 WHERE int_1 = 'a';
Query OK, 0 rows affected (0.000 sec)
Rows matched: 0  Changed: 0  Warnings: 0
 
MariaDB [test]>     UPDATE tc4091 SET int_2 = 4 WHERE int_2 = 'a';
ERROR 1292 (22007): Truncated incorrect DOUBLE value: 'a'
MariaDB [test]>     DROP TABLE tc4091;
Query OK, 0 rows affected (0.007 sec)


Generated at Thu Feb 08 09:55:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.