Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-27885

Unexpected delete when data truncation

    XMLWordPrintable

Details

    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.

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            John Jove John Jove
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.