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

CAST from INET6 to FLOAT does not produce an error

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.5
    • 10.5.0
    • Data types
    • None

    Description

      According to MDEV-274, CAST from INET6 to anything other than CHAR or BINARY should produce an error. It doesn't for FLOAT (while it does for DOUBLE):

      create table t1 (a inet6);
      insert into t1 values ('::');
      select cast(a as float) from t1;
      

      10.5 b5fae7f7

      MariaDB [test]> select cast(a as float) from t1;
      +------------------+
      | cast(a as float) |
      +------------------+
      |                0 |
      +------------------+
      1 row in set (0.000 sec)
      

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            Description According to MDEV-274, {{CAST}} from {{INET6}} to anything other than {{CHAR}} or {{BINARY}} should produce an error. It doesn't for {{FLOAT}} (while it does for {{DOUBLE}}:

            {code:sql}
            create table t1 (a inet6);
            insert into t1 values ('::');
            select cast(a as float) from t1;
            {code}

            {code:sql|title=10.5 b5fae7f7}
            MariaDB [test]> select cast(a as float) from t1;
            +------------------+
            | cast(a as float) |
            +------------------+
            | 0 |
            +------------------+
            1 row in set (0.000 sec)
            {code}
            According to MDEV-274, {{CAST}} from {{INET6}} to anything other than {{CHAR}} or {{BINARY}} should produce an error. It doesn't for {{FLOAT}} (while it does for {{DOUBLE}}):

            {code:sql}
            create table t1 (a inet6);
            insert into t1 values ('::');
            select cast(a as float) from t1;
            {code}

            {code:sql|title=10.5 b5fae7f7}
            MariaDB [test]> select cast(a as float) from t1;
            +------------------+
            | cast(a as float) |
            +------------------+
            | 0 |
            +------------------+
            1 row in set (0.000 sec)
            {code}
            bar Alexander Barkov made changes -
            issue.field.resolutiondate 2019-10-11 16:16:19.0 2019-10-11 16:16:19.169
            bar Alexander Barkov made changes -
            Fix Version/s 10.5.0 [ 23709 ]
            Fix Version/s 10.5 [ 23123 ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 100361 ] MariaDB v4 [ 156851 ]

            People

              bar Alexander Barkov
              elenst Elena Stepanova
              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.