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

    • 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 igorpsergey

      Attachments

        Issue Links

          Activity

            People

              varun Varun Gupta (Inactive)
              varun Varun Gupta (Inactive)
              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.