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

LP:809206 - Wrong result with DISTINCT + multipart keys after WL#106

    XMLWordPrintable

Details

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

    Description

      Not repeatable before WL#106. Not repeatable with mysql-5.5 . Not repeatable without views. Not influenced by any optimizer switches.

      Even after the fix for 806097 the following query:

      SELECT DISTINCT t1.b FROM t2 JOIN ( t1 JOIN t3 ON t3.a = t1.d) ;

      does not return all rows if executed with a derived table or a view.

      explain:

      1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2  
      2 DERIVED t2 system NULL NULL NULL NULL 1 Using temporary
      2 DERIVED t3 ALL NULL NULL NULL NULL 2 Using where; Distinct
      2 DERIVED t1 ref d d 5 bug.t3.a 1 Using where; Distinct

      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=off,derived_merge=on,derived_with_keys=on,firstmatch=off,loosescan=off,materialization=on,in_to_exists=on,semijoin=off,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,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=on,table_elimination=on

      bzr version-info:

      revision-id: <email address hidden>
      date: 2011-07-11 10:56:48 -0700
      build-date: 2011-07-12 12:09:03 +0300
      revno: 3100
      branch-nick: maria-5.3

      test case:

      CREATE TABLE t1 ( b int , c int, d int , KEY (d,c) ) ;
      INSERT INTO t1 VALUES (28,0,'j'),(29,8,'c');

      CREATE TABLE t2 ( a int) ;
      INSERT INTO t2 VALUES (0);

      CREATE TABLE t3 ( a varchar(32)) ;
      INSERT INTO t3 VALUES ('j'),('c');

      SELECT * FROM ( SELECT DISTINCT t1.b FROM t2 JOIN ( t1 JOIN t3 ON t3.a = t1.d) ) AS a1;

      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.