[MDEV-27885] Unexpected delete when data truncation Created: 2022-02-18  Updated: 2023-11-28

Status: Confirmed
Project: MariaDB Server
Component/s: Data Manipulation - Delete
Affects Version/s: 10.8.2
Fix Version/s: 10.11

Type: Bug Priority: Major
Reporter: John Jove Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Ubuntu 20.04LTS



 Description   

I try the following statements on MariaDB-10.8.2:

DROP TABLE IF EXISTS t0;
CREATE TABLE t0 (c0 varchar(5));
INSERT INTO t0 VALUES('a'), ('1');
DELETE FROM t0 WHERE NOT c0;

The DELETE statement deleted the first row, and a warning was generated.
I try a UPDATE statement, which share the same where clause with the above DELETE statement, as follows:

DROP TABLE IF EXISTS t0;
CREATE TABLE t0 (c0 varchar(5));
INSERT INTO t0 VALUES('a'), ('1');
UPDATE t0 SET c0 = 'b' WHERE NOT c0;

The UPDATE statement failed and generated an error.
I think the data truncation of value 'a' should also cause this DELETE statement errors instead of a warning. Because UPDATE and DELETE are both data-change statements.


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