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

2-argument CRC32 and CRC32C don't work in virtual column expressions

    XMLWordPrintable

    Details

      Description

      create or replace table t (a varchar(16), i int, c int unsigned as (crc32(i,a)));
      insert into t (a,i) values ('foo',1);
      select * from t;
      

      preview-10.8-MDEV-27265-misc 3d04e67d

      +------+------+------------+
      | a    | i    | c          |
      +------+------+------------+
      | foo  |    1 | 2212294583 |
      +------+------+------------+
      1 row in set, 1 warning (0.001 sec)
       
      MariaDB [test]> show warnings;
      +---------+------+------------------------------------------+
      | Level   | Code | Message                                  |
      +---------+------+------------------------------------------+
      | Warning | 1292 | Truncated incorrect INTEGER value: 'foo' |
      +---------+------+------------------------------------------+
      1 row in set (0.000 sec)
      

      This works (from the same table):

      MariaDB [test]> select crc32(i,a) from t;
      +------------+
      | crc32(i,a) |
      +------------+
      | 2377191190 |
      +------------+
      1 row in set (0.001 sec)
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              marko Marko Mäkelä
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.