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

Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER

    XMLWordPrintable

Details

    Description

      SET sql_mode='';
      CREATE OR REPLACE TABLE t1 (a INET6, b INT UNSIGNED);
      INSERT INTO t1 VALUES (NULL, 0x61);
      UPDATE t1 SET a=b;
      SHOW WARNINGS;
      SELECT * FROM t1;
      

      +---------+------+-----------------------------------------------------------------+
      | Level   | Code | Message                                                         |
      +---------+------+-----------------------------------------------------------------+
      | Warning | 1292 | Incorrect inet6 value: '97' for column `test`.`t1`.`a` at row 1 |
      +---------+------+-----------------------------------------------------------------+
      

      +------+------+
      | a    | b    |
      +------+------+
      | ::   |   97 |
      +------+------+
      

      SET sql_mode='';
      CREATE OR REPLACE TABLE t1 (a INT UNSIGNED);
      INSERT INTO t1 VALUES (0x61);
      ALTER TABLE t1 MODIFY a INET6;
      SHOW WARNINGS;
      SELECT * FROM t1;
      

      +---------+------+-----------------------------------------------------------------+
      | Level   | Code | Message                                                         |
      +---------+------+-----------------------------------------------------------------+
      | Warning | 1292 | Incorrect inet6 value: '97' for column `test`.`t1`.`a` at row 1 |
      +---------+------+-----------------------------------------------------------------+
      

      +------+
      | a    |
      +------+
      | NULL |
      +------+
      

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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