From: Martin Skold Date: January 19 2012 11:56am Subject: bzr push into mysql-5.1-telco-7.1 branch (Martin.Skold:4419 to 4420) List-Archive: http://lists.mysql.com/commits/142461 Message-Id: <20120119115615.EAB0E9F8D7F@quadfish> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 4420 Martin Skold 2012-01-19 [merge] Merge modified: mysql-test/suite/ndb/r/ndb_condition_pushdown.result mysql-test/suite/ndb/t/ndb_condition_pushdown.test sql/ha_ndbcluster_cond.cc storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp storage/ndb/src/kernel/error/ErrorReporter.cpp storage/ndb/src/kernel/vm/Emulator.cpp storage/ndb/src/kernel/vm/Emulator.hpp 4419 Craig L Russell 2012-01-18 Add size() methods to structs that have an element size parameter for ndbapi methods. This removes platform dependencies from clusterj code. modified: storage/ndb/include/ndbapi/Ndb.hpp storage/ndb/include/ndbapi/NdbDictionary.hpp storage/ndb/include/ndbapi/NdbOperation.hpp storage/ndb/include/ndbapi/NdbScanOperation.hpp === modified file 'mysql-test/suite/ndb/r/ndb_condition_pushdown.result' --- a/mysql-test/suite/ndb/r/ndb_condition_pushdown.result 2011-11-21 13:27:34 +0000 +++ b/mysql-test/suite/ndb/r/ndb_condition_pushdown.result 2012-01-19 11:14:35 +0000 @@ -2387,5 +2387,16 @@ select b from mytab where a like -1 havi b 1 drop table mytab; +create table t(a bigint unsigned not null primary key auto_increment, b varchar(100)) character set utf8 engine ndb; +insert into t (b) values('abc'),('aaa'),('bbb'),('ccc'); +select * from t where b like 'a%'; +a b +1 abc +2 aaa +select * from t where b not like 'a%'; +a b +3 bbb +4 ccc +drop table t; set engine_condition_pushdown = @old_ecpd; DROP TABLE t1,t2,t3,t4,t5; === modified file 'mysql-test/suite/ndb/t/ndb_condition_pushdown.test' --- a/mysql-test/suite/ndb/t/ndb_condition_pushdown.test 2011-11-21 13:27:34 +0000 +++ b/mysql-test/suite/ndb/t/ndb_condition_pushdown.test 2012-01-19 11:14:35 +0000 @@ -2413,6 +2413,15 @@ select b from mytab where a like -1 havi drop table mytab; +# Bug #13579318 LIKE SEARCH DOESN'T MATCH ANY ROWS ON A MULTI BYTE CHARSET COLUMN +create table t(a bigint unsigned not null primary key auto_increment, b varchar(100)) character set utf8 engine ndb; + +insert into t (b) values('abc'),('aaa'),('bbb'),('ccc'); +--sorted_result +select * from t where b like 'a%'; +--sorted_result +select * from t where b not like 'a%'; +drop table t; + set engine_condition_pushdown = @old_ecpd; DROP TABLE t1,t2,t3,t4,t5; - === modified file 'sql/ha_ndbcluster_cond.cc' --- a/sql/ha_ndbcluster_cond.cc 2011-11-21 13:27:34 +0000 +++ b/sql/ha_ndbcluster_cond.cc 2012-01-19 11:14:35 +0000 @@ -1211,13 +1211,14 @@ ha_ndbcluster_cond::build_scan_filter_pr if (!value || !field) break; bool is_string= (value->qualification.value_type == Item::STRING_ITEM); // Save value in right format for the field type - uint32 len= value->save_in_field(field); + uint32 val_len= value->save_in_field(field); char buff[MAX_FIELD_WIDTH]; String str(buff,sizeof(buff),field->get_field_charset()); - if (len > field->get_field()->field_length) - str.set(value->get_val(), len, field->get_field_charset()); + if (val_len > field->get_field()->field_length) + str.set(value->get_val(), val_len, field->get_field_charset()); else field->get_field_val_str(&str); + uint32 len= str.length(); const char *val= (value->is_const_func() && is_string)? str.ptr() @@ -1239,13 +1240,14 @@ ha_ndbcluster_cond::build_scan_filter_pr if (!value || !field) break; bool is_string= (value->qualification.value_type == Item::STRING_ITEM); // Save value in right format for the field type - uint32 len= value->save_in_field(field); + uint32 val_len= value->save_in_field(field); char buff[MAX_FIELD_WIDTH]; String str(buff,sizeof(buff),field->get_field_charset()); - if (len > field->get_field()->field_length) - str.set(value->get_val(), len, field->get_field_charset()); + if (val_len > field->get_field()->field_length) + str.set(value->get_val(), val_len, field->get_field_charset()); else field->get_field_val_str(&str); + uint32 len= str.length(); const char *val= (value->is_const_func() && is_string)? str.ptr() === modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp' --- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 2011-12-07 18:27:58 +0000 +++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 2012-01-19 11:50:25 +0000 @@ -16531,8 +16531,11 @@ void Dbdict::createEvent_sendReply(Signa evntRecPtr.p->m_errorLine = __LINE__; evntRecPtr.p->m_errorNode = reference(); jam(); - } else + } + else + { jam(); + } } // reference to API if master DICT === modified file 'storage/ndb/src/kernel/error/ErrorReporter.cpp' --- a/storage/ndb/src/kernel/error/ErrorReporter.cpp 2011-12-30 13:05:50 +0000 +++ b/storage/ndb/src/kernel/error/ErrorReporter.cpp 2012-01-19 06:21:05 +0000 @@ -213,9 +213,6 @@ ErrorReporter::handleAssert(const char* #ifdef NO_EMULATED_JAM BaseString::snprintf(refMessage, 100, "file: %s lineNo: %d", file, line); - jam = NULL; - jamIndex = 0; - jamBlockNumber = 0; #else const EmulatedJamBuffer *jamBuffer = (EmulatedJamBuffer *)NdbThread_GetTlsKey(NDB_THREAD_TLS_JAM); === modified file 'storage/ndb/src/kernel/vm/Emulator.cpp' --- a/storage/ndb/src/kernel/vm/Emulator.cpp 2011-09-27 06:44:06 +0000 +++ b/storage/ndb/src/kernel/vm/Emulator.cpp 2012-01-19 06:21:05 +0000 @@ -79,7 +79,12 @@ EmulatorData::create(){ Global jam() buffer, for non-multithreaded operation. For multithreaded ndbd, each thread will set a local jam buffer later. */ - NdbThread_SetTlsKey(NDB_THREAD_TLS_JAM, (void *)&theEmulatedJamBuffer); +#ifndef NO_EMULATED_JAM + void * jamBuffer = (void *)&theEmulatedJamBuffer; +#else + void * jamBuffer = 0; +#endif + NdbThread_SetTlsKey(NDB_THREAD_TLS_JAM, jamBuffer); NdbMem_Create(); === modified file 'storage/ndb/src/kernel/vm/Emulator.hpp' --- a/storage/ndb/src/kernel/vm/Emulator.hpp 2012-01-16 07:14:30 +0000 +++ b/storage/ndb/src/kernel/vm/Emulator.hpp 2012-01-19 06:21:05 +0000 @@ -37,18 +37,17 @@ extern struct GlobalData global extern class SignalLoggerManager globalSignalLoggers; #endif -#ifndef NO_EMULATED_JAM /* EMULATED_JAM_SIZE must be a power of two, so JAM_MASK will work. */ #define EMULATED_JAM_SIZE 1024 #define JAM_MASK (EMULATED_JAM_SIZE - 1) -struct EmulatedJamBuffer { +struct EmulatedJamBuffer +{ Uint32 theEmulatedJamIndex; // last block entry, used in dumpJam() if jam contains no block entries Uint32 theEmulatedJamBlockNumber; Uint32 theEmulatedJam[EMULATED_JAM_SIZE]; }; -#endif struct EmulatorData { class Configuration * theConfiguration; No bundle (reason: useless for push emails).