Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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.2433 07/03/08 15:57:33 tomas@stripped +2 -0
Merge poseidon.mysql.com:/home/tomas/mysql-5.0-telco-gca-ndb_restore
into poseidon.mysql.com:/home/tomas/mysql-5.1-telco-gca-ndb_restore
storage/ndb/src/ndbapi/NdbRecAttr.cpp
1.37 07/03/08 15:57:25 tomas@stripped +0 -2
manual merge
storage/ndb/include/ndbapi/NdbRecAttr.hpp
1.21 07/03/08 15:55:01 tomas@stripped +0 -0
Auto merged
storage/ndb/src/ndbapi/NdbRecAttr.cpp
1.20.13.2 07/03/08 15:55:01 tomas@stripped +0 -0
Merge rename: ndb/src/ndbapi/NdbRecAttr.cpp ->
storage/ndb/src/ndbapi/NdbRecAttr.cpp
storage/ndb/include/ndbapi/NdbRecAttr.hpp
1.15.4.2 07/03/08 15:55:01 tomas@stripped +0 -0
Merge rename: ndb/include/ndbapi/NdbRecAttr.hpp ->
storage/ndb/include/ndbapi/NdbRecAttr.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: tomas
# Host: poseidon.mysql.com
# Root: /home/tomas/mysql-5.1-telco-gca-ndb_restore/RESYNC
--- 1.15.4.1/ndb/include/ndbapi/NdbRecAttr.hpp 2007-03-08 15:37:46 +07:00
+++ 1.21/storage/ndb/include/ndbapi/NdbRecAttr.hpp 2007-03-08 15:55:01 +07:00
@@ -96,25 +96,9 @@ public:
/**
* Get attribute (element) size in bytes.
*
- * @note For arrays, the method only gives the size of an element.
- * The total attribute size is calculated by
- * multiplying this value with the value
- * returned by NdbRecAttr::arraySize.
- *
- * @return Attribute size in 32 bit unsigned int.
*/
- Uint32 attrSize() const ;
+ Uint32 get_size_in_bytes() const { return m_size_in_bytes; }
- /**
- * Get array size of attribute.
- * For variable-sized arrays this method returns the
- * size of the attribute read.
- *
- * @return array size in 32 unsigned int.
- */
- Uint32 arraySize() const ;
- Uint32 getLength() const ;
-
/** @} *********************************************************************/
/**
* @name Getting stored value
@@ -265,7 +249,8 @@ private:
Uint32 attrId() const; /* Get attribute id */
bool setNULL(); /* Set NULL indicator */
- void setUNDEFINED(); /* Set UNDEFINED indicator */
+ void setUNDEFINED(); //
+
bool receive_data(const Uint32*, Uint32);
void release(); /* Release memory if allocated */
@@ -288,11 +273,8 @@ private:
NdbRecAttr* theNext; /* Next pointer */
Uint32 theAttrId; /* The attribute id */
-
- int theNULLind;
- bool m_nullable;
- Uint32 theAttrSize;
- Uint32 theArraySize;
+
+ Int32 m_size_in_bytes;
const NdbDictionary::Column* m_column;
friend struct Ndb_free_list_t<NdbRecAttr>;
@@ -313,19 +295,6 @@ NdbRecAttr::getColumn() const {
}
inline
-Uint32
-NdbRecAttr::attrSize() const {
- return theAttrSize;
-}
-
-inline
-Uint32
-NdbRecAttr::arraySize() const
-{
- return theArraySize;
-}
-
-inline
Int32
NdbRecAttr::int32_value() const
{
@@ -403,7 +372,6 @@ NdbRecAttr::init()
theRef = 0;
theNext = 0;
theAttrId = 0xFFFF;
- theNULLind = -1;
}
inline
@@ -452,22 +420,22 @@ inline
bool
NdbRecAttr::setNULL()
{
- theNULLind = 1;
- return m_nullable;
+ m_size_in_bytes= 0;
+ return true;
}
inline
-void
-NdbRecAttr::setUNDEFINED()
+int
+NdbRecAttr::isNULL() const
{
- theNULLind = -1;
+ return m_size_in_bytes == 0 ? 1 : (m_size_in_bytes > 0 ? 0 : -1);
}
inline
-int
-NdbRecAttr::isNULL() const
+void
+NdbRecAttr::setUNDEFINED()
{
- return theNULLind;
+ m_size_in_bytes= -1;
}
class NdbOut& operator <<(class NdbOut&, const NdbRecAttr &);
--- 1.20.13.1/ndb/src/ndbapi/NdbRecAttr.cpp 2007-03-08 15:37:46 +07:00
+++ 1.37/storage/ndb/src/ndbapi/NdbRecAttr.cpp 2007-03-08 15:57:25 +07:00
@@ -37,6 +37,7 @@ NdbRecAttr::setup(const class NdbDiction
{
return setup(&(col->m_impl), aValue);
}
+
int
NdbRecAttr::setup(const NdbColumnImpl* anAttrInfo, char* aValue)
{
@@ -47,11 +48,8 @@ NdbRecAttr::setup(const NdbColumnImpl* a
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;
@@ -92,7 +90,7 @@ NdbRecAttr::copyout()
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++;
}
@@ -104,12 +102,10 @@ NdbRecAttr::clone() const {
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;
@@ -125,17 +121,19 @@ NdbRecAttr::clone() const {
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;
}
@@ -292,15 +290,15 @@ ndbrecattr_print_formatted(NdbOut& out,
case NdbDictionary::Column::Binary:
if (!f.hex_format)
out << fields_optionally_enclosed_by;
- j = r.arraySize();
+ j = r.get_size_in_bytes();
ndbrecattr_print_string(out,f,"Binary", true, r.aRef(), j);
if (!f.hex_format)
out << fields_optionally_enclosed_by;
break;
case NdbDictionary::Column::Char:
out << fields_optionally_enclosed_by;
- j = length;
- ndbrecattr_print_string(out,f,"Char", false, r.aRef(), r.arraySize());
+ j = r.get_size_in_bytes();
+ ndbrecattr_print_string(out,f,"Char", false, r.aRef(), j);
out << fields_optionally_enclosed_by;
break;
case NdbDictionary::Column::Varchar:
@@ -433,10 +431,10 @@ ndbrecattr_print_formatted(NdbOut& out,
memcpy(&head, r.aRef(), sizeof(head));
out << head.length << ":";
const unsigned char* p = (const unsigned char*)r.aRef() + sizeof(head);
- if (r.arraySize() < sizeof(head))
+ if (r.get_size_in_bytes() < sizeof(head))
out << "***error***"; // really cannot happen
else {
- unsigned n = r.arraySize() - sizeof(head);
+ unsigned n = r.get_size_in_bytes() - sizeof(head);
for (unsigned k = 0; k < n && k < head.length; k++) {
if (r.getType() == NdbDictionary::Column::Blob)
out.print("%02X", (int)p[k]);
| Thread |
|---|
| • bk commit into 5.1 tree (tomas:1.2433) | tomas | 8 Mar |