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

There are some problems with the keyword 'where if'

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 11.4.2
    • N/A
    • Data types
    • None
    • ubuntu 20.04

    Description

      This statement returns result 1 in mysql but empty sets in mariadb.
      mariadb:

         CREATE TABLE t0(c0 INT);
        INSERT INTO t0(c0) VALUES(1);
       SELECT * FROM t0 WHERE IF(FALSE, t0.c0, 0.1);
      --Empty set 
      
      

      mysql:

         CREATE TABLE t0(c0 INT);
        INSERT INTO t0(c0) VALUES(1);
       SELECT * FROM t0 WHERE IF(FALSE, t0.c0, 0.1);
       --1 
      

      Attachments

        Issue Links

          Activity

            danblack Daniel Black added a comment -

            Thanks for the bug report Wangdada.

            There's an existing bug report MDEV-34123 that covers the case. MariaDB is rounding the float to 0 to treat it as a boolean rather than just treating it as non-0.

            danblack Daniel Black added a comment - Thanks for the bug report Wangdada . There's an existing bug report MDEV-34123 that covers the case. MariaDB is rounding the float to 0 to treat it as a boolean rather than just treating it as non-0.

            People

              Unassigned Unassigned
              Wangdada HeShan
              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.