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

Optimizer hints ignored after STRAIGHT_JOIN

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • 12.0
    • Optimizer
    • None

    Description

      New-style optimizer hints are ignored if a query has STRAIGHT_JOIN hint before them:

      CREATE TABLE t1 (f1 INT NOT NULL);
      INSERT INTO t1 VALUES (1),(2),(3);
       
      CREATE TABLE t2 (f1 INT NOT NULL);
      INSERT INTO t2 VALUES (3),(1),(8),(3);
       
      EXPLAIN EXTENDED SELECT STRAIGHT_JOIN /*+ NO_BNL()*/  * FROM t1, t2;
       
      DROP TABLE t1, t2;
      

      Compare this with the case

      EXPLAIN EXTENDED SELECT /*+ NO_BNL()*/  STRAIGHT_JOIN * FROM t1, t2;
      

      where the STRAIGHT_JOIN hint follows new-style hints. Here new-style hint is parsed and applied.

      Interaction with other old-style hints should be also tested.

      Attachments

        Issue Links

          Activity

            People

              oleg.smirnov Oleg Smirnov
              oleg.smirnov Oleg Smirnov
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.