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

Unexpected UPDATE behavior under strict sql_mode

    XMLWordPrintable

    Details

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              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.