[MDEV-28142] Unexpected UPDATE behavior under strict sql_mode Created: 2022-03-21  Updated: 2022-04-26

Status: Open
Project: MariaDB Server
Component/s: Data Manipulation - Update
Affects Version/s: 10.7.3
Fix Version/s: None

Type: Bug Priority: Major
Reporter: John Jove Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: innodb
Environment:

OS: Ubuntu-20.04 LTS


Issue Links:
Relates
relates to MDEV-19362 New STRICT flags for sql_mode Open
relates to MDEV-28069 A misleading warning message from the... Open

 Description   

/* init */ CREATE TABLE t (c1 TEXT);
/* init */ INSERT INTO t VALUES ('a');
 
mariadb> SELECT * FROM t;
+------+
| c1   |
+------+
| a    |
+------+
1 row in set, 1 warning (0.00 sec)
 
mariadb> UPDATE t SET c1 = 'b' WHERE CAST(IF('a', '1', 1) AS SIGNED);
Query OK, 1 row affected, 1 warning (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 1
 
mariadb> SELECT * FROM t;
+------+
| c1   |
+------+
| b    |
+------+
1 row in set (0.00 sec)

Under strict sql_mode, the UPDATE statement should report an error rather than reports a warning and successfully modifies the record.



 Comments   
Comment by John Jove [ 2022-04-26 ]

In MariaDB manual, under strict sql_mode, the statements that modify tables will return an error, except that IGNORE keyword is used to convert the error to a warning. I am confused. Should the UPDATE statement be allowed successfully modify the table with a warning?

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