From 545c9b8fdecad04d6b5acaaa1400ca8be7a7066c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 5 Sep 2006 17:07:00 +0200 Subject: [PATCH 1/7] Bug #21056 ndb pushdown equal/setValue error on datetime: only pushdown like of string type fields --- mysql-test/r/ndb_condition_pushdown.result | 22 +++++++++++++++++ mysql-test/t/ndb_condition_pushdown.test | 10 ++++++++ sql/ha_ndbcluster.cc | 5 ++++ sql/ha_ndbcluster.h | 28 ++++++++++++++++++++-- 4 files changed, 63 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/ndb_condition_pushdown.result b/mysql-test/r/ndb_condition_pushdown.result index 4e5597a4851..96881bd321b 100644 --- a/mysql-test/r/ndb_condition_pushdown.result +++ b/mysql-test/r/ndb_condition_pushdown.result @@ -1782,6 +1782,28 @@ select * from t5 where b like '%jo%' order by a; 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; diff --git a/mysql-test/t/ndb_condition_pushdown.test b/mysql-test/t/ndb_condition_pushdown.test index cc138b32b7e..765c5d06bab 100644 --- a/mysql-test/t/ndb_condition_pushdown.test +++ b/mysql-test/t/ndb_condition_pushdown.test @@ -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)) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 5d6fe5f984f..440adec4841 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -6880,11 +6880,13 @@ void ndb_serialize_cond(const Item *item, void *arg) 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 || @@ -7104,6 +7106,9 @@ void ndb_serialize_cond(const Item *item, void *arg) 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; diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index cfb12981b98..1e08e04198c 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -362,8 +362,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; @@ -375,6 +375,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) { @@ -394,6 +395,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); @@ -429,6 +452,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; From 99b45a4dcc159ab325af76368ae43f527ee7bf8a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 6 Sep 2006 11:54:01 +0200 Subject: [PATCH 2/7] Bug #21056 ndb pushdown equal/setValue error on datetime: Added missing order by --- mysql-test/r/ndb_condition_pushdown.result | 8 ++++---- mysql-test/t/ndb_condition_pushdown.test | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/ndb_condition_pushdown.result b/mysql-test/r/ndb_condition_pushdown.result index 96881bd321b..723311e6448 100644 --- a/mysql-test/r/ndb_condition_pushdown.result +++ b/mysql-test/r/ndb_condition_pushdown.result @@ -1783,10 +1783,10 @@ a b 1 jonas 3 johan set engine_condition_pushdown = off; -select auto from t1 where date_time like '1902-02-02 %'; +select auto from t1 where date_time like '1902-02-02 %' order by auto; auto 2 -select auto from t1 where date_time not like '1902-02-02 %'; +select auto from t1 where date_time not like '1902-02-02 %' order by auto; auto 3 4 @@ -1794,13 +1794,13 @@ 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 %'; +select auto from t1 where date_time like '1902-02-02 %' order by auto; 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 %'; +select auto from t1 where date_time not like '1902-02-02 %' order by auto; auto 3 4 diff --git a/mysql-test/t/ndb_condition_pushdown.test b/mysql-test/t/ndb_condition_pushdown.test index 765c5d06bab..748c26e2a9a 100644 --- a/mysql-test/t/ndb_condition_pushdown.test +++ b/mysql-test/t/ndb_condition_pushdown.test @@ -1651,13 +1651,13 @@ 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 %'; +select auto from t1 where date_time like '1902-02-02 %' order by auto; +select auto from t1 where date_time not like '1902-02-02 %' order by auto; 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 %'; +select auto from t1 where date_time like '1902-02-02 %' order by auto; 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 %'; +select auto from t1 where date_time not like '1902-02-02 %' order by auto; # bug#17421 -1 drop table t1; From 8b1d995987f0cdfb24814127c3d9218052c52891 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 12 Sep 2006 16:04:52 +0200 Subject: [PATCH 3/7] Bug #21378 Alter table from X storage engine to NDB could cause data loss: Added warning if local table shadows ndb table --- mysql-test/r/ndb_multi.result | 32 ++++++++++++++++++++++++++++++++ mysql-test/t/ndb_multi.test | 22 ++++++++++++++++++++++ sql/ha_ndbcluster.cc | 17 +++++++++++++---- 3 files changed, 67 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/ndb_multi.result b/mysql-test/r/ndb_multi.result index bd3af223a65..068d86b83e2 100644 --- a/mysql-test/r/ndb_multi.result +++ b/mysql-test/r/ndb_multi.result @@ -69,3 +69,35 @@ t3 t4 drop table t1, t2, t3, t4; drop table t1, t3, t4; +create table t1(c1 int key)ENGINE=MyISAM; +insert into t1 values(1),(3),(5); +select * from t1 order by c1; +c1 +1 +3 +5 +create table t1(c1 int key)ENGINE=MyISAM; +insert into t1 values(100),(344),(533); +select * from t1 order by c1; +c1 +100 +344 +533 +alter table t1 engine=ndb; +show tables; +Tables_in_test +t1 +Warnings: +Warning 1050 Local table t1 shadows cluster table +select * from t1 order by c1; +c1 +100 +344 +533 +drop table t1; +select * from t1 order by c1; +c1 +1 +3 +5 +drop table t1; diff --git a/mysql-test/t/ndb_multi.test b/mysql-test/t/ndb_multi.test index 1183f2b283f..ce8ce420793 100644 --- a/mysql-test/t/ndb_multi.test +++ b/mysql-test/t/ndb_multi.test @@ -69,4 +69,26 @@ drop table t1, t2, t3, t4; connection server2; drop table t1, t3, t4; +# bug#21378 +connection server1; +create table t1(c1 int key)ENGINE=MyISAM; +insert into t1 values(1),(3),(5); +select * from t1 order by c1; + +connection server2; +create table t1(c1 int key)ENGINE=MyISAM; +insert into t1 values(100),(344),(533); +select * from t1 order by c1; + +connection server1; +alter table t1 engine=ndb; + +connection server2; +show tables; +select * from t1 order by c1; +drop table t1; + +connection server1; +select * from t1 order by c1; +drop table t1; # End of 4.1 tests diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index e4c20de2390..987c96aed37 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -4715,16 +4715,16 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path, List delete_list; while ((file_name=it++)) { + bool file_on_disk= false; DBUG_PRINT("info", ("%s", file_name)); if (hash_search(&ndb_tables, file_name, strlen(file_name))) { DBUG_PRINT("info", ("%s existed in NDB _and_ on disk ", file_name)); // File existed in NDB and as frm file, put in ok_tables list - my_hash_insert(&ok_tables, (byte*)file_name); - continue; + file_on_disk= true; } - // File is not in NDB, check for .ndb file with this name + // Check for .ndb file with this name (void)strxnmov(name, FN_REFLEN, mysql_data_home,"/",db,"/",file_name,ha_ndb_ext,NullS); DBUG_PRINT("info", ("Check access for %s", name)); @@ -4732,9 +4732,18 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path, { DBUG_PRINT("info", ("%s did not exist on disk", name)); // .ndb file did not exist on disk, another table type + if (file_on_disk) + push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_TABLE_EXISTS_ERROR, + "Local table %s.%s shadows ndb table", + db, file_name); + continue; + } + if (file_on_disk) + { + my_hash_insert(&ok_tables, (byte*)file_name); continue; } - DBUG_PRINT("info", ("%s existed on disk", name)); // The .ndb file exists on disk, but it's not in list of tables in ndb // Verify that handler agrees table is gone. From 64c937038d037c925221612555879a73ac66def9 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 13 Sep 2006 18:49:05 +0200 Subject: [PATCH 4/7] Bug #21378 Alter table from X storage engine to NDB could cause data loss: skip autodiscover of local tables --- sql/ha_ndbcluster.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 987c96aed37..7398c15a9c8 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -4720,7 +4720,6 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path, if (hash_search(&ndb_tables, file_name, strlen(file_name))) { DBUG_PRINT("info", ("%s existed in NDB _and_ on disk ", file_name)); - // File existed in NDB and as frm file, put in ok_tables list file_on_disk= true; } @@ -4733,14 +4732,21 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path, DBUG_PRINT("info", ("%s did not exist on disk", name)); // .ndb file did not exist on disk, another table type if (file_on_disk) + { + // Ignore this ndb table + gptr record= hash_search(&ndb_tables, file_name, strlen(file_name)); + DBUG_ASSERT(record); + hash_delete(&ndb_tables, record); push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_TABLE_EXISTS_ERROR, "Local table %s.%s shadows ndb table", db, file_name); + } continue; } if (file_on_disk) { + // File existed in NDB and as frm file, put in ok_tables list my_hash_insert(&ok_tables, (byte*)file_name); continue; } From 6937427146002d746e903b2d9e9cf193cd8b4c1b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 13 Sep 2006 19:56:02 +0200 Subject: [PATCH 5/7] Bug #21378 Alter table from X storage engine to NDB could cause data loss: updated results --- mysql-test/r/ndb_multi.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/r/ndb_multi.result b/mysql-test/r/ndb_multi.result index 068d86b83e2..351cd7e35c5 100644 --- a/mysql-test/r/ndb_multi.result +++ b/mysql-test/r/ndb_multi.result @@ -88,7 +88,7 @@ show tables; Tables_in_test t1 Warnings: -Warning 1050 Local table t1 shadows cluster table +Warning 1050 Local table test.t1 shadows ndb table select * from t1 order by c1; c1 100 From 73db46fb4f662bce4f9933dcd7a54f709602a845 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 15 Sep 2006 15:51:05 +0200 Subject: [PATCH 6/7] Bug #21056 ndb pushdown equal/setValue error on datetime: post review fixes, use my_bitmap --- sql/ha_ndbcluster.cc | 20 +++++++-------- sql/ha_ndbcluster.h | 59 +++++++++++++++++++++++++++++--------------- 2 files changed, 49 insertions(+), 30 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 435bc5f64c0..189347b247f 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -6938,7 +6938,7 @@ void ndb_serialize_cond(const Item *item, void *arg) curr_cond->ndb_item= new Ndb_item(field, col->getColumnNo()); context->dont_expect(Item::FIELD_ITEM); context->expect_no_field_result(); - if (context->expect_mask) + if (! context->expecting_nothing()) { // We have not seen second argument yet if (type == MYSQL_TYPE_TIME || @@ -7243,7 +7243,7 @@ void ndb_serialize_cond(const Item *item, void *arg) NDB_ITEM_QUALIFICATION q; q.value_type= Item::STRING_ITEM; curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item); - if (context->expect_field_result_mask) + if (! context->expecting_no_field_result()) { // We have not seen the field argument yet context->expect_only(Item::FIELD_ITEM); @@ -7273,7 +7273,7 @@ void ndb_serialize_cond(const Item *item, void *arg) NDB_ITEM_QUALIFICATION q; q.value_type= Item::REAL_ITEM; curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item); - if (context->expect_field_result_mask) + if (! context->expecting_no_field_result()) { // We have not seen the field argument yet context->expect_only(Item::FIELD_ITEM); @@ -7296,7 +7296,7 @@ void ndb_serialize_cond(const Item *item, void *arg) NDB_ITEM_QUALIFICATION q; q.value_type= Item::INT_ITEM; curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item); - if (context->expect_field_result_mask) + if (! context->expecting_no_field_result()) { // We have not seen the field argument yet context->expect_only(Item::FIELD_ITEM); @@ -7319,7 +7319,7 @@ void ndb_serialize_cond(const Item *item, void *arg) NDB_ITEM_QUALIFICATION q; q.value_type= Item::DECIMAL_ITEM; curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item); - if (context->expect_field_result_mask) + if (! context->expecting_no_field_result()) { // We have not seen the field argument yet context->expect_only(Item::FIELD_ITEM); @@ -7369,7 +7369,7 @@ void ndb_serialize_cond(const Item *item, void *arg) NDB_ITEM_QUALIFICATION q; q.value_type= Item::STRING_ITEM; curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item); - if (context->expect_field_result_mask) + if (! context->expecting_no_field_result()) { // We have not seen the field argument yet context->expect_only(Item::FIELD_ITEM); @@ -7402,7 +7402,7 @@ void ndb_serialize_cond(const Item *item, void *arg) NDB_ITEM_QUALIFICATION q; q.value_type= Item::INT_ITEM; curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item); - if (context->expect_field_result_mask) + if (! context->expecting_no_field_result()) { // We have not seen the field argument yet context->expect_only(Item::FIELD_ITEM); @@ -7429,7 +7429,7 @@ void ndb_serialize_cond(const Item *item, void *arg) NDB_ITEM_QUALIFICATION q; q.value_type= Item::REAL_ITEM; curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item); - if (context->expect_field_result_mask) + if (! context->expecting_no_field_result()) { // We have not seen the field argument yet context->expect_only(Item::FIELD_ITEM); @@ -7452,7 +7452,7 @@ void ndb_serialize_cond(const Item *item, void *arg) NDB_ITEM_QUALIFICATION q; q.value_type= Item::VARBIN_ITEM; curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item); - if (context->expect_field_result_mask) + if (! context->expecting_no_field_result()) { // We have not seen the field argument yet context->expect_only(Item::FIELD_ITEM); @@ -7477,7 +7477,7 @@ void ndb_serialize_cond(const Item *item, void *arg) NDB_ITEM_QUALIFICATION q; q.value_type= Item::DECIMAL_ITEM; curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item); - if (context->expect_field_result_mask) + if (! context->expecting_no_field_result()) { // We have not seen the field argument yet context->expect_only(Item::FIELD_ITEM); diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 1e08e04198c..91921dccdfb 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -362,76 +362,95 @@ 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_type_mask(0), expect_field_result_mask(0), skip(0), collation(NULL), rewrite_stack(NULL) { + // Allocate type checking bitmaps + bitmap_init(&expect_mask, 0, 512, TRUE); + bitmap_init(&expect_field_type_mask, 0, 512, TRUE); + bitmap_init(&expect_field_result_mask, 0, 512, TRUE); + if (stack) cond_ptr= stack->ndb_cond; }; ~Ndb_cond_traverse_context() { + bitmap_free(&expect_mask); + bitmap_free(&expect_field_type_mask); + bitmap_free(&expect_field_result_mask); if (rewrite_stack) delete rewrite_stack; } void expect(Item::Type type) { - expect_mask|= (1 << type); + bitmap_set_bit(&expect_mask, (uint) type); if (type == Item::FIELD_ITEM) expect_all_field_types(); }; void dont_expect(Item::Type type) { - expect_mask&= ~(1 << type); + bitmap_clear_bit(&expect_mask, (uint) type); }; bool expecting(Item::Type type) { - return (expect_mask & (1 << type)); + return bitmap_is_set(&expect_mask, (uint) type); }; void expect_nothing() { - expect_mask= 0; + bitmap_clear_all(&expect_mask); }; + bool expecting_nothing() + { + return bitmap_is_clear_all(&expect_mask); + } void expect_only(Item::Type type) { - expect_mask= 0; + expect_nothing(); expect(type); }; - void expect_field_type(enum_field_types result) + void expect_field_type(enum_field_types type) { - expect_field_type_mask|= (1 << result); + bitmap_set_bit(&expect_field_type_mask, (uint) type); }; void expect_all_field_types() { - expect_field_type_mask= ~0; + bitmap_set_all(&expect_field_type_mask); }; - bool expecting_field_type(enum_field_types result) + bool expecting_field_type(enum_field_types type) { - return (expect_field_type_mask & (1 << result)); + return bitmap_is_set(&expect_field_type_mask, (uint) type); }; void expect_no_field_type() { - expect_field_type_mask= 0; + bitmap_clear_all(&expect_field_type_mask); }; + bool expecting_no_field_type() + { + return bitmap_is_clear_all(&expect_field_type_mask); + } void expect_only_field_type(enum_field_types result) { - expect_field_type_mask= 0; + expect_no_field_type(); expect_field_type(result); }; void expect_field_result(Item_result result) { - expect_field_result_mask|= (1 << result); + bitmap_set_bit(&expect_field_result_mask, (uint) result); }; bool expecting_field_result(Item_result result) { - return (expect_field_result_mask & (1 << result)); + return bitmap_is_set(&expect_field_result_mask, (uint) result); }; void expect_no_field_result() { - expect_field_result_mask= 0; + bitmap_clear_all(&expect_field_result_mask); }; + bool expecting_no_field_result() + { + return bitmap_is_clear_all(&expect_field_result_mask); + } void expect_only_field_result(Item_result result) { - expect_field_result_mask= 0; + expect_no_field_result(); expect_field_result(result); }; void expect_collation(CHARSET_INFO* col) @@ -451,9 +470,9 @@ class Ndb_cond_traverse_context bool supported; Ndb_cond_stack* stack_ptr; Ndb_cond* cond_ptr; - uint expect_mask; - uint expect_field_type_mask; - uint expect_field_result_mask; + MY_BITMAP expect_mask; + MY_BITMAP expect_field_type_mask; + MY_BITMAP expect_field_result_mask; uint skip; CHARSET_INFO* collation; Ndb_rewrite_context *rewrite_stack; From d29a8f098adb6958acad76e8e5f1d16edebdc026 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 18 Sep 2006 09:24:30 +0200 Subject: [PATCH 7/7] Bug #21056 ndb pushdown equal/setValue error on datetime: thread safe bitmap not needed --- sql/ha_ndbcluster.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 91921dccdfb..f443a15ae77 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -365,9 +365,9 @@ class Ndb_cond_traverse_context skip(0), collation(NULL), rewrite_stack(NULL) { // Allocate type checking bitmaps - bitmap_init(&expect_mask, 0, 512, TRUE); - bitmap_init(&expect_field_type_mask, 0, 512, TRUE); - bitmap_init(&expect_field_result_mask, 0, 512, TRUE); + bitmap_init(&expect_mask, 0, 512, FALSE); + bitmap_init(&expect_field_type_mask, 0, 512, FALSE); + bitmap_init(&expect_field_result_mask, 0, 512, FALSE); if (stack) cond_ptr= stack->ndb_cond;