List:Commits« Previous MessageNext Message »
From:Martin Skold Date:September 6 2006 9:21am
Subject:bk commit into 5.1 tree (mskold:1.2308)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of marty. When marty does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-09-06 11:21:49+02:00, mskold@stripped +4 -0
  Merge mysql.com:/windows/Linux_space/MySQL/mysql-5.0
  into  mysql.com:/windows/Linux_space/MySQL/mysql-5.1
  MERGE: 1.1810.2040.1

  mysql-test/r/ndb_condition_pushdown.result@stripped, 2006-09-06 11:21:44+02:00, mskold@stripped +0 -0
    Auto merged
    MERGE: 1.15.2.1

  mysql-test/t/ndb_condition_pushdown.test@stripped, 2006-09-06 11:21:44+02:00, mskold@stripped +0 -0
    Auto merged
    MERGE: 1.16.1.3

  sql/ha_ndbcluster.cc@stripped, 2006-09-06 11:21:44+02:00, mskold@stripped +0 -0
    Auto merged
    MERGE: 1.175.50.1

  sql/ha_ndbcluster.h@stripped, 2006-09-06 11:21:44+02:00, mskold@stripped +0 -0
    Auto merged
    MERGE: 1.82.4.3

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	mskold
# Host:	linux.site
# Root:	/windows/Linux_space/MySQL/mysql-5.1/RESYNC

--- 1.357/sql/ha_ndbcluster.cc	2006-09-06 11:21:58 +02:00
+++ 1.358/sql/ha_ndbcluster.cc	2006-09-06 11:21:58 +02:00
@@ -8590,11 +8590,13 @@ void ndb_serialize_cond(const Item *item
             DBUG_PRINT("info", ("FIELD_ITEM"));
             DBUG_PRINT("info", ("table %s", tab->getName()));
             DBUG_PRINT("info", ("column %s", field->field_name));
+            DBUG_PRINT("info", ("type %d", field->type()));
             DBUG_PRINT("info", ("result type %d", field->result_type()));
             
             // Check that we are expecting a field and with the correct
             // result type
             if (context->expecting(Item::FIELD_ITEM) &&
+                context->expecting_field_type(field->type()) &&
                 (context->expecting_field_result(field->result_type()) ||
                  // Date and year can be written as string or int
                  ((type == MYSQL_TYPE_TIME ||
@@ -8814,6 +8816,9 @@ void ndb_serialize_cond(const Item *item
                                               func_item);      
             context->expect(Item::STRING_ITEM);
             context->expect(Item::FIELD_ITEM);
+            context->expect_only_field_type(MYSQL_TYPE_STRING);
+            context->expect_field_type(MYSQL_TYPE_VAR_STRING);
+            context->expect_field_type(MYSQL_TYPE_VARCHAR);
             context->expect_field_result(STRING_RESULT);
             context->expect(Item::FUNC_ITEM);
             break;

--- 1.148/sql/ha_ndbcluster.h	2006-09-06 11:21:58 +02:00
+++ 1.149/sql/ha_ndbcluster.h	2006-09-06 11:21:58 +02:00
@@ -461,8 +461,8 @@ class Ndb_cond_traverse_context 
   Ndb_cond_traverse_context(TABLE *tab, void* ndb_tab, Ndb_cond_stack* stack)
     : table(tab), ndb_table(ndb_tab), 
     supported(TRUE), stack_ptr(stack), cond_ptr(NULL),
-    expect_mask(0), expect_field_result_mask(0), skip(0), collation(NULL),
-    rewrite_stack(NULL)
+    expect_mask(0), expect_field_type_mask(0), expect_field_result_mask(0), 
+    skip(0), collation(NULL), rewrite_stack(NULL)
   {
     if (stack)
       cond_ptr= stack->ndb_cond;
@@ -474,6 +474,7 @@ class Ndb_cond_traverse_context 
   void expect(Item::Type type)
   {
     expect_mask|= (1 << type);
+    if (type == Item::FIELD_ITEM) expect_all_field_types();
   };
   void dont_expect(Item::Type type)
   {
@@ -493,6 +494,28 @@ class Ndb_cond_traverse_context 
     expect(type);
   };
 
+  void expect_field_type(enum_field_types result)
+  {
+    expect_field_type_mask|= (1 << result);
+  };
+  void expect_all_field_types()
+  {
+    expect_field_type_mask= ~0;
+  };
+  bool expecting_field_type(enum_field_types result)
+  {
+    return (expect_field_type_mask & (1 << result));
+  };
+  void expect_no_field_type()
+  {
+    expect_field_type_mask= 0;
+  };
+  void expect_only_field_type(enum_field_types result)
+  {
+    expect_field_type_mask= 0;
+    expect_field_type(result);
+  };
+
   void expect_field_result(Item_result result)
   {
     expect_field_result_mask|= (1 << result);
@@ -528,6 +551,7 @@ class Ndb_cond_traverse_context 
   Ndb_cond_stack* stack_ptr;
   Ndb_cond* cond_ptr;
   uint expect_mask;
+  uint expect_field_type_mask;
   uint expect_field_result_mask;
   uint skip;
   CHARSET_INFO* collation;

--- 1.26/mysql-test/r/ndb_condition_pushdown.result	2006-09-06 11:21:58 +02:00
+++ 1.27/mysql-test/r/ndb_condition_pushdown.result	2006-09-06 11:21:58 +02:00
@@ -1782,6 +1782,28 @@ select * from t5 where b like '%jo%' ord
 a	b
 1	jonas
 3	johan
+set engine_condition_pushdown = off;
+select auto from t1 where date_time like '1902-02-02 %';
+auto
+2
+select auto from t1 where date_time not like '1902-02-02 %';
+auto
+3
+4
+set engine_condition_pushdown = on;
+explain select auto from t1 where date_time like '1902-02-02 %';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	Using where
+select auto from t1 where date_time like '1902-02-02 %';
+auto
+2
+explain select auto from t1 where date_time not like '1902-02-02 %';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	Using where
+select auto from t1 where date_time not like '1902-02-02 %';
+auto
+3
+4
 drop table t1;
 create table t1 (a int, b varchar(3), primary key using hash(a))
 engine=ndb;

--- 1.20/mysql-test/t/ndb_condition_pushdown.test	2006-09-06 11:21:58 +02:00
+++ 1.21/mysql-test/t/ndb_condition_pushdown.test	2006-09-06 11:21:58 +02:00
@@ -1649,6 +1649,16 @@ set engine_condition_pushdown = on;
 explain select * from t5 where b like '%jo%';
 select * from t5 where b like '%jo%' order by a;
 
+# bug#21056  	ndb pushdown equal/setValue error on datetime
+set engine_condition_pushdown = off;
+select auto from t1 where date_time like '1902-02-02 %';
+select auto from t1 where date_time not like '1902-02-02 %';
+set engine_condition_pushdown = on;
+explain select auto from t1 where date_time like '1902-02-02 %';
+select auto from t1 where date_time like '1902-02-02 %';
+explain select auto from t1 where date_time not like '1902-02-02 %';
+select auto from t1 where date_time not like '1902-02-02 %';
+
 # bug#17421 -1
 drop table t1;
 create table t1 (a int, b varchar(3), primary key using hash(a))
Thread
bk commit into 5.1 tree (mskold:1.2308)Martin Skold6 Sep