From: kent Date: December 18 2005 5:11pm Subject: bk commit into 5.1 tree (kent:1.1975) List-Archive: http://lists.mysql.com/commits/226 Message-Id: <20051218171153.5093E7A96B8@boortz.dyndns.org> Below is the list of changes that have just been committed into a local 5.1 repository of kent. When kent 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 1.1975 05/12/18 18:11:19 kent@stripped +22 -0 Merge mysql-test/t/disabled.def 1.24 05/12/18 18:11:09 kent@stripped +0 -1 zlib/Makefile.am 1.7 05/12/18 18:02:38 kent@stripped +0 -2 Auto merged tests/mysql_client_test.c 1.168 05/12/18 18:02:37 kent@stripped +0 -0 Auto merged storage/ndb/src/ndbapi/ndb_cluster_connection.cpp 1.35 05/12/18 18:02:37 kent@stripped +0 -0 Auto merged storage/ndb/src/ndbapi/NdbRecAttr.cpp 1.26 05/12/18 18:02:37 kent@stripped +0 -0 Auto merged storage/ndb/src/ndbapi/NdbImpl.hpp 1.16 05/12/18 18:02:37 kent@stripped +0 -0 Auto merged sql/sql_class.h 1.278 05/12/18 18:02:36 kent@stripped +0 -0 Auto merged sql/sql_class.cc 1.226 05/12/18 18:02:36 kent@stripped +0 -0 Auto merged sql/sp_head.cc 1.207 05/12/18 18:02:35 kent@stripped +0 -0 Auto merged sql/mysqld.cc 1.504 05/12/18 18:02:34 kent@stripped +0 -0 Auto merged sql/mysql_priv.h 1.355 05/12/18 18:02:32 kent@stripped +0 -0 Auto merged sql/ha_ndbcluster.cc 1.224 05/12/18 18:02:32 kent@stripped +0 -0 Auto merged mysql-test/t/skip_name_resolve.test 1.7 05/12/18 18:02:31 kent@stripped +0 -0 Auto merged mysql-test/t/ndb_multi.test 1.8 05/12/18 18:02:31 kent@stripped +0 -0 Auto merged mysql-test/t/ndb_basic.test 1.36 05/12/18 18:02:31 kent@stripped +0 -0 Auto merged mysql-test/r/type_time.result 1.15 05/12/18 18:02:30 kent@stripped +0 -0 Auto merged mysql-test/r/skip_name_resolve.result 1.5 05/12/18 18:02:30 kent@stripped +0 -0 Auto merged mysql-test/r/ndb_multi.result 1.7 05/12/18 18:02:30 kent@stripped +0 -0 Auto merged mysql-test/r/ndb_basic.result 1.35 05/12/18 18:02:30 kent@stripped +0 -0 Auto merged mysql-test/mysql-test-run.sh 1.282 05/12/18 18:02:29 kent@stripped +0 -0 Auto merged mysql-test/mysql-test-run.pl 1.45 05/12/18 18:02:29 kent@stripped +0 -0 Auto merged configure.in 1.321 05/12/18 18:02:29 kent@stripped +0 -0 Auto merged storage/ndb/src/ndbapi/ndb_cluster_connection.cpp 1.29.4.2 05/12/18 18:02:28 kent@stripped +0 -0 Merge rename: ndb/src/ndbapi/ndb_cluster_connection.cpp -> storage/ndb/src/ndbapi/ndb_cluster_connection.cpp storage/ndb/src/ndbapi/NdbRecAttr.cpp 1.20.4.2 05/12/18 18:02:28 kent@stripped +0 -0 Merge rename: ndb/src/ndbapi/NdbRecAttr.cpp -> storage/ndb/src/ndbapi/NdbRecAttr.cpp storage/ndb/src/ndbapi/NdbImpl.hpp 1.8.6.2 05/12/18 18:02:27 kent@stripped +0 -0 Merge rename: ndb/src/ndbapi/NdbImpl.hpp -> storage/ndb/src/ndbapi/NdbImpl.hpp # 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: kent # Host: c-664072d5.010-2112-6f72651.cust.bredbandsbolaget.se # Root: /Users/kent/mysql/bk/mysql-5.1-new/RESYNC --- 1.281/mysql-test/mysql-test-run.sh 2005-12-04 01:30:23 +01:00 +++ 1.282/mysql-test/mysql-test-run.sh 2005-12-18 18:02:29 +01:00 @@ -280,7 +280,7 @@ STRESS_SUITE="main" STRESS_MODE="random" STRESS_THREADS=5 -STRESS_TEST_COUNT=20 +STRESS_TEST_COUNT="" STRESS_LOOP_COUNT="" STRESS_TEST_DURATION="" STRESS_INIT_FILE="" @@ -1917,7 +1917,7 @@ --stress-basedir=$STRESS_BASEDIR \ --server-logs-dir=$STRESS_BASEDIR \ --stress-mode=$STRESS_MODE \ - --mysqltest=$BASEDIR/client/mysqltest \ + --mysqltest=$CLIENT_BINDIR/mysqltest \ --threads=$STRESS_THREADS \ --verbose \ --cleanup \ @@ -1926,6 +1926,14 @@ if [ -n "$STRESS_INIT_FILE" ] ; then STRESS_TEST_ARGS="$STRESS_TEST_ARGS --stress-init-file=$STRESS_INIT_FILE" + fi + + if [ -z "$STRESS_LOOP_COUNT" -a -z "$STRESS_TEST_COUNT" -a + -z "$STRESS_TEST_DURATION" ] ; then + + #Limit stress testing with 20 loops in case when any limit parameter + #was specified + STRESS_TEST_COUNT=20 fi if [ -n "$STRESS_LOOP_COUNT" ] ; then --- 1.277/sql/sql_class.h 2005-12-12 20:55:13 +01:00 +++ 1.278/sql/sql_class.h 2005-12-18 18:02:36 +01:00 @@ -218,7 +218,6 @@ uint file_id; uint open_count; // For replication int readers_count; - bool reset_pending; bool write_error, inited; bool need_start_event; /* --- 1.44/mysql-test/mysql-test-run.pl 2005-12-04 01:30:22 +01:00 +++ 1.45/mysql-test/mysql-test-run.pl 2005-12-18 18:02:29 +01:00 @@ -277,9 +277,9 @@ our $opt_stress_suite= "main"; our $opt_stress_mode= "random"; our $opt_stress_threads= 5; -our $opt_stress_test_count= 20; -our $opt_stress_loop_count= ""; -our $opt_stress_test_duration= ""; +our $opt_stress_test_count= 0; +our $opt_stress_loop_count= 0; +our $opt_stress_test_duration= 0; our $opt_stress_init_file= ""; our $opt_stress_test_file= ""; --- 1.8.6.1/ndb/src/ndbapi/NdbImpl.hpp 2005-12-15 16:59:28 +01:00 +++ 1.16/storage/ndb/src/ndbapi/NdbImpl.hpp 2005-12-18 18:02:37 +01:00 @@ -55,6 +55,10 @@ NdbImpl(Ndb_cluster_connection *, Ndb&); ~NdbImpl(); + int send_event_report(Uint32 *data, Uint32 length); + + Ndb &m_ndb; + Ndb_cluster_connection_impl &m_ndb_cluster_connection; NdbDictionaryImpl m_dictionary; @@ -73,6 +77,8 @@ NdbWaiter theWaiter; + NdbEventOperationImpl *m_ev_op; + int m_optimized_node_selection; BaseString m_dbname; // Database name @@ -113,13 +119,13 @@ #endif #define CHECK_STATUS_MACRO \ - {if (checkInitState() == -1) { theError.code = 4100; return -1;}} + {if (checkInitState() == -1) { theError.code = 4100; DBUG_RETURN(-1);}} #define CHECK_STATUS_MACRO_VOID \ - {if (checkInitState() == -1) { theError.code = 4100; return;}} + {if (checkInitState() == -1) { theError.code = 4100; DBUG_VOID_RETURN;}} #define CHECK_STATUS_MACRO_ZERO \ - {if (checkInitState() == -1) { theError.code = 4100; return 0;}} + {if (checkInitState() == -1) { theError.code = 4100; DBUG_RETURN(0);}} #define CHECK_STATUS_MACRO_NULL \ - {if (checkInitState() == -1) { theError.code = 4100; return NULL;}} + {if (checkInitState() == -1) { theError.code = 4100; DBUG_RETURN(NULL);}} inline void * --- 1.20.4.1/ndb/src/ndbapi/NdbRecAttr.cpp 2005-12-15 16:59:28 +01:00 +++ 1.26/storage/ndb/src/ndbapi/NdbRecAttr.cpp 2005-12-18 18:02:37 +01:00 @@ -38,6 +38,7 @@ { return setup(&(col->m_impl), aValue); } + int NdbRecAttr::setup(const NdbColumnImpl* anAttrInfo, char* aValue) { @@ -48,15 +49,12 @@ m_column = anAttrInfo; theAttrId = anAttrInfo->m_attrId; - theAttrSize = tAttrSize; - theArraySize = tArraySize; + m_size_in_bytes = tAttrByteSize; theValue = aValue; - theNULLind = 0; - m_nullable = anAttrInfo->m_nullable; if (theStorageX) delete[] theStorageX; - + // check alignment to signal data // a future version could check alignment per data type as well @@ -93,7 +91,7 @@ char* tRef = (char*)theRef; char* tValue = theValue; if (tRef != tValue && tRef != NULL && tValue != NULL) { - Uint32 n = theAttrSize * theArraySize; + Uint32 n = m_size_in_bytes; while (n-- > 0) { *tValue++ = *tRef++; } @@ -105,12 +103,10 @@ NdbRecAttr * ret = new NdbRecAttr(0); ret->theAttrId = theAttrId; - ret->theNULLind = theNULLind; - ret->theAttrSize = theAttrSize; - ret->theArraySize = theArraySize; + ret->m_size_in_bytes = m_size_in_bytes; ret->m_column = m_column; - Uint32 n = theAttrSize * theArraySize; + Uint32 n = m_size_in_bytes; if(n <= 32){ ret->theRef = (char*)&ret->theStorage[0]; ret->theStorageX = 0; @@ -126,17 +122,19 @@ bool NdbRecAttr::receive_data(const Uint32 * data, Uint32 sz){ - const Uint32 n = (theAttrSize * theArraySize + 3) >> 2; - if(n == sz){ - theNULLind = 0; + const Uint32 n = m_size_in_bytes; + if(sz) + { if(!copyoutRequired()) - memcpy(theRef, data, 4 * sz); + memcpy(theRef, data, sz); else - memcpy(theValue, data, theAttrSize * theArraySize); - return true; - } else if(sz == 0){ - setNULL(); + memcpy(theValue, data, sz); + m_size_in_bytes= sz; return true; + } + else + { + return setNULL(); } return false; } @@ -182,7 +180,7 @@ out << "[NULL]"; return out; } - + const NdbDictionary::Column* c = r.getColumn(); uint length = c->getLength(); if (length > 1) @@ -193,196 +191,195 @@ if (j > 0) out << " "; - switch(r.getType()) - { - case NdbDictionary::Column::Bigunsigned: - out << r.u_64_value(); - break; - case NdbDictionary::Column::Bit: - out << hex << "H'" << r.u_32_value() << dec; - break; - case NdbDictionary::Column::Unsigned: - out << r.u_32_value(); - break; - case NdbDictionary::Column::Smallunsigned: - out << r.u_short_value(); - break; - case NdbDictionary::Column::Tinyunsigned: - out << (unsigned) r.u_char_value(); - break; - case NdbDictionary::Column::Bigint: - out << r.int64_value(); - break; - case NdbDictionary::Column::Int: - out << r.int32_value(); - break; - case NdbDictionary::Column::Smallint: - out << r.short_value(); - break; - case NdbDictionary::Column::Tinyint: - out << (int) r.char_value(); - break; - case NdbDictionary::Column::Binary: - ndbrecattr_print_string(out,"Binary",r.aRef(),r.arraySize()); - j = r.arraySize(); - break; - case NdbDictionary::Column::Char: - ndbrecattr_print_string(out,"Char",r.aRef(),r.arraySize()); - j = length; - break; - case NdbDictionary::Column::Varchar: - { - unsigned len = *(const unsigned char*)r.aRef(); - ndbrecattr_print_string(out,"Varchar", r.aRef()+1,len); - j = length; - } - break; - case NdbDictionary::Column::Varbinary: - { - unsigned len = *(const unsigned char*)r.aRef(); - ndbrecattr_print_string(out,"Varbinary", r.aRef()+1,len); - j = length; - } - break; - case NdbDictionary::Column::Float: - out << r.float_value(); - break; - case NdbDictionary::Column::Double: - out << r.double_value(); - break; - case NdbDictionary::Column::Olddecimal: - { - short len = 1 + c->getPrecision() + (c->getScale() > 0); - out.print("%.*s", len, r.aRef()); - } - break; - case NdbDictionary::Column::Olddecimalunsigned: - { - short len = 0 + c->getPrecision() + (c->getScale() > 0); - out.print("%.*s", len, r.aRef()); - } - break; - case NdbDictionary::Column::Decimal: - case NdbDictionary::Column::Decimalunsigned: - goto unknown; // TODO - break; + switch(r.getType()){ + case NdbDictionary::Column::Bigunsigned: + out << r.u_64_value(); + break; + case NdbDictionary::Column::Bit: + out << hex << "H'" << r.u_32_value() << dec; + break; + case NdbDictionary::Column::Unsigned: + out << r.u_32_value(); + break; + case NdbDictionary::Column::Smallunsigned: + out << r.u_short_value(); + break; + case NdbDictionary::Column::Tinyunsigned: + out << (unsigned) r.u_char_value(); + break; + case NdbDictionary::Column::Bigint: + out << r.int64_value(); + break; + case NdbDictionary::Column::Int: + out << r.int32_value(); + break; + case NdbDictionary::Column::Smallint: + out << r.short_value(); + break; + case NdbDictionary::Column::Tinyint: + out << (int) r.char_value(); + break; + case NdbDictionary::Column::Binary: + j = r.get_size_in_bytes(); + ndbrecattr_print_string(out,"Binary", r.aRef(), j); + break; + case NdbDictionary::Column::Char: + j = r.get_size_in_bytes(); + ndbrecattr_print_string(out,"Char", r.aRef(), j); + break; + case NdbDictionary::Column::Varchar: + { + unsigned len = *(const unsigned char*)r.aRef(); + ndbrecattr_print_string(out,"Varchar", r.aRef()+1,len); + j = length; + } + break; + case NdbDictionary::Column::Varbinary: + { + unsigned len = *(const unsigned char*)r.aRef(); + ndbrecattr_print_string(out,"Varbinary", r.aRef()+1,len); + j = length; + } + break; + case NdbDictionary::Column::Float: + out << r.float_value(); + break; + case NdbDictionary::Column::Double: + out << r.double_value(); + break; + case NdbDictionary::Column::Olddecimal: + { + short len = 1 + c->getPrecision() + (c->getScale() > 0); + out.print("%.*s", len, r.aRef()); + } + break; + case NdbDictionary::Column::Olddecimalunsigned: + { + short len = 0 + c->getPrecision() + (c->getScale() > 0); + out.print("%.*s", len, r.aRef()); + } + break; + case NdbDictionary::Column::Decimal: + case NdbDictionary::Column::Decimalunsigned: + goto unknown; // TODO + break; // for dates cut-and-paste from field.cc - case NdbDictionary::Column::Datetime: - { - ulonglong tmp=r.u_64_value(); - long part1,part2,part3; - part1=(long) (tmp/LL(1000000)); - part2=(long) (tmp - (ulonglong) part1*LL(1000000)); - char buf[40]; - char* pos=(char*) buf+19; - *pos--=0; - *pos--= (char) ('0'+(char) (part2%10)); part2/=10; - *pos--= (char) ('0'+(char) (part2%10)); part3= (int) (part2 / 10); - *pos--= ':'; - *pos--= (char) ('0'+(char) (part3%10)); part3/=10; - *pos--= (char) ('0'+(char) (part3%10)); part3/=10; - *pos--= ':'; - *pos--= (char) ('0'+(char) (part3%10)); part3/=10; - *pos--= (char) ('0'+(char) part3); - *pos--= '/'; - *pos--= (char) ('0'+(char) (part1%10)); part1/=10; - *pos--= (char) ('0'+(char) (part1%10)); part1/=10; - *pos--= '-'; - *pos--= (char) ('0'+(char) (part1%10)); part1/=10; - *pos--= (char) ('0'+(char) (part1%10)); part3= (int) (part1/10); - *pos--= '-'; - *pos--= (char) ('0'+(char) (part3%10)); part3/=10; - *pos--= (char) ('0'+(char) (part3%10)); part3/=10; - *pos--= (char) ('0'+(char) (part3%10)); part3/=10; - *pos=(char) ('0'+(char) part3); - out << buf; - } - break; - case NdbDictionary::Column::Date: - { - uint32 tmp=(uint32) uint3korr(r.aRef()); - int part; - char buf[40]; - char *pos=(char*) buf+10; - *pos--=0; - part=(int) (tmp & 31); - *pos--= (char) ('0'+part%10); - *pos--= (char) ('0'+part/10); - *pos--= '-'; - part=(int) (tmp >> 5 & 15); - *pos--= (char) ('0'+part%10); - *pos--= (char) ('0'+part/10); - *pos--= '-'; - part=(int) (tmp >> 9); - *pos--= (char) ('0'+part%10); part/=10; - *pos--= (char) ('0'+part%10); part/=10; - *pos--= (char) ('0'+part%10); part/=10; - *pos= (char) ('0'+part); - out << buf; - } - break; - case NdbDictionary::Column::Time: - { - long tmp=(long) sint3korr(r.aRef()); - int hour=(uint) (tmp/10000); - int minute=(uint) (tmp/100 % 100); - int second=(uint) (tmp % 100); - char buf[40]; - sprintf(buf, "%02d:%02d:%02d", hour, minute, second); - out << buf; - } - break; - case NdbDictionary::Column::Year: - { - uint year = 1900 + r.u_char_value(); - char buf[40]; - sprintf(buf, "%04d", year); - out << buf; - } - break; - case NdbDictionary::Column::Timestamp: - { - time_t time = r.u_32_value(); - out << (uint)time; - } - break; - case NdbDictionary::Column::Blob: - { - const NdbBlob::Head* h = (const NdbBlob::Head*)r.aRef(); - out << h->length << ":"; - const unsigned char* p = (const unsigned char*)(h + 1); - unsigned n = r.arraySize() - sizeof(*h); - for (unsigned k = 0; k < n && k < h->length; k++) - out.print("%02X", (int)p[k]); - j = length; - } - break; - case NdbDictionary::Column::Text: - { - const NdbBlob::Head* h = (const NdbBlob::Head*)r.aRef(); - out << h->length << ":"; - const unsigned char* p = (const unsigned char*)(h + 1); - unsigned n = r.arraySize() - sizeof(*h); - for (unsigned k = 0; k < n && k < h->length; k++) - out.print("%c", (int)p[k]); - j = length; - } - break; - case NdbDictionary::Column::Longvarchar: - { - unsigned len = uint2korr(r.aRef()); - ndbrecattr_print_string(out,"Longvarchar", r.aRef()+2,len); - j = length; - } - break; - unknown: - default: /* no print functions for the rest, just print type */ - out << (int) r.getType(); - j = length; - if (j > 1) - out << " " << j << " times"; - break; - } + case NdbDictionary::Column::Datetime: + { + ulonglong tmp=r.u_64_value(); + long part1,part2,part3; + part1=(long) (tmp/LL(1000000)); + part2=(long) (tmp - (ulonglong) part1*LL(1000000)); + char buf[40]; + char* pos=(char*) buf+19; + *pos--=0; + *pos--= (char) ('0'+(char) (part2%10)); part2/=10; + *pos--= (char) ('0'+(char) (part2%10)); part3= (int) (part2 / 10); + *pos--= ':'; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= ':'; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= (char) ('0'+(char) part3); + *pos--= '/'; + *pos--= (char) ('0'+(char) (part1%10)); part1/=10; + *pos--= (char) ('0'+(char) (part1%10)); part1/=10; + *pos--= '-'; + *pos--= (char) ('0'+(char) (part1%10)); part1/=10; + *pos--= (char) ('0'+(char) (part1%10)); part3= (int) (part1/10); + *pos--= '-'; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos=(char) ('0'+(char) part3); + out << buf; + } + break; + case NdbDictionary::Column::Date: + { + uint32 tmp=(uint32) uint3korr(r.aRef()); + int part; + char buf[40]; + char *pos=(char*) buf+10; + *pos--=0; + part=(int) (tmp & 31); + *pos--= (char) ('0'+part%10); + *pos--= (char) ('0'+part/10); + *pos--= '-'; + part=(int) (tmp >> 5 & 15); + *pos--= (char) ('0'+part%10); + *pos--= (char) ('0'+part/10); + *pos--= '-'; + part=(int) (tmp >> 9); + *pos--= (char) ('0'+part%10); part/=10; + *pos--= (char) ('0'+part%10); part/=10; + *pos--= (char) ('0'+part%10); part/=10; + *pos= (char) ('0'+part); + out << buf; + } + break; + case NdbDictionary::Column::Time: + { + long tmp=(long) sint3korr(r.aRef()); + int hour=(uint) (tmp/10000); + int minute=(uint) (tmp/100 % 100); + int second=(uint) (tmp % 100); + char buf[40]; + sprintf(buf, "%02d:%02d:%02d", hour, minute, second); + out << buf; + } + break; + case NdbDictionary::Column::Year: + { + uint year = 1900 + r.u_char_value(); + char buf[40]; + sprintf(buf, "%04d", year); + out << buf; + } + break; + case NdbDictionary::Column::Timestamp: + { + time_t time = r.u_32_value(); + out << (uint)time; + } + break; + case NdbDictionary::Column::Blob: + { + const NdbBlob::Head* h = (const NdbBlob::Head*)r.aRef(); + out << h->length << ":"; + const unsigned char* p = (const unsigned char*)(h + 1); + unsigned n = r.get_size_in_bytes() - sizeof(*h); + for (unsigned k = 0; k < n && k < h->length; k++) + out.print("%02X", (int)p[k]); + j = length; + } + break; + case NdbDictionary::Column::Text: + { + const NdbBlob::Head* h = (const NdbBlob::Head*)r.aRef(); + out << h->length << ":"; + const unsigned char* p = (const unsigned char*)(h + 1); + unsigned n = r.get_size_in_bytes() - sizeof(*h); + for (unsigned k = 0; k < n && k < h->length; k++) + out.print("%c", (int)p[k]); + j = length; + } + break; + case NdbDictionary::Column::Longvarchar: + { + unsigned len = uint2korr(r.aRef()); + ndbrecattr_print_string(out,"Longvarchar", r.aRef()+2,len); + j = length; + } + break; + unknown: + //default: /* no print functions for the rest, just print type */ + out << (int) r.getType(); + j = length; + if (j > 1) + out << " " << j << " times"; + break; + } } if (length > 1) --- 1.223/sql/ha_ndbcluster.cc 2005-12-15 15:11:39 +01:00 +++ 1.224/sql/ha_ndbcluster.cc 2005-12-18 18:02:32 +01:00 @@ -3014,25 +3014,6 @@ } *buff++= 0; } - size_t len = key_part->length; - const byte * ptr = record + key_part->offset; - Field *field = key_part->field; - if ((field->type() == MYSQL_TYPE_VARCHAR) && - ((Field_varstring*)field)->length_bytes == 1) - { - /** - * Keys always use 2 bytes length - */ - buff[0] = ptr[0]; - buff[1] = 0; - memcpy(buff+2, ptr + 1, len); - len += 2; - } - else - { - memcpy(buff, ptr, len); - } - buff += len; } } else --- 1.14/mysql-test/r/type_time.result 2005-12-02 12:01:37 +01:00 +++ 1.15/mysql-test/r/type_time.result 2005-12-18 18:02:30 +01:00 @@ -85,3 +85,27 @@ 13:00:00 09:00:00 drop table t1; +SELECT CAST(235959.123456 AS TIME); +CAST(235959.123456 AS TIME) +23:59:59.123456 +SELECT CAST(0.235959123456e+6 AS TIME); +CAST(0.235959123456e+6 AS TIME) +23:59:59.123456 +SELECT CAST(235959123456e-6 AS TIME); +CAST(235959123456e-6 AS TIME) +23:59:59.123456 +SELECT CAST(235959.1234567 AS TIME); +CAST(235959.1234567 AS TIME) +23:59:59.123456 +Warnings: +Warning 1292 Truncated incorrect time value: '235959.1234567' +SELECT CAST(0.2359591234567e6 AS TIME); +CAST(0.2359591234567e6 AS TIME) +23:59:59.123456 +Warnings: +Warning 1292 Truncated incorrect time value: '235959.1234567' +SELECT CAST(0.2359591234567e+30 AS TIME); +CAST(0.2359591234567e+30 AS TIME) +NULL +Warnings: +Warning 1292 Truncated incorrect time value: '2.359591234567e+29' --- 1.29.4.1/ndb/src/ndbapi/ndb_cluster_connection.cpp 2005-12-15 16:59:29 +01:00 +++ 1.35/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp 2005-12-18 18:02:37 +01:00 @@ -38,7 +38,6 @@ static int g_run_connect_thread= 0; #include -NdbMutex *ndb_global_event_buffer_mutex= NULL; #ifdef VM_TRACE NdbMutex *ndb_print_state_mutex= NULL; #endif @@ -188,6 +187,28 @@ } +int Ndb_cluster_connection::get_no_ready() +{ + TransporterFacade *tp = TransporterFacade::instance(); + if (tp == 0 || tp->ownId() == 0) + return -1; + + unsigned int foundAliveNode = 0; + tp->lock_mutex(); + for(unsigned i= 0; i < no_db_nodes(); i++) + { + //************************************************ + // If any node is answering, ndb is answering + //************************************************ + if (tp->get_node_alive(m_impl.m_all_nodes[i].id) != 0) { + foundAliveNode++; + } + } + tp->unlock_mutex(); + + return foundAliveNode; +} + int Ndb_cluster_connection::wait_until_ready(int timeout, int timeout_after_first_alive) @@ -206,18 +227,7 @@ int milliCounter = 0; int noChecksSinceFirstAliveFound = 0; do { - unsigned int foundAliveNode = 0; - tp->lock_mutex(); - for(unsigned i= 0; i < no_db_nodes(); i++) - { - //************************************************ - // If any node is answering, ndb is answering - //************************************************ - if (tp->get_node_alive(m_impl.m_all_nodes[i].id) != 0) { - foundAliveNode++; - } - } - tp->unlock_mutex(); + unsigned int foundAliveNode = get_no_ready(); if (foundAliveNode == no_db_nodes()) { @@ -264,9 +274,6 @@ m_connect_thread= 0; m_connect_callback= 0; - if (ndb_global_event_buffer_mutex == NULL) - ndb_global_event_buffer_mutex= NdbMutex_Create(); - #ifdef VM_TRACE if (ndb_print_state_mutex == NULL) ndb_print_state_mutex= NdbMutex_Create(); @@ -275,7 +282,7 @@ new ConfigRetriever(connect_string, NDB_VERSION, NODE_TYPE_API); if (m_config_retriever->hasError()) { - printf("Could not connect initialize handle to management server: %s", + printf("Could not initialize handle to management server: %s\n", m_config_retriever->getErrorString()); delete m_config_retriever; m_config_retriever= 0; @@ -311,11 +318,6 @@ { delete m_config_retriever; m_config_retriever= NULL; - } - if (ndb_global_event_buffer_mutex != NULL) - { - NdbMutex_Destroy(ndb_global_event_buffer_mutex); - ndb_global_event_buffer_mutex= NULL; } #ifdef VM_TRACE if (ndb_print_state_mutex != NULL)