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

LP:823826 - Wrong result / WHERE not observed with derived_merge and inner join in maria-5.3

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      The following query:

      SELECT * FROM ( SELECT t2.* FROM t1 , t2 ) AS alias1 WHERE b IS NULL;

      returns rows for which b IS NOT NULL

      MariaDB [test]> explain SELECT * FROM ( SELECT t2.* FROM t1 , t2 ) AS alias1 WHERE b IS NULL ;
      ------------------------------------------------------------------------------------------+

      id select_type table type possible_keys key key_len ref rows Extra

      ------------------------------------------------------------------------------------------+

      1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
      1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join)

      ------------------------------------------------------------------------------------------+

      minimal optimizer switch:derived_merge=on
      full optimizer_switch:
      index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on

      bzr version-info
      revision-id: <email address hidden>
      date: 2011-08-09 18:34:26 +0300
      build-date: 2011-08-10 13:04:33 +0300
      revno: 3148
      branch-nick: maria-5.3

      test case:

      CREATE TABLE t1 (a int) ;
      INSERT INTO t1 VALUES (1),(1);

      CREATE TABLE t2 (b int) ;
      INSERT INTO t2 VALUES (NULL),(6);

      SET SESSION optimizer_switch='derived_merge=on';

      SELECT * FROM ( SELECT t2.* FROM t1 , t2 ) AS alias1 WHERE b IS NULL;

      Attachments

        Activity

          People

            igor Igor Babaev (Inactive)
            philipstoev Philip Stoev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 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.