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

NULL is treated as 0 in CTE

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.2
    • 10.2
    • Optimizer - CTE
    • None

    Description

      Current 10.2 and 10.3 behave different on NULL

      10.3

      MariaDB [test]> select version();
      +----------------------+
      | version()            |
      +----------------------+
      | 10.3.8-MariaDB-debug |
      +----------------------+
      1 row in set (0.000 sec)
       
      MariaDB [test]> WITH RECURSIVE qn AS (SELECT 123 AS a UNION ALL
          -> SELECT NULL FROM qn WHERE a IS NOT NULL) SELECT * FROM qn;
      +------+
      | a    |
      +------+
      |  123 |
      | NULL |
      +------+
      2 rows in set (0.002 sec)
      

      10.2 is producing 123, 0,0,0,0,...

      MariaDB [test]> WITH RECURSIVE qn AS (SELECT 123 AS a UNION ALL
          -> SELECT NULL FROM qn WHERE a IS NOT NULL) SELECT * FROM qn;
      ^CCtrl-C -- query killed. Continuing normally.
      ERROR 1317 (70100): Query execution was interrupted
       
      MariaDB [test]> select version();
      +-----------------------+
      | version()             |
      +-----------------------+
      | 10.2.16-MariaDB-debug |
      +-----------------------+
      1 row in set (0.00 sec)
      

      Attachments

        Issue Links

          Activity

            People

              igor Igor Babaev
              alice Alice Sherepa
              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.