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

Unexpected error on `WHERE inet6col`

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6, 11.5(EOL)
    • 10.6
    • None
    • None

    Description

      This script:

      CREATE OR REPLACE TABLE t1 (a INET6);
      INSERT INTO t1 VALUES ('::'),('::1');
      SELECT * FROM t1 WHERE a IS TRUE;
      

      produces the following output:

      +------+
      | a    |
      +------+
      | ::1  |
      +------+
      

      Looks good so far.

      Now if I run:

      SELECT * FROM t1 WHERE a;
      

      it returns an unexpected error:

      ERROR 4078 (HY000): Illegal parameter data types inet6 and bigint for operation '<>'
      

      The problem is that the condition:

      WHERE column
      

      gets rewritten by the parser into:

      WHERE column<>0
      

      which is not applicable in case of INET6.

      It should probably be rewritten to:

      WHERE column IS TRUE
      

      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:

                Git Integration

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