Below is the list of changes that have just been committed into a local
5.1 repository of pekka. When pekka 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
storage/ndb/src/ndbapi/NdbScanOperation.cpp
1.60 05/06/14 10:41:57 pekka@stripped +10 -15
deprecate length in equal/setValue/setBound
storage/ndb/src/ndbapi/NdbOperationSearch.cpp
1.24 05/06/14 10:41:57 pekka@stripped +5 -10
deprecate length in equal/setValue/setBound
storage/ndb/src/ndbapi/NdbOperationDefine.cpp
1.26 05/06/14 10:41:57 pekka@stripped +6 -12
deprecate length in equal/setValue/setBound
storage/ndb/src/ndbapi/NdbOperation.cpp
1.19 05/06/14 10:41:57 pekka@stripped +8 -16
deprecate length in equal/setValue/setBound
storage/ndb/src/ndbapi/NdbBlob.cpp
1.23 05/06/14 10:41:57 pekka@stripped +3 -3
deprecate length in equal/setValue/setBound
storage/ndb/include/ndbapi/NdbOperation.hpp
1.32 05/06/14 10:41:57 pekka@stripped +66 -33
deprecate length in equal/setValue/setBound
storage/ndb/include/ndbapi/NdbIndexScanOperation.hpp
1.21 05/06/14 10:41:57 pekka@stripped +28 -6
deprecate length in equal/setValue/setBound
sql/ha_ndbcluster.cc
1.142 05/06/14 10:41:56 pekka@stripped +7 -11
deprecate length in equal/setValue/setBound
ChangeSet
1.1908 05/06/14 10:28:13 pekka@stripped +8 -0
ndb - deprecate length in equal/setValue/setBound.
Var* uses length bytes in data.
# 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: pekka
# Host: tuna.ndb.mysql.com
# Root: /orca/space/pekka/ndb/version/my51-vs
--- 1.20/storage/ndb/include/ndbapi/NdbIndexScanOperation.hpp 2005-05-24 17:30:57 +02:00
+++ 1.21/storage/ndb/include/ndbapi/NdbIndexScanOperation.hpp 2005-06-14 10:41:57 +02:00
@@ -111,17 +111,23 @@
* @param attr Attribute name, alternatively:
* @param type Type of bound
* @param value Pointer to bound value, 0 for NULL
- * @param len Value length in bytes.
- * Fixed per datatype and can be omitted
* @return 0 if successful otherwise -1
+ *
+ * @note See comment under equal() about data format and length.
*/
- int setBound(const char* attr, int type, const void* value, Uint32 len = 0);
+#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
+ int setBound(const char* attr, int type, const void* value, Uint32 len);
+#endif
+ int setBound(const char* attr, int type, const void* value);
/**
* Define bound on index key in range scan using index column id.
* See the other setBound() method for details.
*/
- int setBound(Uint32 anAttrId, int type, const void* aValue, Uint32 len = 0);
+#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
+ int setBound(Uint32 anAttrId, int type, const void* aValue, Uint32 len);
+#endif
+ int setBound(Uint32 anAttrId, int type, const void* aValue);
/**
* Reset bounds and put operation in list that will be
@@ -153,10 +159,10 @@
NdbIndexScanOperation(Ndb* aNdb);
virtual ~NdbIndexScanOperation();
- int setBound(const NdbColumnImpl*, int type, const void* aValue, Uint32 len);
+ int setBound(const NdbColumnImpl*, int type, const void* aValue);
int insertBOUNDS(Uint32 * data, Uint32 sz);
- virtual int equal_impl(const NdbColumnImpl*, const char*, Uint32);
+ virtual int equal_impl(const NdbColumnImpl*, const char*);
virtual NdbRecAttr* getValue_impl(const NdbColumnImpl*, char*);
void fix_get_values();
@@ -169,5 +175,21 @@
Uint32 m_this_bound_start;
Uint32 * m_first_bound_word;
};
+
+inline
+int
+NdbIndexScanOperation::setBound(const char* attr, int type, const void* value,
+ Uint32 len)
+{
+ return setBound(attr, type, value);
+}
+
+inline
+int
+NdbIndexScanOperation::setBound(Uint32 anAttrId, int type, const void* value,
+ Uint32 len)
+{
+ return setBound(anAttrId, type, value);
+}
#endif
--- 1.31/storage/ndb/include/ndbapi/NdbOperation.hpp 2005-04-29 16:30:21 +02:00
+++ 1.32/storage/ndb/include/ndbapi/NdbOperation.hpp 2005-06-14 10:41:57 +02:00
@@ -250,28 +250,27 @@
* @note There are 10 versions of equal() with
* slightly different parameters.
*
- * @note When using equal() with a string (char *) as
- * second argument, the string needs to be padded with
- * zeros in the following sense:
- * @code
- * // Equal needs strings to be padded with zeros
- * strncpy(buf, str, sizeof(buf));
- * NdbOperation->equal("Attr1", buf);
- * @endcode
- *
- *
+ * @note If attribute has fixed size, value must include all bytes.
+ * In particular a Char must be native-blank padded.
+ * If attribute has variable size, value must start with
+ * 1 or 2 little-endian length bytes (2 if Long*).
*
* @param anAttrName Attribute name
* @param aValue Attribute value.
- * @param len Attribute length expressed in bytes.
* @return -1 if unsuccessful.
*/
- int equal(const char* anAttrName, const char* aValue, Uint32 len = 0);
- int equal(const char* anAttrName, Uint32 aValue);
+#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
+ int equal(const char* anAttrName, const char* aValue, Uint32 len);
+#endif
+ int equal(const char* anAttrName, const char* aValue);
int equal(const char* anAttrName, Int32 aValue);
+ int equal(const char* anAttrName, Uint32 aValue);
int equal(const char* anAttrName, Int64 aValue);
int equal(const char* anAttrName, Uint64 aValue);
- int equal(Uint32 anAttrId, const char* aValue, Uint32 len = 0);
+#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
+ int equal(Uint32 anAttrId, const char* aValue, Uint32 len);
+#endif
+ int equal(Uint32 anAttrId, const char* aValue);
int equal(Uint32 anAttrId, Int32 aValue);
int equal(Uint32 anAttrId, Uint32 aValue);
int equal(Uint32 anAttrId, Int64 aValue);
@@ -348,28 +347,34 @@
*
* @note There are 14 versions of NdbOperation::setValue with
* slightly different parameters.
+ *
+ * @note See note under equal() about value format and length.
*
* @param anAttrName Name (or Id) of attribute.
* @param aValue Attribute value to set.
- * @param len Attribute length expressed in bytes.
* @return -1 if unsuccessful.
*/
- virtual int setValue(const char* anAttrName, const char* aValue,
- Uint32 len = 0);
- virtual int setValue(const char* anAttrName, Int32 aValue);
- virtual int setValue(const char* anAttrName, Uint32 aValue);
- virtual int setValue(const char* anAttrName, Uint64 aValue);
- virtual int setValue(const char* anAttrName, Int64 aValue);
- virtual int setValue(const char* anAttrName, float aValue);
- virtual int setValue(const char* anAttrName, double aValue);
-
- virtual int setValue(Uint32 anAttrId, const char* aValue, Uint32 len = 0);
- virtual int setValue(Uint32 anAttrId, Int32 aValue);
- virtual int setValue(Uint32 anAttrId, Uint32 aValue);
- virtual int setValue(Uint32 anAttrId, Uint64 aValue);
- virtual int setValue(Uint32 anAttrId, Int64 aValue);
- virtual int setValue(Uint32 anAttrId, float aValue);
- virtual int setValue(Uint32 anAttrId, double aValue);
+#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
+ int setValue(const char* anAttrName, const char* aValue, Uint32 len);
+#endif
+ int setValue(const char* anAttrName, const char* aValue);
+ int setValue(const char* anAttrName, Int32 aValue);
+ int setValue(const char* anAttrName, Uint32 aValue);
+ int setValue(const char* anAttrName, Int64 aValue);
+ int setValue(const char* anAttrName, Uint64 aValue);
+ int setValue(const char* anAttrName, float aValue);
+ int setValue(const char* anAttrName, double aValue);
+
+#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
+ int setValue(Uint32 anAttrId, const char* aValue, Uint32 len);
+#endif
+ int setValue(Uint32 anAttrId, const char* aValue);
+ int setValue(Uint32 anAttrId, Int32 aValue);
+ int setValue(Uint32 anAttrId, Uint32 aValue);
+ int setValue(Uint32 anAttrId, Int64 aValue);
+ int setValue(Uint32 anAttrId, Uint64 aValue);
+ int setValue(Uint32 anAttrId, float aValue);
+ int setValue(Uint32 anAttrId, double aValue);
/**
* This method replaces getValue/setValue for blobs. It creates
@@ -834,9 +839,9 @@
* These are support methods only used locally in this class.
******************************************************************************/
- virtual int equal_impl(const NdbColumnImpl*,const char* aValue, Uint32 len);
+ virtual int equal_impl(const NdbColumnImpl*,const char* aValue);
virtual NdbRecAttr* getValue_impl(const NdbColumnImpl*, char* aValue = 0);
- int setValue(const NdbColumnImpl* anAttrObject, const char* aValue, Uint32 len);
+ int setValue(const NdbColumnImpl* anAttrObject, const char* aValue);
NdbBlob* getBlobHandle(NdbTransaction* aCon, const NdbColumnImpl* anAttrObject);
int incValue(const NdbColumnImpl* anAttrObject, Uint32 aValue);
int incValue(const NdbColumnImpl* anAttrObject, Uint64 aValue);
@@ -1083,6 +1088,13 @@
inline
int
+NdbOperation::equal(const char* anAttrName, const char* aValue, Uint32 len)
+{
+ return equal(anAttrName, aValue);
+}
+
+inline
+int
NdbOperation::equal(const char* anAttrName, Int32 aPar)
{
return equal(anAttrName, (const char*)&aPar, (Uint32)4);
@@ -1111,6 +1123,13 @@
inline
int
+NdbOperation::equal(Uint32 anAttrId, const char* aValue, Uint32 len)
+{
+ return equal(anAttrId, aValue);
+}
+
+inline
+int
NdbOperation::equal(Uint32 anAttrId, Int32 aPar)
{
return equal(anAttrId, (const char*)&aPar, (Uint32)4);
@@ -1139,6 +1158,13 @@
inline
int
+NdbOperation::setValue(const char* anAttrName, const char* aValue, Uint32 len)
+{
+ return setValue(anAttrName, aValue);
+}
+
+inline
+int
NdbOperation::setValue(const char* anAttrName, Int32 aPar)
{
return setValue(anAttrName, (const char*)&aPar, (Uint32)4);
@@ -1177,6 +1203,13 @@
NdbOperation::setValue(const char* anAttrName, double aPar)
{
return setValue(anAttrName, (const char*)&aPar, (Uint32)8);
+}
+
+inline
+int
+NdbOperation::setValue(Uint32 anAttrId, const char* aValue, Uint32 len)
+{
+ return setValue(anAttrId, aValue);
}
inline
--- 1.18/storage/ndb/src/ndbapi/NdbOperation.cpp 2005-04-29 16:30:28 +02:00
+++ 1.19/storage/ndb/src/ndbapi/NdbOperation.cpp 2005-06-14 10:41:57 +02:00
@@ -283,36 +283,28 @@
}
int
-NdbOperation::equal(const char* anAttrName,
- const char* aValuePassed,
- Uint32 aVariableKeyLen)
+NdbOperation::equal(const char* anAttrName, const char* aValuePassed)
{
- return equal_impl(m_accessTable->getColumn(anAttrName), aValuePassed,
aVariableKeyLen);
+ return equal_impl(m_accessTable->getColumn(anAttrName), aValuePassed);
}
int
-NdbOperation::equal(Uint32 anAttrId,
- const char* aValuePassed,
- Uint32 aVariableKeyLen)
+NdbOperation::equal(Uint32 anAttrId, const char* aValuePassed)
{
- return equal_impl(m_accessTable->getColumn(anAttrId), aValuePassed,
aVariableKeyLen);
+ return equal_impl(m_accessTable->getColumn(anAttrId), aValuePassed);
}
int
-NdbOperation::setValue( const char* anAttrName,
- const char* aValuePassed,
- Uint32 len)
+NdbOperation::setValue(const char* anAttrName, const char* aValuePassed)
{
- return setValue(m_currentTable->getColumn(anAttrName), aValuePassed, len);
+ return setValue(m_currentTable->getColumn(anAttrName), aValuePassed);
}
int
-NdbOperation::setValue( Uint32 anAttrId,
- const char* aValuePassed,
- Uint32 len)
+NdbOperation::setValue(Uint32 anAttrId, const char* aValuePassed)
{
- return setValue(m_currentTable->getColumn(anAttrId), aValuePassed, len);
+ return setValue(m_currentTable->getColumn(anAttrId), aValuePassed);
}
NdbBlob*
--- 1.25/storage/ndb/src/ndbapi/NdbOperationDefine.cpp 2005-04-29 16:30:29 +02:00
+++ 1.26/storage/ndb/src/ndbapi/NdbOperationDefine.cpp 2005-06-14 10:41:57 +02:00
@@ -404,15 +404,12 @@
******************************************************************************/
int
NdbOperation::setValue( const NdbColumnImpl* tAttrInfo,
- const char* aValuePassed, Uint32 len)
+ const char* aValuePassed)
{
DBUG_ENTER("NdbOperation::setValue");
- DBUG_PRINT("enter", ("col=%s op=%d val=0x%x len=%u",
- tAttrInfo->m_name.c_str(),
- theOperationType,
- aValuePassed, len));
- if (aValuePassed != NULL)
- DBUG_DUMP("value", (char*)aValuePassed, len);
+ DBUG_PRINT("enter", ("col=%s op=%d val=%p",
+ tAttrInfo->m_name.c_str(), theOperationType,
+ aValuePassed));
int tReturnCode;
Uint32 tAttrId;
@@ -483,16 +480,12 @@
}//if
if (tAttrInfo->m_pk) {
if (theOperationType == InsertRequest) {
- DBUG_RETURN(equal_impl(tAttrInfo, aValuePassed, len));
+ DBUG_RETURN(equal_impl(tAttrInfo, aValuePassed));
} else {
setErrorCodeAbort(4202);
DBUG_RETURN(-1);
}//if
}//if
- if (len > 8000) {
- setErrorCodeAbort(4216);
- DBUG_RETURN(-1);
- }//if
tAttrId = tAttrInfo->m_attrId;
const char *aValue = aValuePassed;
@@ -519,6 +512,7 @@
const Uint32 tAttrSize = tAttrInfo->m_attrSize;
const Uint32 tArraySize = tAttrInfo->m_arraySize;
+ Uint32 len;
const Uint32 max = tAttrSize * tArraySize;
switch(tArrayType){
case NDB_ARRAYTYPE_SHORT_VAR:
--- 1.23/storage/ndb/src/ndbapi/NdbOperationSearch.cpp 2005-04-29 16:30:29 +02:00
+++ 1.24/storage/ndb/src/ndbapi/NdbOperationSearch.cpp 2005-06-14 10:41:57 +02:00
@@ -54,16 +54,12 @@
******************************************************************************/
int
NdbOperation::equal_impl(const NdbColumnImpl* tAttrInfo,
- const char* aValuePassed,
- Uint32 aVariableKeyLen)
+ const char* aValuePassed)
{
DBUG_ENTER("NdbOperation::equal_impl");
- DBUG_PRINT("enter", ("col=%s op=%d val=0x%x len=%u",
- tAttrInfo->m_name.c_str(),
- theOperationType,
- aValuePassed, aVariableKeyLen));
- if (aValuePassed != NULL)
- DBUG_DUMP("value", (char*)aValuePassed, aVariableKeyLen);
+ DBUG_PRINT("enter", ("col=%s op=%d val=%p",
+ tAttrInfo->m_name.c_str(), theOperationType,
+ aValuePassed));
register Uint32 tAttrId;
@@ -156,8 +152,7 @@
Uint32 tTupKeyLen = theTupKeyLen;
theTupKeyLen = tTupKeyLen + totalSizeInWords;
- if ((aVariableKeyLen == sizeInBytes) ||
- (aVariableKeyLen == 0)) {
+ if (true) {
;
} else {
goto equal_error3;
--- 1.59/storage/ndb/src/ndbapi/NdbScanOperation.cpp 2005-06-13 08:09:37 +02:00
+++ 1.60/storage/ndb/src/ndbapi/NdbScanOperation.cpp 2005-06-14 10:41:57 +02:00
@@ -1023,23 +1023,23 @@
int
NdbIndexScanOperation::setBound(const char* anAttrName, int type,
- const void* aValue, Uint32 len)
+ const void* aValue)
{
- return setBound(m_accessTable->getColumn(anAttrName), type, aValue, len);
+ return setBound(m_accessTable->getColumn(anAttrName), type, aValue);
}
int
NdbIndexScanOperation::setBound(Uint32 anAttrId, int type,
- const void* aValue, Uint32 len)
+ const void* aValue)
{
- return setBound(m_accessTable->getColumn(anAttrId), type, aValue, len);
+ return setBound(m_accessTable->getColumn(anAttrId), type, aValue);
}
int
NdbIndexScanOperation::equal_impl(const NdbColumnImpl* anAttrObject,
- const char* aValue,
- Uint32 len){
- return setBound(anAttrObject, BoundEQ, aValue, len);
+ const char* aValue)
+{
+ return setBound(anAttrObject, BoundEQ, aValue);
}
NdbRecAttr*
@@ -1086,22 +1086,17 @@
*/
int
NdbIndexScanOperation::setBound(const NdbColumnImpl* tAttrInfo,
- int type, const void* aValue, Uint32 len)
+ int type, const void* aValue)
{
if (theOperationType == OpenRangeScanRequest &&
- (0 <= type && type <= 4) &&
- len <= 8000) {
+ (0 <= type && type <= 4)) {
// insert bound type
Uint32 currLen = theTotalNrOfKeyWordInSignal;
Uint32 remaining = KeyInfo::DataLength - currLen;
Uint32 sizeInBytes = tAttrInfo->m_attrSize * tAttrInfo->m_arraySize;
bool tDistrKey = tAttrInfo->m_distributionKey;
- len = aValue != NULL ? sizeInBytes : 0;
- if (len != sizeInBytes && (len != 0)) {
- setErrorCodeAbort(4209);
- return -1;
- }
+ Uint32 len = aValue != NULL ? sizeInBytes : 0;
// insert attribute header
Uint32 tIndexAttrId = tAttrInfo->m_attrId;
--- 1.141/sql/ha_ndbcluster.cc 2005-06-13 15:24:42 +02:00
+++ 1.142/sql/ha_ndbcluster.cc 2005-06-14 10:41:56 +02:00
@@ -593,8 +593,7 @@
uint fieldnr, const byte *field_ptr)
{
DBUG_ENTER("set_hidden_key");
- DBUG_RETURN(ndb_op->equal(fieldnr, (char*)field_ptr,
- NDB_HIDDEN_PRIMARY_KEY_LENGTH) != 0);
+ DBUG_RETURN(ndb_op->equal(fieldnr, (char*)field_ptr) != 0);
}
@@ -616,7 +615,7 @@
{
if (! (field->flags & BLOB_FLAG))
// Common implementation for most field types
- DBUG_RETURN(ndb_op->equal(fieldnr, (char*) field_ptr, pack_len) != 0);
+ DBUG_RETURN(ndb_op->equal(fieldnr, (char*) field_ptr) != 0);
}
// Unhandled field types
DBUG_PRINT("error", ("Field type %d not supported", field->type()));
@@ -658,11 +657,9 @@
{
if (field->is_null())
// Set value to NULL
- DBUG_RETURN((ndb_op->setValue(fieldnr,
- (char*)NULL, pack_len) != 0));
+ DBUG_RETURN((ndb_op->setValue(fieldnr, (char*)NULL) != 0));
// Common implementation for most field types
- DBUG_RETURN(ndb_op->setValue(fieldnr,
- (char*)field_ptr, pack_len) != 0);
+ DBUG_RETURN(ndb_op->setValue(fieldnr, (char*)field_ptr) != 0);
}
else // if (field->type() == MYSQL_TYPE_BIT)
{
@@ -673,17 +670,16 @@
DBUG_ASSERT(pack_len <= 8);
if (field->is_null())
// Set value to NULL
- DBUG_RETURN((ndb_op->setValue(fieldnr, (char*)NULL, pack_len) != 0));
+ DBUG_RETURN((ndb_op->setValue(fieldnr, (char*)NULL) != 0));
DBUG_PRINT("info", ("bit field"));
DBUG_DUMP("value", (char*)&bits, pack_len);
#ifdef WORDS_BIGENDIAN
if (pack_len < 5)
{
- DBUG_RETURN(ndb_op->setValue(fieldnr,
- ((char*)&bits)+4, pack_len) != 0);
+ DBUG_RETURN(ndb_op->setValue(fieldnr, ((char*)&bits)+4) != 0);
}
#endif
- DBUG_RETURN(ndb_op->setValue(fieldnr, (char*)&bits, pack_len) != 0);
+ DBUG_RETURN(ndb_op->setValue(fieldnr, (char*)&bits) != 0);
}
}
// Blob type
--- 1.22/storage/ndb/src/ndbapi/NdbBlob.cpp 2005-06-13 15:24:51 +02:00
+++ 1.23/storage/ndb/src/ndbapi/NdbBlob.cpp 2005-06-14 10:41:57 +02:00
@@ -330,7 +330,7 @@
assert(c != NULL);
if (c->m_pk) {
unsigned len = c->m_attrSize * c->m_arraySize;
- if (anOp->equal_impl(c, (const char*)&data[pos], len) == -1) {
+ if (anOp->equal_impl(c, (const char*)&data[pos]) == -1) {
setErrorCode(anOp);
DBUG_RETURN(-1);
}
@@ -354,7 +354,7 @@
assert(c != NULL);
if (c->m_pk) {
unsigned len = c->m_attrSize * c->m_arraySize;
- if (anOp->equal_impl(c, (const char*)&data[pos], len) == -1) {
+ if (anOp->equal_impl(c, (const char*)&data[pos]) == -1) {
setErrorCode(anOp);
DBUG_RETURN(-1);
}
@@ -415,7 +415,7 @@
memset(theInlineData + theLength, 0, theInlineSize - theLength);
assert(theNullFlag != -1);
const char* aValue = theNullFlag ? 0 : theHeadInlineBuf.data;
- if (anOp->setValue(theColumn, aValue, theHeadInlineBuf.size) == -1) {
+ if (anOp->setValue(theColumn, aValue) == -1) {
setErrorCode(anOp);
DBUG_RETURN(-1);
}
| Thread |
|---|
| • bk commit into 5.1 tree (pekka:1.1908) | pekka | 14 Jun |