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

Some optimizer hint warnings are returned as errors

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 12.0(EOL)
    • 12.0.1
    • Optimizer
    • None

    Description

      Testcase:
      In 1st query ER_WARN_CONFLICTING_HINT is returned as warning, in the 2d - as error:

      CREATE TABLE t1 (id  int(11) NOT NULL auto_increment, f1 INT NOT NULL, PRIMARY KEY  (id));
      INSERT INTO t1 (id, f1) VALUES (1,9),(2,0), (3,7);
       
      CREATE TABLE t2 (id  int(11), f2 INT NOT NULL);
      INSERT INTO t2 (id, f2) VALUES
      (4,5),(3,3),(1,0),(1,3),(6,1),(2,0),(4,1),(2,7),(2,1),(1,0),(3,0),(5,8),(5,4),(3,9),(2,0),(7,2),(2,0),(1,8),(6,5),(4,1);
       
      SET SQL_MODE='STRICT_TRANS_TABLES';
       
      CREATE TABLE tn (fn_1 INT, fn_2 INT);
       
      EXPLAIN EXTENDED
      INSERT INTO tn (fn_1, fn_2) SELECT  /*+ JOIN_ORDER(t2,t1) JOIN_FIXED_ORDER() */ f1,f2 FROM t2  JOIN t1 ON t1.id=t2.id ORDER BY f1, f2;
       
      EXPLAIN EXTENDED
      INSERT INTO tn (fn_1, fn_2) SELECT  /*+ JOIN_ORDER(t1,t2) */ f1,f2 FROM t2 LEFT JOIN t1 ON t1.id=t2.id ORDER BY f1, f2;
       
      drop table tn;
      drop table t1, t2;
      

      Results:
      1st query:

      Warnings:
      Warning	4210	Hint JOIN_FIXED_ORDER() is ignored as conflicting/duplicated
      

      2d query:

       At line 48: query 'EXPLAIN EXTENDED
      INSERT INTO tn (fn_1, fn_2) SELECT  /*+ JOIN_ORDER(t1,t2) */ f1,f2 FROM t2 LEFT JOIN t1 ON t1.id=t2.id ORDER BY f1, f2' failed: ER_WARN_CONFLICTING_HINT (4210): Hint JOIN_ORDER(`t1`,`t2`) is ignored as conflicting/duplicated
      

      Attachments

        Issue Links

          Activity

            People

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