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

Incorrect query result may caused by COS funciton

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.3.13, 11.4.1
    • None
    • Optimizer
    • None
    • Ubuntu 22.04 CLI

    Description

      Description

      Dear devps, Our fuzzer may found a bug.

      Consider the following statements, qeury1 and query2 should reutrn the same reuslt. However, qeury1 return nothing while query2 return 1567981295. Additionally, The reuslt in MySQL is correct

      -- query1
      mysql> SELECT t0.c0 FROM t0 WHERE COS(t0.c0);
      Empty set (0.00 sec)
       
      --query2
      mysql> SELECT c0 FROM (SELECT t0.c0, COS(t0.c0) IS TRUE AS flag FROM t0) AS t WHERE flag=1;
      +------------+
      | c0         |
      +------------+
      | 1567981295 |
      +------------+
      1 row in set (0.01 sec)
      
      

      How to repeat

      The bug can be reproduced from from 10.3.13 to 11.4.1

      CREATE TABLE IF NOT EXISTS t0(c0 BIGINT);
      INSERT INTO t0 VALUES (1567981295);
       
      SELECT t0.c0 FROM t0 WHERE COS(t0.c0);
      SELECT c0 FROM (SELECT t0.c0, COS(t0.c0) IS TRUE AS flag FROM t0) AS t WHERE flag=1;
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            Shiyang Ye Shiyang Ye
            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.