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

Wrong/Unexpected result with the value optimizer_use_condition_selectivity set to 4

    XMLWordPrintable

    Details

    • Sprint:
      10.3.6-1

      Description

      Here is the mtr test,

      CREATE TABLE t1 (a INT);
      INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
      set optimizer_use_condition_selectivity=4;
      CREATE FUNCTION f1() RETURNS INT DETERMINISTIC
      BEGIN
      SET @cnt := @cnt + 1;
      RETURN 1;
      END;|
      SET @cnt := 0;
      SELECT * FROM t1 WHERE a = f1();
      a
      1
      SELECT @cnt;
      @cnt
      2
      SET @cnt := 0;
      set optimizer_use_condition_selectivity=1;
      SELECT * FROM t1 WHERE a = f1();
      a
      1
      drop table t1;
      drop function f1;
      

      cc Igor BabaevSergei Petrunia

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              varun Varun Gupta
              Reporter:
              varun Varun Gupta
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: