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

Crash after pushing down condition with DEFAULT to derived table

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.5
    • 10.5.27
    • Optimizer
    • None

    Description

      CREATE TABLE t1 (c1 INT);
      INSERT INTO t1 VALUES (1);
      CREATE TABLE t2 (c2 INT);
      INSERT INTO t2 VALUES (1);
       
      SET optimizer_switch='derived_merge=off';
       
      EXPLAIN EXTENDED
           SELECT dt1_c1 FROM 
             (SELECT c1 AS dt1_c1 FROM t1) AS dt1
             JOIN 
             (SELECT 1 AS dt2_c2 FROM t2) AS dt2
                ON DEFAULT(dt2_c2) BETWEEN dt1_c1 AND dt1_c1;
      

      Attachments

        Issue Links

          Activity

            oleg.smirnov Oleg Smirnov added a comment -

            alice, I'm not sure: the call stacks are not identical (there is Item_str_func::fix_fields at MDEV-25012), and the queries look different. Let's just link the tasks

            oleg.smirnov Oleg Smirnov added a comment - alice , I'm not sure: the call stacks are not identical (there is Item_str_func::fix_fields at MDEV-25012 ), and the queries look different. Let's just link the tasks

            Note:
            There is at least one odd thing happening here that wasn't happening in MDEV-33010: In pushdown_cond_for_derived() I see this:

            (gdb) p dbug_print_item(cond)
              $44 = 0x5555577f6de0 <dbug_item_print_buf> "default(dt2.dt2_c2) between dt1.dt1_c1 and dt1.dt1_c1"
            (gdb) p dbug_print_item(extracted_cond)
              $45 = 0x5555577f6de0 <dbug_item_print_buf> "dt2.dt2_c2 between dt1.dt1_c1 and dt1.dt1_c1"
            

            The "Extraction" of pushable condition turned default(dt2.dt2_c2) into just dt2.dt2_c2.

            psergei Sergei Petrunia added a comment - Note: There is at least one odd thing happening here that wasn't happening in MDEV-33010 : In pushdown_cond_for_derived() I see this: (gdb) p dbug_print_item(cond) $44 = 0x5555577f6de0 <dbug_item_print_buf> "default(dt2.dt2_c2) between dt1.dt1_c1 and dt1.dt1_c1" (gdb) p dbug_print_item(extracted_cond) $45 = 0x5555577f6de0 <dbug_item_print_buf> "dt2.dt2_c2 between dt1.dt1_c1 and dt1.dt1_c1" The "Extraction" of pushable condition turned default(dt2.dt2_c2) into just dt2.dt2_c2 .
            oleg.smirnov Oleg Smirnov added a comment -

            Seems to be a duplicate of MDEV-31007, MDEV-34695.

            oleg.smirnov Oleg Smirnov added a comment - Seems to be a duplicate of MDEV-31007 , MDEV-34695 .

            People

              oleg.smirnov Oleg Smirnov
              oleg.smirnov Oleg Smirnov
              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.