List:Commits« Previous MessageNext Message »
From:magnus.blaudd Date:April 18 2012 2:47pm
Subject:bzr push into mysql-5.5-cluster-7.2 branch (magnus.blaudd:3890 to 3891)
View as plain text  
 3891 magnus.blaudd@stripped	2012-04-18 [merge]
      Merge

    modified:
      mysql-test/lib/mtr_cases.pm
      mysql-test/mysql-test-run.pl
      mysql-test/suite/ndb_memcache/include/have_memcache.inc
 3890 Ole John Aske	2012-04-18
      Fix for bug#13901890 SQL NODE CRASHES DURING INSERT SELECT
      
      There was a bug in the lifetime handling of NdbQuery objects
      where the 'root' of the pushed join had 'type == const'
      
      As part of integrating the pushed join feature into the 
      ha_ndbcluster handler implementation, the default implementation
      of handler::index_read_idx_map() was redefined. This method is
      used as the access function to read the (single) row when
      a table is const'ified by the optimizer.
      
      Basically handler::index_read_idx_map() does (ignoring error handling):
      
        index_init(index, 0);  // Open table for access
        index_read_map();      // Virtual method reading single row
        index_end();           // Return table to 'closed' state + release
      
      As the above 'index_end' would also destruct the resultset from
      the pushed join, including the child result, we could not do that 
      for a pushed join.
      
      Therefore, ha_ndblcluster::index_read_idx_map() was implemented *without*
      the final index_end() call - Our investigation at that time indicated that
      this could be omitted as the open tables was cleaned up anyway, either by the
      next operation on the handler instance, or when the NdbTransaction was terminated.
      
      However, this bugs uncovers that there are codepaths where we both:
      
      - Terminate NdbTransaction, which destruct the NdbQuery object.
      - Then call ha_ndbcluster::reset() to clean up the handler, which will
        result in NdbQuery::close() to be called -> Crash!
      
      Working with this problem I realized that:
      
      - In order to increase pushability we have already introduced the 
        handler::test_push_flag(HA_PUSH_BLOCK_CONST_TABLE) inside the optimizer
        which will block the const'ifying during optimize.
      - It will then only be confusing to still explain these query plan
        having a type == 'const' as they are now really executed as an eq_ref
      - Override ::index_read_idx_map() to suite pushed join execution is
        obsolete if we instead handle these queries as an eq_ref.
      
      These changes does *not* affect the pushability of the queries, nor
      changes number of handler call required to retrieve the data.
      
      However, several EXPLAINS will change where 'type == const' will
      now show 'type==eq_ref' instead which IMHO is more correct.
      
      Also fixes incorrect destruction of NdbQueryImpl objects if 
      construction of these fails in NdbQueryImpl::buildQuery().
      In order to ensure propper cleanup of these we should use 
      NdbQueryImpl::release() instead of deleting them directly.

    modified:
      mysql-test/suite/ndb/r/ndb_dbug_tc_select.result
      mysql-test/suite/ndb/r/ndb_join_pushdown_default.result
      mysql-test/suite/ndb/r/ndb_statistics0.result
      mysql-test/suite/ndb/r/ndb_statistics1.result
      mysql-test/suite/ndb/t/ndb_join_pushdown.inc
      sql/abstract_query_plan.cc
      sql/ha_ndbcluster.cc
      sql/ha_ndbcluster.h
      sql/sql_select.cc
      storage/ndb/src/ndbapi/NdbQueryOperation.cpp
=== modified file 'mysql-test/lib/mtr_cases.pm'
--- a/mysql-test/lib/mtr_cases.pm	2012-03-30 06:33:44 +0000
+++ b/mysql-test/lib/mtr_cases.pm	2012-04-18 14:38:45 +0000
@@ -1064,6 +1064,13 @@ sub collect_one_test_case {
     }
   }
 
+  if ( $tinfo->{'not_windows'} && IS_WINDOWS )
+  {
+    $tinfo->{'skip'}= 1;
+    $tinfo->{'comment'}= "Test not supported on Windows";
+    return $tinfo;
+  }
+
   # ----------------------------------------------------------------------
   # Find config file to use if not already selected in <testname>.opt file
   # ----------------------------------------------------------------------
@@ -1145,6 +1152,7 @@ my @tags=
  ["federated.inc", "federated_test", 1],
  ["include/not_embedded.inc", "not_embedded", 1],
  ["include/have_ssl.inc", "need_ssl", 1],
+ ["include/not_windows.inc", "not_windows", 1],
 );
 
 

=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2012-03-30 06:33:44 +0000
+++ b/mysql-test/mysql-test-run.pl	2012-04-18 14:38:45 +0000
@@ -2796,8 +2796,7 @@ sub check_ndbcluster_support ($) {
     mtr_report(" - MySQL Cluster");
     # Enable ndb engine and add more test suites
     $opt_include_ndbcluster = 1;
-    $DEFAULT_SUITES.=",ndb,ndb_binlog,rpl_ndb,ndb_rpl";
-    $DEFAULT_SUITES.=",ndb_memcache" unless($opt_embedded_server or IS_WINDOWS);
+    $DEFAULT_SUITES.=",ndb,ndb_binlog,rpl_ndb,ndb_rpl,ndb_memcache";
   }
 
 
@@ -5609,13 +5608,6 @@ sub start_servers($) {
   { 
     if(memcacheds()) 
     {
-      # In theory maybe you could run the memcached tests with the embedded
-      # server, but for now we skip it.
-      if($opt_embedded_server) 
-      { 
-        mtr_error("Cannot run memcached tests with the embedded server.");
-      }
-      
       my $avail_port = $memcached_base_port;
       my $memcached;
       memcached_load_metadata($cluster);

=== modified file 'mysql-test/suite/ndb_memcache/include/have_memcache.inc'
--- a/mysql-test/suite/ndb_memcache/include/have_memcache.inc	2011-09-12 20:29:37 +0000
+++ b/mysql-test/suite/ndb_memcache/include/have_memcache.inc	2012-04-18 14:38:45 +0000
@@ -1,3 +1,6 @@
+--source include/not_embedded.inc
+--source include/not_windows.inc
+
 --perl
 
 use strict;

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5-cluster-7.2 branch (magnus.blaudd:3890 to 3891) magnus.blaudd20 Apr