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

Different handling of out-of-range values for virtual columns with and without indexes

    XMLWordPrintable

Details

    Description

      No index, no warning

      MariaDB [test]> CREATE TABLE t1 (i INT, vc TINYINT AS (i) VIRTUAL);
      Query OK, 0 rows affected (0.54 sec)
       
      MariaDB [test]> INSERT INTO t1 (i) VALUES (1000);
      Query OK, 1 row affected (0.07 sec)
      

      Warning with index

      MariaDB [test]> CREATE TABLE t1 (i INT, vc TINYINT AS (i) VIRTUAL, INDEX(vc));
      Query OK, 0 rows affected (0.63 sec)
       
      MariaDB [test]> INSERT INTO t1 (i) VALUES (1000);
      Query OK, 1 row affected, 1 warning (0.08 sec)
       
      MariaDB [test]> SHOW WARNINGS;
      +---------+------+---------------------------------------------+
      | Level   | Code | Message                                     |
      +---------+------+---------------------------------------------+
      | Warning | 1264 | Out of range value for column 'vc' at row 1 |
      +---------+------+---------------------------------------------+
      1 row in set (0.00 sec)
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.