diff options
author | unknown <joreland@mysql.com> | 2005-02-24 20:57:32 +0100 |
---|---|---|
committer | unknown <joreland@mysql.com> | 2005-02-24 20:57:32 +0100 |
commit | 2f7fde4877b127e318b89ecf3ea9c5c9fefac86e (patch) | |
tree | a914f76139555e36611d008dfdd6ddd07fd463c0 /ndb/src/ndbapi | |
parent | 1c2ea24efa893d197e1dee68f08d8ce4c7f992b3 (diff) | |
parent | c7fefed4b88871b495bb893fcec8a9baabb2990c (diff) | |
download | mariadb-git-2f7fde4877b127e318b89ecf3ea9c5c9fefac86e.tar.gz |
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into mysql.com:/home/jonas/src/mysql-5.0-ndb
sql/ha_ndbcluster.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
Diffstat (limited to 'ndb/src/ndbapi')
-rw-r--r-- | ndb/src/ndbapi/NdbDictionaryImpl.hpp | 13 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbOperationInt.cpp | 20 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbScanFilter.cpp | 4 |
3 files changed, 28 insertions, 9 deletions
diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/ndb/src/ndbapi/NdbDictionaryImpl.hpp index b42c5416d83..59a5956715a 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.hpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.hpp @@ -76,8 +76,10 @@ public: Uint32 m_attrSize; // element size (size when arraySize==1) Uint32 m_arraySize; // length or length+2 for Var* types Uint32 m_keyInfoPos; + // TODO: use bits in attr desc 2 bool getInterpretableType() const ; bool getCharType() const; + bool getStringType() const; bool getBlobType() const; /** @@ -468,6 +470,17 @@ NdbColumnImpl::getCharType() const { m_type == NdbDictionary::Column::Text || m_type == NdbDictionary::Column::Longvarchar); } + +inline +bool +NdbColumnImpl::getStringType() const { + return (m_type == NdbDictionary::Column::Char || + m_type == NdbDictionary::Column::Varchar || + m_type == NdbDictionary::Column::Longvarchar || + m_type == NdbDictionary::Column::Binary || + m_type == NdbDictionary::Column::Varbinary || + m_type == NdbDictionary::Column::Longvarbinary); +} inline bool diff --git a/ndb/src/ndbapi/NdbOperationInt.cpp b/ndb/src/ndbapi/NdbOperationInt.cpp index 5b98f090395..acfc80b3b69 100644 --- a/ndb/src/ndbapi/NdbOperationInt.cpp +++ b/ndb/src/ndbapi/NdbOperationInt.cpp @@ -1014,8 +1014,14 @@ NdbOperation::branch_col(Uint32 type, Uint32 ColId, const void * val, Uint32 len, bool nopad, Uint32 Label){ + DBUG_ENTER("NdbOperation::branch_col"); + DBUG_PRINT("enter", ("type=%u col=%u val=0x%x len=%u label=%u", + type, ColId, val, len, Label)); + if (val != NULL) + DBUG_DUMP("value", (char*)val, len); + if (initial_interpreterCheck() == -1) - return -1; + DBUG_RETURN(-1); Interpreter::BinaryCondition c = (Interpreter::BinaryCondition)type; @@ -1029,26 +1035,26 @@ NdbOperation::branch_col(Uint32 type, if (val == NULL) len = 0; else { - if (! col->getCharType()) { + if (! col->getStringType()) { // prevent assert in NdbSqlUtil on length error Uint32 sizeInBytes = col->m_attrSize * col->m_arraySize; if (len != 0 && len != sizeInBytes) { setErrorCodeAbort(4209); - return -1; + DBUG_RETURN(-1); } len = sizeInBytes; } } if (insertATTRINFO(Interpreter::BranchCol(c, 0, 0, false)) == -1) - return -1; + DBUG_RETURN(-1); if (insertBranch(Label) == -1) - return -1; + DBUG_RETURN(-1); if (insertATTRINFO(Interpreter::BranchCol_2(ColId, len))) - return -1; + DBUG_RETURN(-1); Uint32 len2 = Interpreter::mod4(len); if(len2 == len){ @@ -1065,7 +1071,7 @@ NdbOperation::branch_col(Uint32 type, } theErrorLine++; - return 0; + DBUG_RETURN(0); } int diff --git a/ndb/src/ndbapi/NdbScanFilter.cpp b/ndb/src/ndbapi/NdbScanFilter.cpp index bc3505d7abd..b39fd10fe95 100644 --- a/ndb/src/ndbapi/NdbScanFilter.cpp +++ b/ndb/src/ndbapi/NdbScanFilter.cpp @@ -405,8 +405,8 @@ NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition op, return -1; } - (m_operation->* branch)(AttrId, value, len, false, m_current.m_ownLabel); - return 0; + int ret = (m_operation->* branch)(AttrId, value, len, false, m_current.m_ownLabel); + return ret; } int |