Below is the list of changes that have just been committed into a local
5.1-ndb repository of jonas. When jonas 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.1815 05/04/01 17:01:30 joreland@stripped +4 -0
wl1866 ndb disk/varsize
fix more size change cases
ndb/src/kernel/blocks/dbtup/tuppage.hpp
1.7 05/04/01 17:01:26 joreland@stripped +1 -1
Fix more handle_size_change_after_update
ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
1.57 05/04/01 17:01:26 joreland@stripped +23 -14
Fix more handle_size_change_after_update
ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp
1.29 05/04/01 17:01:26 joreland@stripped +1 -1
Fix more handle_size_change_after_update
ndb/src/kernel/blocks/dbtup/Dbtup.hpp
1.52 05/04/01 17:01:26 joreland@stripped +2 -1
Fix more handle_size_change_after_update
# 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: joreland
# Host: eel.hemma.oreland.se.ndb.mysql.com
# Root: /home/jonas/src/mysql-5.1-ndb-dd
--- 1.6/ndb/src/kernel/blocks/dbtup/tuppage.hpp Fri Apr 1 13:11:10 2005
+++ 1.7/ndb/src/kernel/blocks/dbtup/tuppage.hpp Fri Apr 1 17:01:26 2005
@@ -185,7 +185,7 @@
*pos= (idx & 0xFFFF) + (new_size << 16);
Uint32 old_size= idx >> 16;
- assert(old_size > new_size);
+ assert(old_size >= new_size);
Uint32 shrink = old_size - new_size;
free_space+= shrink;
--- 1.51/ndb/src/kernel/blocks/dbtup/Dbtup.hpp Fri Apr 1 13:11:10 2005
+++ 1.52/ndb/src/kernel/blocks/dbtup/Dbtup.hpp Fri Apr 1 17:01:26 2005
@@ -2343,7 +2343,8 @@
friend class NdbOut& operator<<(NdbOut&, const Th&);
#endif
- void expand_tuple(KeyReqStruct*, Uint32 sizes[4], const Tuple_header*, const
Tablerec*);
+ void expand_tuple(KeyReqStruct*, Uint32 sizes[4], Tuple_header*org,
+ const Tablerec*);
void shrink_tuple(KeyReqStruct*, Uint32 sizes[2], const Tablerec*);
Uint32* get_ptr(Var_part_ref);
--- 1.28/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp Fri Apr 1 15:37:12 2005
+++ 1.29/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp Fri Apr 1 17:01:26 2005
@@ -150,7 +150,7 @@
Uint32 sz= Tuple_header::HeaderSize + fix_size +
((((mm_vars + 1) << 1) + (((Uint16*)var_part)[mm_vars]) + 3)>> 2);
- ndbassert(sz < len);
+ ndbassert(sz <= len);
pageP->shrink_entry(idx, sz);
}
else if(bits & Tuple_header::MM_SHRINK)
--- 1.56/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp Fri Apr 1 13:11:10 2005
+++ 1.57/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp Fri Apr 1 17:01:26 2005
@@ -240,19 +240,19 @@
Uint32 checksum;
Uint32 i, rec_size, *tuple_header;
rec_size= regTabPtr->m_offsets[MM].m_fix_header_size;
- tuple_header= (Uint32*)&tuple_ptr->m_header_bits;
+ tuple_header= tuple_ptr->m_data;
checksum= 0;
// includes tupVersion
//printf("%p - ", tuple_ptr);
-
+
if (regTabPtr->m_attributes[MM].m_no_of_varsize)
rec_size += Tuple_header::HeaderSize;
-
- for (i= 0; i < rec_size-1; i++) {
+
+ for (i= 0; i < rec_size-2; i++) {
checksum ^= tuple_header[i];
//printf("%.8x ", tuple_header[i]);
}
-
+
//printf("-> %.8x\n", checksum);
#if 0
@@ -2441,7 +2441,7 @@
void
Dbtup::expand_tuple(KeyReqStruct* req_struct, Uint32 sizes[2],
- const Tuple_header* src, const Tablerec* tabPtrP)
+ Tuple_header* src, const Tablerec* tabPtrP)
{
Uint32 bits= src->m_header_bits;
Tuple_header* ptr= req_struct->m_tuple_ptr;
@@ -2485,7 +2485,7 @@
ndbassert(dst_ptr == ALIGN_WORD(dst->m_data_ptr + dst->m_max_var_offset));
ndbassert((UintPtr(src_ptr) & 3) == 0);
src_ptr = ALIGN_WORD(((char*)src_ptr)+step);
-
+
sizes[MM] += fix_size + Tuple_header::HeaderSize;
memcpy(ptr, src, 4*(fix_size + Tuple_header::HeaderSize));
}
@@ -2496,7 +2496,9 @@
memcpy(ptr, src, 4*fix_size);
}
- ptr->m_header_bits= bits | Tuple_header::DISK_INLINE;
+ ptr->m_header_bits= Tuple_header::DISK_INLINE | bits;
+ src->m_header_bits= bits &
+ ~(Uint32)(Tuple_header::MM_SHRINK | Tuple_header::MM_GROWN);
sizes[DD]= 0;
if(dd_tot)
@@ -2668,7 +2670,15 @@
printf("grow - ");
Var_page* pageP= req_struct->m_varpart_page_ptr_p;
Uint32 idx= regOperPtr->m_tuple_location.m_page_idx;
- Uint32 add= sizes[2+MM] - sizes[MM];
+ Uint32 alloc= pageP->get_entry_len(idx);
+ if(sizes[2+MM] <= alloc)
+ {
+ ndbassert(!regOperPtr->is_first_operation());
+ ndbout_c(" no grow");
+ return 0;
+ }
+ Uint32 add= sizes[2+MM] - alloc;
+
if(pageP->free_space >= add)
{
jam();
@@ -2684,14 +2694,13 @@
* the page before reorg_page to save the entry contents.
*/
Uint32* copyBuffer= cinBuffer;
- assert(sizes[MM] == pageP->get_entry_len(idx));
- memcpy(copyBuffer, pageP->get_ptr(idx), 4*sizes[MM]);
+ memcpy(copyBuffer, pageP->get_ptr(idx), 4*alloc);
pageP->set_entry_len(idx, 0);
- pageP->free_space += sizes[MM];
+ pageP->free_space += alloc;
pageP->reorg((Var_page*)ctemp_page);
- memcpy(pageP->get_free_space_ptr(), copyBuffer, 4*sizes[MM]);
+ memcpy(pageP->get_free_space_ptr(), copyBuffer, 4*alloc);
pageP->set_entry_offset(idx, pageP->insert_pos);
- add += sizes[MM];
+ add += alloc;
}
pageP->grow_entry(idx, add);
req_struct->m_tuple_ptr->m_header_bits |= Tuple_header::MM_GROWN;
| Thread |
|---|
| • bk commit into 5.1-ndb tree (joreland:1.1815) | jonas.oreland | 1 Apr |