From ee740746aff3c5163adfff481bc4cf70c37728f5 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Nov 2005 12:19:28 +0100 Subject: Import ndb varsize BitKeeper/deleted/.del-MetaData.cpp~146ae9865dd35829: Delete: storage/ndb/src/kernel/vm/MetaData.cpp BitKeeper/deleted/.del-MetaData.hpp~538342afcd8ac53c: Delete: storage/ndb/src/kernel/vm/MetaData.hpp BitKeeper/deleted/.del-DbtupLCP.cpp~855b1ed3fbc86a42: Delete: storage/ndb/src/kernel/blocks/dbtup/DbtupLCP.cpp BitKeeper/deleted/.del-DbtupSystemRestart.cpp~15b54d7e4e75d2d: Delete: storage/ndb/src/kernel/blocks/dbtup/DbtupSystemRestart.cpp BitKeeper/deleted/.del-DbtupUndoLog.cpp~5a2ef6e86b1404e9: Delete: storage/ndb/src/kernel/blocks/dbtup/DbtupUndoLog.cpp storage/ndb/include/kernel/signaldata/CreateFilegroup.hpp: New BitKeeper file ``storage/ndb/include/kernel/signaldata/CreateFilegroup.hpp'' storage/ndb/include/kernel/signaldata/CreateFilegroupImpl.hpp: New BitKeeper file ``storage/ndb/include/kernel/signaldata/CreateFilegroupImpl.hpp'' storage/ndb/include/kernel/signaldata/CreateObj.hpp: New BitKeeper file ``storage/ndb/include/kernel/signaldata/CreateObj.hpp'' storage/ndb/include/kernel/signaldata/DictObjOp.hpp: New BitKeeper file ``storage/ndb/include/kernel/signaldata/DictObjOp.hpp'' storage/ndb/include/kernel/signaldata/DropFilegroup.hpp: New BitKeeper file ``storage/ndb/include/kernel/signaldata/DropFilegroup.hpp'' storage/ndb/include/kernel/signaldata/DropFilegroupImpl.hpp: New BitKeeper file ``storage/ndb/include/kernel/signaldata/DropFilegroupImpl.hpp'' storage/ndb/include/kernel/signaldata/DropObj.hpp: New BitKeeper file ``storage/ndb/include/kernel/signaldata/DropObj.hpp'' storage/ndb/include/kernel/signaldata/Extent.hpp: New BitKeeper file ``storage/ndb/include/kernel/signaldata/Extent.hpp'' storage/ndb/include/kernel/signaldata/LgmanContinueB.hpp: New BitKeeper file ``storage/ndb/include/kernel/signaldata/LgmanContinueB.hpp'' storage/ndb/include/kernel/signaldata/PgmanContinueB.hpp: New BitKeeper file ``storage/ndb/include/kernel/signaldata/PgmanContinueB.hpp'' storage/ndb/include/kernel/signaldata/RestoreContinueB.hpp: New BitKeeper file ``storage/ndb/include/kernel/signaldata/RestoreContinueB.hpp'' storage/ndb/include/kernel/signaldata/RestoreImpl.hpp: New BitKeeper file ``storage/ndb/include/kernel/signaldata/RestoreImpl.hpp'' storage/ndb/include/kernel/signaldata/TsmanContinueB.hpp: New BitKeeper file ``storage/ndb/include/kernel/signaldata/TsmanContinueB.hpp'' storage/ndb/src/kernel/blocks/dbdih/printSysfile.cpp: New BitKeeper file ``storage/ndb/src/kernel/blocks/dbdih/printSysfile.cpp'' storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp: New BitKeeper file ``storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp'' storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp: New BitKeeper file ``storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp'' storage/ndb/src/kernel/blocks/dbtup/Undo_buffer.cpp: New BitKeeper file ``storage/ndb/src/kernel/blocks/dbtup/Undo_buffer.cpp'' storage/ndb/src/kernel/blocks/dbtup/Undo_buffer.hpp: New BitKeeper file ``storage/ndb/src/kernel/blocks/dbtup/Undo_buffer.hpp'' storage/ndb/src/kernel/blocks/dbtup/test_varpage.cpp: New BitKeeper file ``storage/ndb/src/kernel/blocks/dbtup/test_varpage.cpp'' storage/ndb/src/kernel/blocks/dbtup/tuppage.cpp: New BitKeeper file ``storage/ndb/src/kernel/blocks/dbtup/tuppage.cpp'' storage/ndb/src/kernel/blocks/dbtup/tuppage.hpp: New BitKeeper file ``storage/ndb/src/kernel/blocks/dbtup/tuppage.hpp'' storage/ndb/src/kernel/blocks/diskpage.cpp: New BitKeeper file ``storage/ndb/src/kernel/blocks/diskpage.cpp'' storage/ndb/src/kernel/blocks/diskpage.hpp: New BitKeeper file ``storage/ndb/src/kernel/blocks/diskpage.hpp'' storage/ndb/src/kernel/blocks/lgman.cpp: New BitKeeper file ``storage/ndb/src/kernel/blocks/lgman.cpp'' storage/ndb/src/kernel/blocks/lgman.hpp: New BitKeeper file ``storage/ndb/src/kernel/blocks/lgman.hpp'' storage/ndb/src/kernel/blocks/pgman.cpp: New BitKeeper file ``storage/ndb/src/kernel/blocks/pgman.cpp'' storage/ndb/src/kernel/blocks/pgman.hpp: New BitKeeper file ``storage/ndb/src/kernel/blocks/pgman.hpp'' storage/ndb/src/kernel/blocks/print_file.cpp: New BitKeeper file ``storage/ndb/src/kernel/blocks/print_file.cpp'' storage/ndb/src/kernel/blocks/restore.cpp: New BitKeeper file ``storage/ndb/src/kernel/blocks/restore.cpp'' storage/ndb/src/kernel/blocks/restore.hpp: New BitKeeper file ``storage/ndb/src/kernel/blocks/restore.hpp'' storage/ndb/src/kernel/blocks/tsman.cpp: New BitKeeper file ``storage/ndb/src/kernel/blocks/tsman.cpp'' storage/ndb/src/kernel/blocks/tsman.hpp: New BitKeeper file ``storage/ndb/src/kernel/blocks/tsman.hpp'' storage/ndb/src/kernel/vm/DLCFifoList.hpp: New BitKeeper file ``storage/ndb/src/kernel/vm/DLCFifoList.hpp'' storage/ndb/src/kernel/vm/DLCHashTable.hpp: New BitKeeper file ``storage/ndb/src/kernel/vm/DLCHashTable.hpp'' storage/ndb/src/kernel/vm/KeyTable2Ref.hpp: New BitKeeper file ``storage/ndb/src/kernel/vm/KeyTable2Ref.hpp'' storage/ndb/src/kernel/vm/Rope.cpp: New BitKeeper file ``storage/ndb/src/kernel/vm/Rope.cpp'' storage/ndb/src/kernel/vm/Rope.hpp: New BitKeeper file ``storage/ndb/src/kernel/vm/Rope.hpp'' --- storage/ndb/src/ndbapi/NdbOperationDefine.cpp | 71 ++++++++++++--------------- 1 file changed, 32 insertions(+), 39 deletions(-) (limited to 'storage/ndb/src/ndbapi/NdbOperationDefine.cpp') diff --git a/storage/ndb/src/ndbapi/NdbOperationDefine.cpp b/storage/ndb/src/ndbapi/NdbOperationDefine.cpp index 6c417860464..6915a91dd12 100644 --- a/storage/ndb/src/ndbapi/NdbOperationDefine.cpp +++ b/storage/ndb/src/ndbapi/NdbOperationDefine.cpp @@ -340,6 +340,7 @@ NdbOperation::getValue_impl(const NdbColumnImpl* tAttrInfo, char* aValue) NdbRecAttr* tRecAttr; if ((tAttrInfo != NULL) && (theStatus != Init)){ + m_no_disk_flag &= (tAttrInfo->m_storageType == NDB_STORAGETYPE_DISK ? 0:1); if (theStatus != GetValue) { if (theInterpretIndicator == 1) { if (theStatus == FinalGetValue) { @@ -404,15 +405,12 @@ NdbOperation::getValue_impl(const NdbColumnImpl* tAttrInfo, char* aValue) ******************************************************************************/ 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,18 +481,16 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo, }//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 + // Insert Attribute Id into ATTRINFO part. tAttrId = tAttrInfo->m_attrId; + m_no_disk_flag &= (tAttrInfo->m_storageType == NDB_STORAGETYPE_DISK ? 0:1); const char *aValue = aValuePassed; Uint32 ahValue; if (aValue == NULL) { @@ -514,36 +510,15 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo, }//if }//if - // Insert Attribute Id into ATTRINFO part. - const Uint32 sizeInBytes = tAttrInfo->m_attrSize * tAttrInfo->m_arraySize; - -#if 0 - tAttrSize = tAttrInfo->theAttrSize; - tArraySize = tAttrInfo->theArraySize; - if (tArraySize == 0) { - setErrorCodeAbort(4201); - return -1; - }//if - tAttrSizeInBits = tAttrSize*tArraySize; - tAttrSizeInWords = tAttrSizeInBits >> 5; -#endif - const Uint32 bitsInLastWord = 8 * (sizeInBytes & 3) ; - if (len != sizeInBytes && (len != 0)) { + Uint32 len; + if (! tAttrInfo->get_var_length(aValue, len)) { setErrorCodeAbort(4209); DBUG_RETURN(-1); - }//if - const Uint32 totalSizeInWords = (sizeInBytes + 3)/4; // Including bits in last word - const Uint32 sizeInWords = sizeInBytes / 4; // Excluding bits in last word - AttributeHeader& ah = AttributeHeader::init(&ahValue, tAttrId, - totalSizeInWords << 2); - insertATTRINFO( ahValue ); + } - /*********************************************************************** - * Check if the pointer of the value passed is aligned on a 4 byte boundary. - * If so only assign the pointer to the internal variable aValue. - * If it is not aligned then we start by copying the value to tempData and - * use this as aValue instead. - *************************************************************************/ + const Uint32 sizeInBytes = len; + const Uint32 bitsInLastWord = 8 * (sizeInBytes & 3) ; + const int attributeSize = sizeInBytes; const int slack = sizeInBytes & 3; @@ -556,6 +531,20 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo, }//if }//if + // Including bits in last word + const Uint32 totalSizeInWords = (sizeInBytes + 3)/4; + // Excluding bits in last word + const Uint32 sizeInWords = sizeInBytes / 4; + AttributeHeader& ah = AttributeHeader::init(&ahValue, tAttrId, sizeInBytes); + insertATTRINFO( ahValue ); + + /*********************************************************************** + * Check if the pointer of the value passed is aligned on a 4 byte boundary. + * If so only assign the pointer to the internal variable aValue. + * If it is not aligned then we start by copying the value to tempData and + * use this as aValue instead. + *************************************************************************/ + tReturnCode = insertATTRINFOloop((Uint32*)aValue, sizeInWords); if (tReturnCode == -1) { DBUG_RETURN(tReturnCode); @@ -572,6 +561,10 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo, }//if theErrorLine++; DBUG_RETURN(0); + +error: + setErrorCodeAbort(tReturnCode); + DBUG_RETURN(-1); }//NdbOperation::setValue() NdbBlob* -- cgit v1.2.1