mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 05:52:27 +01:00
Merge perch.ndb.mysql.com:/home/jonas/src/51-work
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Auto merged storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Auto merged storage/ndb/src/ndbapi/NdbScanOperation.cpp: Auto merged
This commit is contained in:
commit
8a2744da76
6 changed files with 1126 additions and 12 deletions
|
@ -8533,11 +8533,20 @@ void Dbdih::openingTableErrorLab(Signal* signal, FileRecordPtr filePtr)
|
|||
/* WE FAILED IN OPENING A FILE. IF THE FIRST FILE THEN TRY WITH THE */
|
||||
/* DUPLICATE FILE, OTHERWISE WE REPORT AN ERROR IN THE SYSTEM RESTART. */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
ndbrequire(filePtr.i == tabPtr.p->tabFile[0]);
|
||||
filePtr.i = tabPtr.p->tabFile[1];
|
||||
ptrCheckGuard(filePtr, cfileFileSize, fileRecord);
|
||||
openFileRw(signal, filePtr);
|
||||
filePtr.p->reqStatus = FileRecord::OPENING_TABLE;
|
||||
if (filePtr.i == tabPtr.p->tabFile[0])
|
||||
{
|
||||
filePtr.i = tabPtr.p->tabFile[1];
|
||||
ptrCheckGuard(filePtr, cfileFileSize, fileRecord);
|
||||
openFileRw(signal, filePtr);
|
||||
filePtr.p->reqStatus = FileRecord::OPENING_TABLE;
|
||||
}
|
||||
else
|
||||
{
|
||||
char buf[256];
|
||||
BaseString::snprintf(buf, "Error opening DIH schema files for table: %d",
|
||||
tabPtr.i);
|
||||
progError(__LINE__, NDBD_EXIT_AFS_NO_SUCH_FILE, buf);
|
||||
}
|
||||
}//Dbdih::openingTableErrorLab()
|
||||
|
||||
void Dbdih::readingTableLab(Signal* signal, FileRecordPtr filePtr)
|
||||
|
|
|
@ -12796,19 +12796,17 @@ void Dblqh::lastWriteInFileLab(Signal* signal)
|
|||
|
||||
void Dblqh::writePageZeroLab(Signal* signal)
|
||||
{
|
||||
if (false && logPartPtr.p->logPartState == LogPartRecord::FILE_CHANGE_PROBLEM)
|
||||
if (logPartPtr.p->logPartState == LogPartRecord::FILE_CHANGE_PROBLEM)
|
||||
{
|
||||
if (logPartPtr.p->firstLogQueue == RNIL)
|
||||
{
|
||||
jam();
|
||||
logPartPtr.p->logPartState = LogPartRecord::IDLE;
|
||||
ndbout_c("resetting logPartState to IDLE");
|
||||
}
|
||||
else
|
||||
{
|
||||
jam();
|
||||
logPartPtr.p->logPartState = LogPartRecord::ACTIVE;
|
||||
ndbout_c("resetting logPartState to ACTIVE");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
1015
storage/ndb/src/kernel/vm/DynArr256.cpp
Normal file
1015
storage/ndb/src/kernel/vm/DynArr256.cpp
Normal file
File diff suppressed because it is too large
Load diff
79
storage/ndb/src/kernel/vm/DynArr256.hpp
Normal file
79
storage/ndb/src/kernel/vm/DynArr256.hpp
Normal file
|
@ -0,0 +1,79 @@
|
|||
/* Copyright (C) 2003 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#ifndef DYNARR256_HPP
|
||||
#define DYNARR256_HPP
|
||||
|
||||
#include "Pool.hpp"
|
||||
|
||||
class DynArr256;
|
||||
struct DA256Page;
|
||||
|
||||
class DynArr256Pool
|
||||
{
|
||||
friend class DynArr256;
|
||||
public:
|
||||
DynArr256Pool();
|
||||
|
||||
void init(Uint32 type_id, const Pool_context& pc);
|
||||
|
||||
protected:
|
||||
Uint32 m_type_id;
|
||||
Uint32 m_first_free;
|
||||
Pool_context m_ctx;
|
||||
struct DA256Page* m_memroot;
|
||||
|
||||
private:
|
||||
Uint32 seize();
|
||||
void release(Uint32);
|
||||
};
|
||||
|
||||
class DynArr256
|
||||
{
|
||||
public:
|
||||
struct Head
|
||||
{
|
||||
Head() { m_ptr_i = RNIL; m_sz = 0;}
|
||||
|
||||
Uint32 m_ptr_i;
|
||||
Uint32 m_sz;
|
||||
};
|
||||
|
||||
DynArr256(DynArr256Pool & pool, Head& head) :
|
||||
m_head(head), m_pool(pool){}
|
||||
|
||||
Uint32* set(Uint32 pos);
|
||||
Uint32* get(Uint32 pos) const ;
|
||||
|
||||
struct ReleaseIterator
|
||||
{
|
||||
Uint32 m_sz;
|
||||
Uint32 m_pos;
|
||||
Uint32 m_ptr_i[4];
|
||||
};
|
||||
|
||||
void init(ReleaseIterator&);
|
||||
bool release(ReleaseIterator&);
|
||||
|
||||
protected:
|
||||
Head & m_head;
|
||||
DynArr256Pool & m_pool;
|
||||
|
||||
bool expand(Uint32 pos);
|
||||
void handle_invalid_ptr(Uint32 pos, Uint32 ptrI, Uint32 p0);
|
||||
};
|
||||
|
||||
#endif
|
|
@ -20,7 +20,8 @@ libkernel_a_SOURCES = \
|
|||
Mutex.cpp SafeCounter.cpp \
|
||||
Rope.cpp \
|
||||
ndbd_malloc.cpp ndbd_malloc_impl.cpp \
|
||||
Pool.cpp WOPool.cpp RWPool.cpp
|
||||
Pool.cpp WOPool.cpp RWPool.cpp \
|
||||
DynArr256.cpp
|
||||
|
||||
INCLUDES_LOC = -I$(top_srcdir)/storage/ndb/src/mgmapi
|
||||
|
||||
|
@ -44,7 +45,7 @@ libkernel.dsp: Makefile \
|
|||
@$(top_srcdir)/storage/ndb/config/win-sources $@ $(libkernel_a_SOURCES)
|
||||
@$(top_srcdir)/storage/ndb/config/win-libraries $@ LIB $(LDADD)
|
||||
|
||||
EXTRA_PROGRAMS = ndbd_malloc_impl_test bench_pool
|
||||
EXTRA_PROGRAMS = ndbd_malloc_impl_test bench_pool testDynArr256
|
||||
ndbd_malloc_impl_test_CXXFLAGS = -DUNIT_TEST
|
||||
ndbd_malloc_impl_test_SOURCES = ndbd_malloc_impl.cpp
|
||||
ndbd_malloc_impl_test_LDFLAGS = @ndb_bin_am_ldflags@ \
|
||||
|
@ -54,9 +55,19 @@ ndbd_malloc_impl_test_LDFLAGS = @ndb_bin_am_ldflags@ \
|
|||
$(top_builddir)/strings/libmystrings.a
|
||||
|
||||
bench_pool_SOURCES = bench_pool.cpp
|
||||
bench_pool_LDFLAGS = @ndb_bin_am_ldflags@ ../SimBlockList.o \
|
||||
bench_pool_LDFLAGS = @ndb_bin_am_ldflags@\
|
||||
libkernel.a ../error/liberror.a \
|
||||
$(top_builddir)/storage/ndb/src/libndbclient.la \
|
||||
$(top_builddir)/mysys/libmysys.a \
|
||||
$(top_builddir)/dbug/libdbug.a \
|
||||
$(top_builddir)/strings/libmystrings.a
|
||||
|
||||
testDynArr256_CXXFLAGS = -DUNIT_TEST
|
||||
testDynArr256_SOURCES = DynArr256.cpp
|
||||
testDynArr256_LDFLAGS = @ndb_bin_am_ldflags@ \
|
||||
libkernel.a ../error/liberror.a \
|
||||
$(top_builddir)/storage/ndb/src/libndbclient.la \
|
||||
$(top_builddir)/mysys/libmysys.a \
|
||||
$(top_builddir)/dbug/libdbug.a \
|
||||
$(top_builddir)/strings/libmystrings.a
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ Uint32 sizes = 7;
|
|||
unsigned int seed;
|
||||
Ndbd_mem_manager mm;
|
||||
Configuration cfg;
|
||||
Block_context ctx = { cfg, mm };
|
||||
Block_context ctx(cfg, mm);
|
||||
struct BB : public SimulatedBlock
|
||||
{
|
||||
BB(int no, Block_context& ctx) : SimulatedBlock(no, ctx) {}
|
||||
|
@ -548,6 +548,8 @@ main(int argc, char **argv)
|
|||
}
|
||||
|
||||
Uint32 g_currentStartPhase;
|
||||
Uint32 g_start_type;
|
||||
NdbNodeBitmask g_nowait_nodes;
|
||||
|
||||
void childExit(int code, Uint32 currentStartPhase)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue