Skip to content

Commit

Permalink
RONDB-780: Fix bug in write_attr instruction in DBTUP interpreter and…
Browse files Browse the repository at this point in the history
… fixed compilation issue with number of fragments
  • Loading branch information
mikaelronstrom committed Jan 1, 2025
1 parent f10c122 commit 674bef3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build_scripts/build_script_prefix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ SRC_DIR=$1
if [ -z $SRC_DIR ]; then
SRC_DIR=./..
fi
cmake -DWITH_DEBUG=0 -DWITH_SSL=$OPENSSL_ROOT -DWITH_RDRS=1 -DWITH_NDB=1 -DWITH_NDB_TEST=1 -DWITH_NDBAPI_EXAMPLES=1 -DWITH_ROUTER=0 -DWITH_UNIT_TESTS=1 -DWITH_ERROR_INSERT=0 -DCMAKE_INSTALL_PREFIX=${PREFIX_DIR} -DCPACK_MONOLITHIC_INSTALL=true -DBUILD_CONFIG=mysql_release $SRC_DIR
cmake -DWITH_DEBUG=0 -DWITH_SSL=$OPENSSL_ROOT -DWITH_RDRS=1 -DWITH_NDB=1 -DWITH_NDB_TEST=1 -DWITH_NDBAPI_EXAMPLES=1 -DWITH_ROUTER=0 -DWITH_UNIT_TESTS=1 -DWITH_ERROR_INSERT=0 -DWITH_NDB_JAVA=0 -DCMAKE_INSTALL_PREFIX=${PREFIX_DIR} -DCPACK_MONOLITHIC_INSTALL=true -DBUILD_CONFIG=mysql_release $SRC_DIR
make -j$(nproc)
make install
3 changes: 2 additions & 1 deletion storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,7 @@ class Dblqh : public SimulatedBlock {
typedef DLFifo64List<Fragrecord_pool> Fragrecord_fifo;
RSS_OP_COUNTER(cnoOfAllocatedFragrec);
RSS_OP_SNAPSHOT(cnoOfAllocatedFragrec);
Uint32 c_num_fragments;

/* $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ */
/* $$$$$$$ GLOBAL CHECKPOINT RECORD $$$$$$ */
Expand Down Expand Up @@ -4073,7 +4074,7 @@ class Dblqh : public SimulatedBlock {
Fragrecord_pool c_fragment_pool;
RSS_AP_SNAPSHOT(c_fragment_pool);

Uint32 get_num_fragments() { return cnoOfAllocatedFragrec; }
Uint32 get_num_fragments() { return c_num_fragments; }
CopyFragRecord_pool c_copy_fragment_pool;
CopyActiveRecord_pool c_copy_active_pool;

Expand Down
1 change: 1 addition & 0 deletions storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,7 @@ Dblqh::Dblqh(Block_context &ctx, Uint32 instanceNumber, Uint32 blockNo)
m_current_ldm_instance = 0;

RSS_OP_COUNTER_INIT(cnoOfAllocatedFragrec);
c_num_fragments = 0;

c_transient_pools[DBLQH_OPERATION_RECORD_TRANSIENT_POOL_INDEX] =
&tcConnect_pool;
Expand Down
3 changes: 3 additions & 0 deletions storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32136,6 +32136,8 @@ void Dblqh::deleteFragrec(Uint32 fragId)
NdbMutex_Deinit(&fragptr.p->frag_mutex);
c_fragment_pool.release(fragptr);
RSS_OP_FREE(cnoOfAllocatedFragrec);
ndbrequire(c_num_fragments > 0);
c_num_fragments--;
}
} // Dblqh::deleteFragrec()

Expand Down Expand Up @@ -33410,6 +33412,7 @@ bool Dblqh::insertFragrec(Signal* signal,
if (freeEntry != RNIL)
{
RSS_OP_ALLOC(cnoOfAllocatedFragrec);
c_num_fragments++;
tabptr.p->num_fragments++;
return true;
}
Expand Down
5 changes: 1 addition & 4 deletions storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4706,9 +4706,6 @@ int Dbtup::interpreterNextLab(Signal* signal,
}
Uint32 TattrDesc1 =
req_struct->tablePtrP->tabDescriptor[TattrDescrIndex];
if (unlikely((TregType == NULL_INDICATOR))) {
return TUPKEY_abort(req_struct, ZREGISTER_INIT_ERROR);
}
/* --------------------------------------------------------------- */
// Calculate the number of words of this attribute.
// We allow writes into arrays as long as they fit into the 64 bit
Expand All @@ -4733,7 +4730,7 @@ int Dbtup::interpreterNextLab(Signal* signal,
TdataForUpdate[1] = Uint32(* tmp);
TdataForUpdate[2] = 0;
}
if (TregType == 0) {
if (TregType == NULL_INDICATOR) {
/* --------------------------------------------------------- */
// Write a NULL value into the attribute
/* --------------------------------------------------------- */
Expand Down

0 comments on commit 674bef3

Please sign in to comment.