Merge mysql.com:/home/jimw/my/mysql-4.1-clean

into  mysql.com:/home/jimw/my/mysql-5.0-clean
This commit is contained in:
jimw@mysql.com 2005-08-31 15:24:06 -07:00
commit 1d997477aa
37 changed files with 370 additions and 483 deletions

View File

@ -43,7 +43,7 @@ typedef struct st_mem_root
unsigned int block_num; /* allocated blocks counter */
/*
first free block in queue test counter (if it exceed
MAX_BLOCK_USAGE_BEFORE_DROP block will be droped in 'used' list)
MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list)
*/
unsigned int first_block_usage;

View File

@ -555,3 +555,6 @@ FROM t1 JOIN t2 ON t1.bID = t2.bID;
COUNT(*) GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |')
2 test
DROP TABLE t1,t2;
select * from (select group_concat('c') from DUAL) t;
group_concat('c')
NULL

View File

@ -350,4 +350,9 @@ SELECT COUNT(*), GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |')
DROP TABLE t1,t2;
#
# Bug #12861 hang with group_concat insubquery FROM DUAL
#
select * from (select group_concat('c') from DUAL) t;
# End of 4.1 tests

View File

@ -167,7 +167,7 @@ drop database mysqltest2;
save_master_pos;
connection slave;
sync_with_master;
# These has to be droped on slave as they are not replicated
# These have to be dropped on slave because they are not replicated
drop database mysqltest2;
drop database mysqltest3;

View File

@ -89,7 +89,7 @@ DROP TABLE db, host, user, func, tables_priv, columns_priv, procs_priv, help_cat
-- enable_query_log
# check that we droped all system tables
# check that we dropped all system tables
show tables;
# End of 4.1 tests

View File

@ -31,25 +31,7 @@
* SENDER: Ndbfs
* RECIVER:
*/
class FsRef {
/**
* Reciver(s)
*/
friend class Dbdict;
friend class Backup;
/**
* Sender(s)
*/
friend class Ndbfs;
friend class VoidFs;
/**
* For printing
*/
friend bool printFSREF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
public:
struct FsRef {
/**
* Enum type for errorCode
*/
@ -73,8 +55,6 @@ public:
*/
STATIC_CONST( SignalLength = 4 );
private:
/**
* DATA VARIABLES
*/

View File

@ -150,16 +150,16 @@ Backup::Backup(const Configuration & conf) :
addRecSignal(GSN_DI_FCOUNTCONF, &Backup::execDI_FCOUNTCONF);
addRecSignal(GSN_DIGETPRIMCONF, &Backup::execDIGETPRIMCONF);
addRecSignal(GSN_FSOPENREF, &Backup::execFSOPENREF);
addRecSignal(GSN_FSOPENREF, &Backup::execFSOPENREF, true);
addRecSignal(GSN_FSOPENCONF, &Backup::execFSOPENCONF);
addRecSignal(GSN_FSCLOSEREF, &Backup::execFSCLOSEREF);
addRecSignal(GSN_FSCLOSEREF, &Backup::execFSCLOSEREF, true);
addRecSignal(GSN_FSCLOSECONF, &Backup::execFSCLOSECONF);
addRecSignal(GSN_FSAPPENDREF, &Backup::execFSAPPENDREF);
addRecSignal(GSN_FSAPPENDREF, &Backup::execFSAPPENDREF, true);
addRecSignal(GSN_FSAPPENDCONF, &Backup::execFSAPPENDCONF);
addRecSignal(GSN_FSREMOVEREF, &Backup::execFSREMOVEREF);
addRecSignal(GSN_FSREMOVEREF, &Backup::execFSREMOVEREF, true);
addRecSignal(GSN_FSREMOVECONF, &Backup::execFSREMOVECONF);
/*****/

View File

@ -905,17 +905,12 @@ private:
void execACC_TO_REQ(Signal* signal);
void execACC_LOCKREQ(Signal* signal);
void execFSOPENCONF(Signal* signal);
void execFSOPENREF(Signal* signal);
void execFSCLOSECONF(Signal* signal);
void execFSCLOSEREF(Signal* signal);
void execFSWRITECONF(Signal* signal);
void execFSWRITEREF(Signal* signal);
void execFSREADCONF(Signal* signal);
void execFSREADREF(Signal* signal);
void execNDB_STTOR(Signal* signal);
void execDROP_TAB_REQ(Signal* signal);
void execFSREMOVECONF(Signal* signal);
void execFSREMOVEREF(Signal* signal);
void execREAD_CONFIG_REQ(Signal* signal);
void execSET_VAR_REQ(Signal* signal);
void execDUMP_STATE_ORD(Signal* signal);

View File

@ -188,17 +188,12 @@ Dbacc::Dbacc(const class Configuration & conf):
addRecSignal(GSN_ACC_TO_REQ, &Dbacc::execACC_TO_REQ);
addRecSignal(GSN_ACC_LOCKREQ, &Dbacc::execACC_LOCKREQ);
addRecSignal(GSN_FSOPENCONF, &Dbacc::execFSOPENCONF);
addRecSignal(GSN_FSOPENREF, &Dbacc::execFSOPENREF);
addRecSignal(GSN_FSCLOSECONF, &Dbacc::execFSCLOSECONF);
addRecSignal(GSN_FSCLOSEREF, &Dbacc::execFSCLOSEREF);
addRecSignal(GSN_FSWRITECONF, &Dbacc::execFSWRITECONF);
addRecSignal(GSN_FSWRITEREF, &Dbacc::execFSWRITEREF);
addRecSignal(GSN_FSREADCONF, &Dbacc::execFSREADCONF);
addRecSignal(GSN_FSREADREF, &Dbacc::execFSREADREF);
addRecSignal(GSN_NDB_STTOR, &Dbacc::execNDB_STTOR);
addRecSignal(GSN_DROP_TAB_REQ, &Dbacc::execDROP_TAB_REQ);
addRecSignal(GSN_FSREMOVECONF, &Dbacc::execFSREMOVECONF);
addRecSignal(GSN_FSREMOVEREF, &Dbacc::execFSREMOVEREF);
addRecSignal(GSN_READ_CONFIG_REQ, &Dbacc::execREAD_CONFIG_REQ, true);
addRecSignal(GSN_SET_VAR_REQ, &Dbacc::execSET_VAR_REQ);

View File

@ -251,15 +251,6 @@ void Dbacc::execFSCLOSECONF(Signal* signal)
return;
}//Dbacc::execFSCLOSECONF()
/* ******************--------------------------------------------------------------- */
/* FSCLOSEREF OPENFILE CONF */
/* ******************------------------------------+ */
/* SENDER: FS, LEVEL B */
void Dbacc::execFSCLOSEREF(Signal* signal)
{
jamEntry();
ndbrequire(false);
}//Dbacc::execFSCLOSEREF()
/* ******************--------------------------------------------------------------- */
/* FSOPENCONF OPENFILE CONF */
@ -307,15 +298,6 @@ void Dbacc::execFSOPENCONF(Signal* signal)
return;
}//Dbacc::execFSOPENCONF()
/* ******************--------------------------------------------------------------- */
/* FSOPENREF OPENFILE REF */
/* ******************------------------------------+ */
/* SENDER: FS, LEVEL B */
void Dbacc::execFSOPENREF(Signal* signal)
{
jamEntry();
ndbrequire(false);
}//Dbacc::execFSOPENREF()
/* ******************--------------------------------------------------------------- */
/* FSREADCONF OPENFILE CONF */
@ -369,16 +351,6 @@ void Dbacc::execFSREADCONF(Signal* signal)
return;
}//Dbacc::execFSREADCONF()
/* ******************--------------------------------------------------------------- */
/* FSREADRREF OPENFILE CONF */
/* ******************------------------------------+ */
/* SENDER: FS, LEVEL B */
void Dbacc::execFSREADREF(Signal* signal)
{
jamEntry();
progError(0, __LINE__, "Read of file refused");
return;
}//Dbacc::execFSREADREF()
/* ******************--------------------------------------------------------------- */
/* FSWRITECONF OPENFILE CONF */
@ -482,16 +454,6 @@ void Dbacc::execFSWRITECONF(Signal* signal)
return;
}//Dbacc::execFSWRITECONF()
/* ******************--------------------------------------------------------------- */
/* FSWRITEREF OPENFILE CONF */
/* ******************------------------------------+ */
/* SENDER: FS, LEVEL B */
void Dbacc::execFSWRITEREF(Signal* signal)
{
jamEntry();
progError(0, __LINE__, "Write to file refused");
return;
}//Dbacc::execFSWRITEREF()
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
@ -1436,10 +1398,6 @@ void Dbacc::execFSREMOVECONF(Signal* signal)
tabPtr.p->tabUserRef = 0;
}//Dbacc::execFSREMOVECONF()
void Dbacc::execFSREMOVEREF(Signal* signal)
{
ndbrequire(false);
}//Dbacc::execFSREMOVEREF()
/* -------------------------------------------------------------------------- */
/* ADDFRAGTOTAB */

View File

@ -400,14 +400,6 @@ void Dbdict::execFSCLOSECONF(Signal* signal)
}//switch
}//execFSCLOSECONF()
/* ---------------------------------------------------------------- */
// A close file was refused.
/* ---------------------------------------------------------------- */
void Dbdict::execFSCLOSEREF(Signal* signal)
{
jamEntry();
progError(0, 0);
}//execFSCLOSEREF()
/* ---------------------------------------------------------------- */
// A file was successfully opened.
@ -470,17 +462,21 @@ void Dbdict::execFSOPENREF(Signal* signal)
c_fsConnectRecordPool.getPtr(fsPtr, fsRef->userPointer);
switch (fsPtr.p->fsState) {
case FsConnectRecord::OPEN_READ_SCHEMA1:
jam();
openReadSchemaRef(signal, fsPtr);
break;
return;
case FsConnectRecord::OPEN_READ_TAB_FILE1:
jam();
openReadTableRef(signal, fsPtr);
break;
return;
default:
jamLine((fsPtr.p->fsState & 0xFFF));
ndbrequire(false);
break;
}//switch
{
char msg[100];
sprintf(msg, "File system open failed during FsConnectRecord state %d", (Uint32)fsPtr.p->fsState);
fsRefError(signal,__LINE__,msg);
}
}//execFSOPENREF()
/* ---------------------------------------------------------------- */
@ -520,17 +516,21 @@ void Dbdict::execFSREADREF(Signal* signal)
c_fsConnectRecordPool.getPtr(fsPtr, fsRef->userPointer);
switch (fsPtr.p->fsState) {
case FsConnectRecord::READ_SCHEMA1:
jam();
readSchemaRef(signal, fsPtr);
break;
return;
case FsConnectRecord::READ_TAB_FILE1:
jam();
readTableRef(signal, fsPtr);
break;
return;
default:
jamLine((fsPtr.p->fsState & 0xFFF));
ndbrequire(false);
break;
}//switch
{
char msg[100];
sprintf(msg, "File system read failed during FsConnectRecord state %d", (Uint32)fsPtr.p->fsState);
fsRefError(signal,__LINE__,msg);
}
}//execFSREADREF()
/* ---------------------------------------------------------------- */
@ -557,14 +557,6 @@ void Dbdict::execFSWRITECONF(Signal* signal)
}//switch
}//execFSWRITECONF()
/* ---------------------------------------------------------------- */
// A write file was refused.
/* ---------------------------------------------------------------- */
void Dbdict::execFSWRITEREF(Signal* signal)
{
jamEntry();
progError(0, 0);
}//execFSWRITEREF()
/* ---------------------------------------------------------------- */
// Routines to handle Read/Write of Table Files
@ -1327,13 +1319,11 @@ Dbdict::Dbdict(const class Configuration & conf):
addRecSignal(GSN_DICTSTARTREQ, &Dbdict::execDICTSTARTREQ);
addRecSignal(GSN_READ_NODESCONF, &Dbdict::execREAD_NODESCONF);
addRecSignal(GSN_FSOPENCONF, &Dbdict::execFSOPENCONF);
addRecSignal(GSN_FSOPENREF, &Dbdict::execFSOPENREF);
addRecSignal(GSN_FSOPENREF, &Dbdict::execFSOPENREF, true);
addRecSignal(GSN_FSCLOSECONF, &Dbdict::execFSCLOSECONF);
addRecSignal(GSN_FSCLOSEREF, &Dbdict::execFSCLOSEREF);
addRecSignal(GSN_FSWRITECONF, &Dbdict::execFSWRITECONF);
addRecSignal(GSN_FSWRITEREF, &Dbdict::execFSWRITEREF);
addRecSignal(GSN_FSREADCONF, &Dbdict::execFSREADCONF);
addRecSignal(GSN_FSREADREF, &Dbdict::execFSREADREF);
addRecSignal(GSN_FSREADREF, &Dbdict::execFSREADREF, true);
addRecSignal(GSN_LQHFRAGCONF, &Dbdict::execLQHFRAGCONF);
addRecSignal(GSN_LQHADDATTCONF, &Dbdict::execLQHADDATTCONF);
addRecSignal(GSN_LQHADDATTREF, &Dbdict::execLQHADDATTREF);

View File

@ -467,13 +467,11 @@ private:
void execSCHEMA_INFOCONF(Signal* signal);
void execREAD_NODESCONF(Signal* signal);
void execFSCLOSECONF(Signal* signal);
void execFSCLOSEREF(Signal* signal);
void execFSOPENCONF(Signal* signal);
void execFSOPENREF(Signal* signal);
void execFSREADCONF(Signal* signal);
void execFSREADREF(Signal* signal);
void execFSWRITECONF(Signal* signal);
void execFSWRITEREF(Signal* signal);
void execNDB_STTOR(Signal* signal);
void execREAD_CONFIG_REQ(Signal* signal);
void execSTTOR(Signal* signal);

View File

@ -206,13 +206,13 @@ Dbdih::Dbdih(const class Configuration & config):
addRecSignal(GSN_ADD_FRAGCONF, &Dbdih::execADD_FRAGCONF);
addRecSignal(GSN_ADD_FRAGREF, &Dbdih::execADD_FRAGREF);
addRecSignal(GSN_FSOPENCONF, &Dbdih::execFSOPENCONF);
addRecSignal(GSN_FSOPENREF, &Dbdih::execFSOPENREF);
addRecSignal(GSN_FSOPENREF, &Dbdih::execFSOPENREF, true);
addRecSignal(GSN_FSCLOSECONF, &Dbdih::execFSCLOSECONF);
addRecSignal(GSN_FSCLOSEREF, &Dbdih::execFSCLOSEREF);
addRecSignal(GSN_FSCLOSEREF, &Dbdih::execFSCLOSEREF, true);
addRecSignal(GSN_FSREADCONF, &Dbdih::execFSREADCONF);
addRecSignal(GSN_FSREADREF, &Dbdih::execFSREADREF);
addRecSignal(GSN_FSREADREF, &Dbdih::execFSREADREF, true);
addRecSignal(GSN_FSWRITECONF, &Dbdih::execFSWRITECONF);
addRecSignal(GSN_FSWRITEREF, &Dbdih::execFSWRITEREF);
addRecSignal(GSN_FSWRITEREF, &Dbdih::execFSWRITEREF, true);
addRecSignal(GSN_SET_VAR_REQ, &Dbdih::execSET_VAR_REQ);
addRecSignal(GSN_START_INFOREQ,

View File

@ -782,29 +782,36 @@ void Dbdih::execFSCLOSEREF(Signal* signal)
filePtr.p->reqStatus = FileRecord::IDLE;
switch (status) {
case FileRecord::CLOSING_GCP:
ndbrequire(false);
jam();
break;
case FileRecord::CLOSING_GCP_CRASH:
jam();
closingGcpCrashLab(signal, filePtr);
break;
return;
case FileRecord::CLOSING_TABLE_CRASH:
jam();
closingTableCrashLab(signal, filePtr);
break;
return;
case FileRecord::CLOSING_TABLE_SR:
ndbrequire(false);
jam();
break;
case FileRecord::TABLE_CLOSE:
ndbrequire(false);
jam();
break;
case FileRecord::TABLE_CLOSE_DELETE:
ndbrequire(false);
jam();
break;
default:
ndbrequire(false);
jam();
break;
}//switch
{
char msg[100];
sprintf(msg, "File system close failed during FileRecord status %d", (Uint32)status);
fsRefError(signal,__LINE__,msg);
}
return;
}//Dbdih::execFSCLOSEREF()
@ -868,34 +875,39 @@ void Dbdih::execFSOPENREF(Signal* signal)
/* WE DID NOT MANAGE TO CREATE A GLOBAL CHECKPOINT FILE. SERIOUS ERROR */
/* WHICH CAUSES A SYSTEM RESTART. */
/* --------------------------------------------------------------------- */
ndbrequire(false);
jam();
break;
case FileRecord::OPENING_COPY_GCI:
jam();
openingCopyGciErrorLab(signal, filePtr);
break;
return;
case FileRecord::CREATING_COPY_GCI:
ndbrequire(false);
jam();
break;
case FileRecord::OPENING_GCP:
jam();
openingGcpErrorLab(signal, filePtr);
break;
return;
case FileRecord::OPENING_TABLE:
jam();
openingTableErrorLab(signal, filePtr);
break;
return;
case FileRecord::TABLE_CREATE:
ndbrequire(false);
jam();
break;
case FileRecord::TABLE_OPEN_FOR_DELETE:
jam();
tableDeleteLab(signal, filePtr);
break;
return;
default:
ndbrequire(false);
jam();
break;
}//switch
{
char msg[100];
sprintf(msg, "File system open failed during FileRecord status %d", (Uint32)status);
fsRefError(signal,__LINE__,msg);
}
return;
}//Dbdih::execFSOPENREF()
@ -935,16 +947,19 @@ void Dbdih::execFSREADREF(Signal* signal)
case FileRecord::READING_GCP:
jam();
readingGcpErrorLab(signal, filePtr);
break;
return;
case FileRecord::READING_TABLE:
jam();
readingTableErrorLab(signal, filePtr);
break;
return;
default:
ndbrequire(false);
break;
}//switch
return;
{
char msg[100];
sprintf(msg, "File system read failed during FileRecord status %d", (Uint32)status);
fsRefError(signal,__LINE__,msg);
}
}//Dbdih::execFSREADREF()
void Dbdih::execFSWRITECONF(Signal* signal)
@ -989,22 +1004,27 @@ void Dbdih::execFSWRITEREF(Signal* signal)
/* EVEN CREATING THE FILE DID NOT WORK. WE WILL THEN CRASH. */
/* ERROR IN WRITING FILE. WE WILL NOT CONTINUE FROM HERE. */
/* --------------------------------------------------------------------- */
ndbrequire(false);
jam();
break;
case FileRecord::WRITE_INIT_GCP:
/* --------------------------------------------------------------------- */
/* AN ERROR OCCURRED IN WRITING A GCI FILE WHICH IS A SERIOUS ERROR */
/* THAT CAUSE A SYSTEM RESTART. */
/* --------------------------------------------------------------------- */
ndbrequire(false);
jam();
break;
case FileRecord::TABLE_WRITE:
ndbrequire(false);
jam();
break;
default:
ndbrequire(false);
jam();
break;
}//switch
{
char msg[100];
sprintf(msg, "File system write failed during FileRecord status %d", (Uint32)status);
fsRefError(signal,__LINE__,msg);
}
return;
}//Dbdih::execFSWRITEREF()

View File

@ -1,10 +1,16 @@
noinst_LIBRARIES = libdbdih.a
EXTRA_PROGRAMS = ndbd_sysfile_reader
libdbdih_a_SOURCES = DbdihInit.cpp DbdihMain.cpp
ndbd_sysfile_reader_SOURCES = printSysfile/printSysfile.cpp
include $(top_srcdir)/ndb/config/common.mk.am
include $(top_srcdir)/ndb/config/type_kernel.mk.am
LDADD += \
$(top_builddir)/ndb/src/common/util/libgeneral.la \
$(top_builddir)/ndb/src/common/portlib/libportlib.la
# Don't update the files from bitkeeper
%::SCCS/s.%

View File

@ -2178,9 +2178,7 @@ private:
void execTUP_SRREF(Signal* signal);
void execGCP_SAVEREQ(Signal* signal);
void execFSOPENCONF(Signal* signal);
void execFSOPENREF(Signal* signal);
void execFSCLOSECONF(Signal* signal);
void execFSCLOSEREF(Signal* signal);
void execFSWRITECONF(Signal* signal);
void execFSWRITEREF(Signal* signal);
void execFSREADCONF(Signal* signal);
@ -2189,7 +2187,6 @@ private:
void execSET_VAR_REQ(Signal* signal);
void execTIME_SIGNAL(Signal* signal);
void execFSSYNCCONF(Signal* signal);
void execFSSYNCREF(Signal* signal);
void execALTER_TAB_REQ(Signal* signal);
void execALTER_TAB_CONF(Signal* signal);

View File

@ -309,18 +309,15 @@ Dblqh::Dblqh(const class Configuration & conf):
addRecSignal(GSN_TUP_SRREF, &Dblqh::execTUP_SRREF);
addRecSignal(GSN_GCP_SAVEREQ, &Dblqh::execGCP_SAVEREQ);
addRecSignal(GSN_FSOPENCONF, &Dblqh::execFSOPENCONF);
addRecSignal(GSN_FSOPENREF, &Dblqh::execFSOPENREF);
addRecSignal(GSN_FSCLOSECONF, &Dblqh::execFSCLOSECONF);
addRecSignal(GSN_FSCLOSEREF, &Dblqh::execFSCLOSEREF);
addRecSignal(GSN_FSWRITECONF, &Dblqh::execFSWRITECONF);
addRecSignal(GSN_FSWRITEREF, &Dblqh::execFSWRITEREF);
addRecSignal(GSN_FSWRITEREF, &Dblqh::execFSWRITEREF, true);
addRecSignal(GSN_FSREADCONF, &Dblqh::execFSREADCONF);
addRecSignal(GSN_FSREADREF, &Dblqh::execFSREADREF);
addRecSignal(GSN_FSREADREF, &Dblqh::execFSREADREF, true);
addRecSignal(GSN_ACC_ABORTCONF, &Dblqh::execACC_ABORTCONF);
addRecSignal(GSN_SET_VAR_REQ, &Dblqh::execSET_VAR_REQ);
addRecSignal(GSN_TIME_SIGNAL, &Dblqh::execTIME_SIGNAL);
addRecSignal(GSN_FSSYNCCONF, &Dblqh::execFSSYNCCONF);
addRecSignal(GSN_FSSYNCREF, &Dblqh::execFSSYNCREF);
addRecSignal(GSN_REMOVE_MARKER_ORD, &Dblqh::execREMOVE_MARKER_ORD);
//addRecSignal(GSN_DROP_TAB_REQ, &Dblqh::execDROP_TAB_REQ);

View File

@ -11765,14 +11765,6 @@ Dblqh::execFSSYNCCONF(Signal* signal)
ccurrentGcprec = RNIL;
}//Dblqh::execFSSYNCCONF()
void
Dblqh::execFSSYNCREF(Signal* signal)
{
jamEntry();
systemErrorLab(signal);
return;
}//Dblqh::execFSSYNCREF()
/* ######################################################################### */
/* ####### FILE HANDLING MODULE ####### */
@ -11843,16 +11835,6 @@ void Dblqh::execFSCLOSECONF(Signal* signal)
}//switch
}//Dblqh::execFSCLOSECONF()
/* ************>> */
/* FSCLOSEREF > */
/* ************>> */
void Dblqh::execFSCLOSEREF(Signal* signal)
{
jamEntry();
terrorCode = signal->theData[1];
systemErrorLab(signal);
return;
}//Dblqh::execFSCLOSEREF()
/* ************>> */
/* FSOPENCONF > */
@ -11941,16 +11923,6 @@ void Dblqh::execFSOPENCONF(Signal* signal)
}//switch
}//Dblqh::execFSOPENCONF()
/* ************> */
/* FSOPENREF > */
/* ************> */
void Dblqh::execFSOPENREF(Signal* signal)
{
jamEntry();
terrorCode = signal->theData[1];
systemErrorLab(signal);
return;
}//Dblqh::execFSOPENREF()
/* ************>> */
/* FSREADCONF > */
@ -12028,60 +12000,43 @@ void Dblqh::execFSREADREF(Signal* signal)
jamEntry();
lfoPtr.i = signal->theData[0];
ptrCheckGuard(lfoPtr, clfoFileSize, logFileOperationRecord);
terrorCode = signal->theData[1];
switch (lfoPtr.p->lfoState) {
case LogFileOperationRecord::READ_SR_LAST_MBYTE:
jam();
systemErrorLab(signal);
return;
break;
case LogFileOperationRecord::READ_SR_FRONTPAGE:
jam();
systemErrorLab(signal);
return;
break;
case LogFileOperationRecord::READ_SR_LAST_FILE:
jam();
systemErrorLab(signal);
return;
break;
case LogFileOperationRecord::READ_SR_NEXT_FILE:
jam();
systemErrorLab(signal);
return;
break;
case LogFileOperationRecord::READ_EXEC_SR:
jam();
systemErrorLab(signal);
return;
break;
case LogFileOperationRecord::READ_EXEC_LOG:
jam();
systemErrorLab(signal);
return;
break;
case LogFileOperationRecord::READ_SR_FOURTH_PHASE:
jam();
systemErrorLab(signal);
return;
break;
case LogFileOperationRecord::READ_SR_FOURTH_ZERO:
jam();
systemErrorLab(signal);
return;
break;
case LogFileOperationRecord::READ_SR_INVALIDATE_PAGES:
jam()
systemErrorLab(signal);
return;
break;
default:
jam();
systemErrorLab(signal);
return;
break;
}//switch
return;
{
char msg[100];
sprintf(msg, "File system read failed during LogFileOperationRecord state %d", (Uint32)lfoPtr.p->lfoState);
fsRefError(signal,__LINE__,msg);
}
}//Dblqh::execFSREADREF()
/* *************** */
@ -12162,49 +12117,43 @@ void Dblqh::execFSWRITEREF(Signal* signal)
switch (lfoPtr.p->lfoState) {
case LogFileOperationRecord::WRITE_PAGE_ZERO:
jam();
systemErrorLab(signal);
break;
case LogFileOperationRecord::LAST_WRITE_IN_FILE:
jam();
systemErrorLab(signal);
break;
case LogFileOperationRecord::INIT_WRITE_AT_END:
jam();
systemErrorLab(signal);
break;
case LogFileOperationRecord::INIT_FIRST_PAGE:
jam();
systemErrorLab(signal);
break;
case LogFileOperationRecord::WRITE_GCI_ZERO:
jam();
systemErrorLab(signal);
break;
case LogFileOperationRecord::WRITE_DIRTY:
jam();
systemErrorLab(signal);
break;
case LogFileOperationRecord::WRITE_INIT_MBYTE:
jam();
systemErrorLab(signal);
break;
case LogFileOperationRecord::ACTIVE_WRITE_LOG:
jam();
systemErrorLab(signal);
break;
case LogFileOperationRecord::FIRST_PAGE_WRITE_IN_LOGFILE:
jam();
systemErrorLab(signal);
break;
case LogFileOperationRecord::WRITE_SR_INVALIDATE_PAGES:
jam();
systemErrorLab(signal);
break;
default:
jam();
systemErrorLab(signal);
break;
}//switch
{
char msg[100];
sprintf(msg, "File system write failed during LogFileOperationRecord state %d", (Uint32)lfoPtr.p->lfoState);
fsRefError(signal,__LINE__,msg);
}
}//Dblqh::execFSWRITEREF()

View File

@ -239,6 +239,17 @@ bool PageHeader::check() {
return true;
}
bool PageHeader::lastPage()
{
return m_next_page == 0xffffff00;
}
Uint32 PageHeader::lastWord()
{
return m_current_page_index;
}
NdbOut& operator<<(NdbOut& no, const PageHeader& ph) {
no << "------------PAGE HEADER------------------------" << endl << endl;
ndbout_c("%-30s%-12s%-12s\n", "", "Decimal", "Hex");

View File

@ -132,6 +132,8 @@ class PageHeader {
public:
bool check();
Uint32 getLogRecordSize();
bool lastPage();
Uint32 lastWord();
protected:
Uint32 m_checksum;
Uint32 m_lap;

View File

@ -35,7 +35,6 @@
#define FROM_BEGINNING 0
void usage(const char * prg);
Uint32 readRecordOverPageBoundary (Uint32 *, Uint32 , Uint32 , Uint32);
Uint32 readFromFile(FILE * f, Uint32 *toPtr, Uint32 sizeInWords);
void readArguments(int argc, const char** argv);
void doExit();
@ -54,8 +53,8 @@ Uint32 startAtPageIndex = 0;
Uint32 *redoLogPage;
NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read a redo log file", 16384) {
Uint32 pageIndex = 0;
Uint32 oldPageIndex = 0;
int wordIndex = 0;
int oldWordIndex = 0;
Uint32 recordType = 1234567890;
PageHeader *thePageHeader;
@ -83,48 +82,47 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
}
redoLogPage = new Uint32[PAGESIZE*NO_PAGES_IN_MBYTE];
Uint32 words_from_previous_page = 0;
// Loop for every mbyte.
for (Uint32 j = startAtMbyte; j < NO_MBYTE_IN_FILE; j++) {
bool lastPage = false;
for (Uint32 j = startAtMbyte; j < NO_MBYTE_IN_FILE && !lastPage; j++) {
readFromFile(f, redoLogPage, PAGESIZE*NO_PAGES_IN_MBYTE);
if (firstLap) {
pageIndex = startAtPageIndex;
firstLap = false;
} else
pageIndex = 0;
words_from_previous_page = 0;
// Loop for every page.
for (int i = startAtPage; i < NO_PAGES_IN_MBYTE; i++) {
if (pageIndex == 0) {
thePageHeader = (PageHeader *) &redoLogPage[i*PAGESIZE];
// Print out mbyte number, page number and page index.
ndbout << j << ":" << i << ":" << pageIndex << endl
<< " " << j*32 + i << ":" << pageIndex << " ";
if (thePrintFlag) ndbout << (*thePageHeader);
if (theCheckFlag) {
if(!thePageHeader->check()) {
ndbout << "Error in thePageHeader->check()" << endl;
doExit();
}
Uint32 checkSum = 37;
for (int ps = 1; ps < PAGESIZE; ps++)
checkSum = redoLogPage[i*PAGESIZE+ps] ^ checkSum;
if (checkSum != redoLogPage[i*PAGESIZE]){
ndbout << "WRONG CHECKSUM: checksum = " << redoLogPage[i*PAGESIZE]
<< " expected = " << checkSum << endl;
doExit();
}
else
ndbout << "expected checksum: " << checkSum << endl;
for (int i = 0; i < NO_PAGES_IN_MBYTE; i++) {
wordIndex = 0;
thePageHeader = (PageHeader *) &redoLogPage[i*PAGESIZE];
// Print out mbyte number, page number and page index.
ndbout << j << ":" << i << ":" << wordIndex << endl
<< " " << j*32 + i << ":" << wordIndex << " ";
if (thePrintFlag) ndbout << (*thePageHeader);
if (theCheckFlag) {
if(!thePageHeader->check()) {
ndbout << "Error in thePageHeader->check()" << endl;
doExit();
}
pageIndex += thePageHeader->getLogRecordSize();
Uint32 checkSum = 37;
for (int ps = 1; ps < PAGESIZE; ps++)
checkSum = redoLogPage[i*PAGESIZE+ps] ^ checkSum;
if (checkSum != redoLogPage[i*PAGESIZE]){
ndbout << "WRONG CHECKSUM: checksum = " << redoLogPage[i*PAGESIZE]
<< " expected = " << checkSum << endl;
doExit();
}
else
ndbout << "expected checksum: " << checkSum << endl;
}
lastPage = i != 0 && thePageHeader->lastPage();
Uint32 lastWord = thePageHeader->lastWord();
if (onlyMbyteHeaders) {
// Show only the first page header in every mbyte of the file.
break;
@ -132,18 +130,40 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
if (onlyPageHeaders) {
// Show only page headers. Continue with the next page in this for loop.
pageIndex = 0;
continue;
}
wordIndex = thePageHeader->getLogRecordSize() - words_from_previous_page;
Uint32 *redoLogPagePos = redoLogPage + i*PAGESIZE;
if (words_from_previous_page)
{
memmove(redoLogPagePos + wordIndex ,
redoLogPagePos - words_from_previous_page,
words_from_previous_page*4);
}
do {
// Print out mbyte number, page number and page index.
ndbout << j << ":" << i << ":" << pageIndex << endl
<< " " << j*32 + i << ":" << pageIndex << " ";
recordType = redoLogPage[i*PAGESIZE + pageIndex];
if (words_from_previous_page)
{
// Print out mbyte number, page number and word index.
ndbout << j << ":" << i-1 << ":" << PAGESIZE-words_from_previous_page << endl
<< j << ":" << i << ":" << wordIndex+words_from_previous_page << endl
<< " " << j*32 + i-1 << ":" << PAGESIZE-words_from_previous_page << " ";
words_from_previous_page = 0;
}
else
{
// Print out mbyte number, page number and word index.
ndbout << j << ":" << i << ":" << wordIndex << endl
<< " " << j*32 + i << ":" << wordIndex << " ";
}
redoLogPagePos = redoLogPage + i*PAGESIZE + wordIndex;
oldWordIndex = wordIndex;
recordType = *redoLogPagePos;
switch(recordType) {
case ZFD_TYPE:
fdRecord = (FileDescriptor *) &redoLogPage[i*PAGESIZE + pageIndex];
fdRecord = (FileDescriptor *) redoLogPagePos;
if (thePrintFlag) ndbout << (*fdRecord);
if (theCheckFlag) {
if(!fdRecord->check()) {
@ -155,13 +175,13 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
delete [] redoLogPage;
exit(RETURN_OK);
}
pageIndex += fdRecord->getLogRecordSize();
wordIndex += fdRecord->getLogRecordSize();
break;
case ZNEXT_LOG_RECORD_TYPE:
nlRecord = (NextLogRecord *) (&redoLogPage[i*PAGESIZE] + pageIndex);
pageIndex += nlRecord->getLogRecordSize(pageIndex);
if (pageIndex <= PAGESIZE) {
nlRecord = (NextLogRecord *) redoLogPagePos;
wordIndex += nlRecord->getLogRecordSize(wordIndex);
if (wordIndex <= PAGESIZE) {
if (thePrintFlag) ndbout << (*nlRecord);
if (theCheckFlag) {
if(!nlRecord->check()) {
@ -173,9 +193,9 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
break;
case ZCOMPLETED_GCI_TYPE:
cGCIrecord = (CompletedGCIRecord *) &redoLogPage[i*PAGESIZE + pageIndex];
pageIndex += cGCIrecord->getLogRecordSize();
if (pageIndex <= PAGESIZE) {
cGCIrecord = (CompletedGCIRecord *) redoLogPagePos;
wordIndex += cGCIrecord->getLogRecordSize();
if (wordIndex <= PAGESIZE) {
if (thePrintFlag) ndbout << (*cGCIrecord);
if (theCheckFlag) {
if(!cGCIrecord->check()) {
@ -187,9 +207,9 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
break;
case ZPREP_OP_TYPE:
poRecord = (PrepareOperationRecord *) &redoLogPage[i*PAGESIZE + pageIndex];
pageIndex += poRecord->getLogRecordSize();
if (pageIndex <= PAGESIZE) {
poRecord = (PrepareOperationRecord *) redoLogPagePos;
wordIndex += poRecord->getLogRecordSize();
if (wordIndex <= PAGESIZE) {
if (thePrintFlag) ndbout << (*poRecord);
if (theCheckFlag) {
if(!poRecord->check()) {
@ -198,15 +218,12 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
}
}
}
else {
oldPageIndex = pageIndex - poRecord->getLogRecordSize();
}
break;
case ZCOMMIT_TYPE:
ctRecord = (CommitTransactionRecord *) &redoLogPage[i*PAGESIZE + pageIndex];
pageIndex += ctRecord->getLogRecordSize();
if (pageIndex <= PAGESIZE) {
ctRecord = (CommitTransactionRecord *) redoLogPagePos;
wordIndex += ctRecord->getLogRecordSize();
if (wordIndex <= PAGESIZE) {
if (thePrintFlag) ndbout << (*ctRecord);
if (theCheckFlag) {
if(!ctRecord->check()) {
@ -215,15 +232,12 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
}
}
}
else {
oldPageIndex = pageIndex - ctRecord->getLogRecordSize();
}
break;
case ZINVALID_COMMIT_TYPE:
ictRecord = (InvalidCommitTransactionRecord *) &redoLogPage[i*PAGESIZE + pageIndex];
pageIndex += ictRecord->getLogRecordSize();
if (pageIndex <= PAGESIZE) {
ictRecord = (InvalidCommitTransactionRecord *) redoLogPagePos;
wordIndex += ictRecord->getLogRecordSize();
if (wordIndex <= PAGESIZE) {
if (thePrintFlag) ndbout << (*ictRecord);
if (theCheckFlag) {
if(!ictRecord->check()) {
@ -232,21 +246,18 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
}
}
}
else {
oldPageIndex = pageIndex - ictRecord->getLogRecordSize();
}
break;
case ZNEXT_MBYTE_TYPE:
nmRecord = (NextMbyteRecord *) &redoLogPage[i*PAGESIZE + pageIndex];
nmRecord = (NextMbyteRecord *) redoLogPagePos;
if (thePrintFlag) ndbout << (*nmRecord);
i = NO_PAGES_IN_MBYTE;
break;
case ZABORT_TYPE:
atRecord = (AbortTransactionRecord *) &redoLogPage[i*PAGESIZE + pageIndex];
pageIndex += atRecord->getLogRecordSize();
if (pageIndex <= PAGESIZE) {
atRecord = (AbortTransactionRecord *) redoLogPagePos;
wordIndex += atRecord->getLogRecordSize();
if (wordIndex <= PAGESIZE) {
if (thePrintFlag) ndbout << (*atRecord);
if (theCheckFlag) {
if(!atRecord->check()) {
@ -266,7 +277,7 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
ndbout << " ------ERROR: UNKNOWN RECORD TYPE------" << endl;
// Print out remaining data in this page
for (int j = pageIndex; j < PAGESIZE; j++){
for (int j = wordIndex; j < PAGESIZE; j++){
Uint32 unknown = redoLogPage[i*PAGESIZE + j];
ndbout_c("%-30d%-12u%-12x", j, unknown, unknown);
@ -274,14 +285,18 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
doExit();
}
} while(pageIndex < PAGESIZE && i < NO_PAGES_IN_MBYTE);
} while(wordIndex < lastWord && i < NO_PAGES_IN_MBYTE);
if (pageIndex > PAGESIZE) {
// The last record overlapped page boundary. Must redo that record.
pageIndex = readRecordOverPageBoundary(&redoLogPage[i*PAGESIZE],
pageIndex, oldPageIndex, recordType);
if (lastPage)
break;
if (wordIndex > PAGESIZE) {
words_from_previous_page = PAGESIZE - oldWordIndex;
ndbout << " ----------- Record continues on next page -----------" << endl;
} else {
pageIndex = 0;
wordIndex = 0;
words_from_previous_page = 0;
}
ndbout << endl;
}//for
@ -310,93 +325,6 @@ Uint32 readFromFile(FILE * f, Uint32 *toPtr, Uint32 sizeInWords) {
}
//----------------------------------------------------------------
//
//----------------------------------------------------------------
Uint32 readRecordOverPageBoundary(Uint32 *pagePtr, Uint32 pageIndex, Uint32 oldPageIndex, Uint32 recordType) {
Uint32 pageHeader[PAGEHEADERSIZE];
Uint32 tmpPages[PAGESIZE*10];
PageHeader *thePageHeader;
Uint32 recordSize = 0;
PrepareOperationRecord *poRecord;
CommitTransactionRecord *ctRecord;
InvalidCommitTransactionRecord *ictRecord;
memcpy(pageHeader, pagePtr + PAGESIZE, PAGEHEADERSIZE*sizeof(Uint32));
memcpy(tmpPages, pagePtr + oldPageIndex, (PAGESIZE - oldPageIndex)*sizeof(Uint32));
memcpy(tmpPages + PAGESIZE - oldPageIndex ,
(pagePtr + PAGESIZE + PAGEHEADERSIZE),
(PAGESIZE - PAGEHEADERSIZE)*sizeof(Uint32));
switch(recordType) {
case ZPREP_OP_TYPE:
poRecord = (PrepareOperationRecord *) tmpPages;
recordSize = poRecord->getLogRecordSize();
if (recordSize < (PAGESIZE - PAGEHEADERSIZE)) {
if (theCheckFlag) {
if(!poRecord->check()) {
ndbout << "Error in poRecord->check() (readRecordOverPageBoundary)" << endl;
doExit();
}
}
if (thePrintFlag) ndbout << (*poRecord);
} else {
ndbout << "Error: Record greater than a Page" << endl;
}
break;
case ZCOMMIT_TYPE:
ctRecord = (CommitTransactionRecord *) tmpPages;
recordSize = ctRecord->getLogRecordSize();
if (recordSize < (PAGESIZE - PAGEHEADERSIZE)) {
if (theCheckFlag) {
if(!ctRecord->check()) {
ndbout << "Error in ctRecord->check() (readRecordOverPageBoundary)" << endl;
doExit();
}
}
if (thePrintFlag) ndbout << (*ctRecord);
} else {
ndbout << endl << "Error: Record greater than a Page" << endl;
}
break;
case ZINVALID_COMMIT_TYPE:
ictRecord = (InvalidCommitTransactionRecord *) tmpPages;
recordSize = ictRecord->getLogRecordSize();
if (recordSize < (PAGESIZE - PAGEHEADERSIZE)) {
if (theCheckFlag) {
if(!ictRecord->check()) {
ndbout << "Error in ictRecord->check() (readRecordOverPageBoundary)" << endl;
doExit();
}
}
if (thePrintFlag) ndbout << (*ictRecord);
} else {
ndbout << endl << "Error: Record greater than a Page" << endl;
}
break;
case ZNEW_PREP_OP_TYPE:
case ZABORT_TYPE:
case ZFRAG_SPLIT_TYPE:
case ZNEXT_MBYTE_TYPE:
ndbout << endl << "Record type = " << recordType << " not implemented." << endl;
return 0;
default:
ndbout << endl << "Error: Unknown record type. Record type = " << recordType << endl;
return 0;
}
thePageHeader = (PageHeader *) (pagePtr + PAGESIZE);
if (thePrintFlag) ndbout << (*thePageHeader);
return PAGEHEADERSIZE - PAGESIZE + oldPageIndex + recordSize;
}
//----------------------------------------------------------------
//
//----------------------------------------------------------------

View File

@ -1108,20 +1108,15 @@ private:
void execTUP_SRREQ(Signal* signal);
void execTUP_PREPLCPREQ(Signal* signal);
void execFSOPENCONF(Signal* signal);
void execFSOPENREF(Signal* signal);
void execFSCLOSECONF(Signal* signal);
void execFSCLOSEREF(Signal* signal);
void execFSWRITECONF(Signal* signal);
void execFSWRITEREF(Signal* signal);
void execFSREADCONF(Signal* signal);
void execFSREADREF(Signal* signal);
void execNDB_STTOR(Signal* signal);
void execREAD_CONFIG_REQ(Signal* signal);
void execSET_VAR_REQ(Signal* signal);
void execDROP_TAB_REQ(Signal* signal);
void execALTER_TAB_REQ(Signal* signal);
void execFSREMOVECONF(Signal* signal);
void execFSREMOVEREF(Signal* signal);
void execTUP_ALLOCREQ(Signal* signal);
void execTUP_DEALLOCREQ(Signal* signal);
void execTUP_WRITELOG_REQ(Signal* signal);

View File

@ -25,7 +25,6 @@
#include <AttributeHeader.hpp>
#include <Interpreter.hpp>
#include <signaldata/FsConf.hpp>
#include <signaldata/FsRef.hpp>
#include <signaldata/FsRemoveReq.hpp>
#include <signaldata/TupCommit.hpp>
#include <signaldata/TupKey.hpp>
@ -117,13 +116,9 @@ Dbtup::Dbtup(const class Configuration & conf)
addRecSignal(GSN_TUP_SRREQ, &Dbtup::execTUP_SRREQ);
addRecSignal(GSN_TUP_PREPLCPREQ, &Dbtup::execTUP_PREPLCPREQ);
addRecSignal(GSN_FSOPENCONF, &Dbtup::execFSOPENCONF);
addRecSignal(GSN_FSOPENREF, &Dbtup::execFSOPENREF);
addRecSignal(GSN_FSCLOSECONF, &Dbtup::execFSCLOSECONF);
addRecSignal(GSN_FSCLOSEREF, &Dbtup::execFSCLOSEREF);
addRecSignal(GSN_FSWRITECONF, &Dbtup::execFSWRITECONF);
addRecSignal(GSN_FSWRITEREF, &Dbtup::execFSWRITEREF);
addRecSignal(GSN_FSREADCONF, &Dbtup::execFSREADCONF);
addRecSignal(GSN_FSREADREF, &Dbtup::execFSREADREF);
addRecSignal(GSN_NDB_STTOR, &Dbtup::execNDB_STTOR);
addRecSignal(GSN_READ_CONFIG_REQ, &Dbtup::execREAD_CONFIG_REQ, true);
addRecSignal(GSN_SET_VAR_REQ, &Dbtup::execSET_VAR_REQ);
@ -133,7 +128,6 @@ Dbtup::Dbtup(const class Configuration & conf)
addRecSignal(GSN_DROP_TRIG_REQ, &Dbtup::execDROP_TRIG_REQ);
addRecSignal(GSN_DROP_TAB_REQ, &Dbtup::execDROP_TAB_REQ);
addRecSignal(GSN_FSREMOVEREF, &Dbtup::execFSREMOVEREF);
addRecSignal(GSN_FSREMOVECONF, &Dbtup::execFSREMOVECONF);
addRecSignal(GSN_TUP_ALLOCREQ, &Dbtup::execTUP_ALLOCREQ);
@ -268,12 +262,6 @@ void Dbtup::execFSCLOSECONF(Signal* signal)
releasePendingFileOpenInfoRecord(pfoPtr);
}//Dbtup::execFSCLOSECONF()
void Dbtup::execFSCLOSEREF(Signal* signal)
{
ljamEntry();
ndbrequire(false);
}//Dbtup::execFSCLOSEREF()
void Dbtup::execFSOPENCONF(Signal* signal)
{
PendingFileOpenInfoPtr pfoPtr;
@ -368,12 +356,6 @@ void Dbtup::execFSOPENCONF(Signal* signal)
releasePendingFileOpenInfoRecord(pfoPtr);
}//Dbtup::execFSOPENCONF()
void Dbtup::execFSOPENREF(Signal* signal)
{
ljamEntry();
ndbrequire(false);
}//Dbtup::execFSOPENREF()
void Dbtup::execFSREADCONF(Signal* signal)
{
DiskBufferSegmentInfoPtr dbsiPtr;
@ -429,12 +411,6 @@ void Dbtup::execFSREADCONF(Signal* signal)
}//switch
}//Dbtup::execFSREADCONF()
void Dbtup::execFSREADREF(Signal* signal)
{
ljamEntry();
ndbrequire(false);
}//Dbtup::execFSREADREF()
void Dbtup::execFSWRITECONF(Signal* signal)
{
DiskBufferSegmentInfoPtr dbsiPtr;
@ -483,12 +459,6 @@ void Dbtup::execFSWRITECONF(Signal* signal)
return;
}//Dbtup::execFSWRITECONF()
void Dbtup::execFSWRITEREF(Signal* signal)
{
ljamEntry();
ndbrequire(false);
}//Dbtup::execFSWRITEREF()
void Dbtup::execCONTINUEB(Signal* signal)
{
ljamEntry();

View File

@ -702,10 +702,3 @@ void Dbtup::execFSREMOVECONF(Signal* signal)
initTab(tabPtr.p);
}//Dbtup::execFSREMOVECONF()
void Dbtup::execFSREMOVEREF(Signal* signal)
{
ljamEntry();
ndbrequire(false);
}//Dbtup::execFSREMOVEREF()

View File

@ -309,7 +309,6 @@ private:
Uint32 c_fsRemoveCount;
Uint32 c_nodeGroup;
void clearFilesystem(Signal* signal);
void execFSREMOVEREF(Signal* signal);
void execFSREMOVECONF(Signal* signal);
NdbNodeBitmask c_allDefinedNodes;

View File

@ -100,7 +100,6 @@ Ndbcntr::Ndbcntr(const class Configuration & conf):
addRecSignal(GSN_STTORRY, &Ndbcntr::execSTTORRY);
addRecSignal(GSN_READ_CONFIG_CONF, &Ndbcntr::execREAD_CONFIG_CONF);
addRecSignal(GSN_FSREMOVEREF, &Ndbcntr::execFSREMOVEREF);
addRecSignal(GSN_FSREMOVECONF, &Ndbcntr::execFSREMOVECONF);
initData();

View File

@ -144,6 +144,7 @@ void Ndbcntr::execSYSTEM_ERROR(Signal* signal)
const SystemError * const sysErr = (SystemError *)signal->getDataPtr();
char buf[100];
int killingNode = refToNode(sysErr->errorRef);
Uint32 data1 = sysErr->data1;
jamEntry();
switch (sysErr->errorCode){
@ -178,8 +179,9 @@ void Ndbcntr::execSYSTEM_ERROR(Signal* signal)
case SystemError::CopyFragRefError:
BaseString::snprintf(buf, sizeof(buf),
"Node %d killed this node because "
"it could not copy a fragment during node restart",
killingNode);
"it could not copy a fragment during node restart. "
"Copy fragment error code: %u.",
killingNode, data1);
break;
default:
@ -2391,12 +2393,6 @@ Ndbcntr::clearFilesystem(Signal* signal){
c_fsRemoveCount++;
}
void
Ndbcntr::execFSREMOVEREF(Signal* signal){
jamEntry();
ndbrequire(0);
}
void
Ndbcntr::execFSREMOVECONF(Signal* signal){
jamEntry();

View File

@ -29,6 +29,7 @@
#include <signaldata/EventReport.hpp>
#include <signaldata/ContinueFragmented.hpp>
#include <signaldata/NodeStateSignalData.hpp>
#include <signaldata/FsRef.hpp>
#include <DebuggerNames.hpp>
#include "LongSignal.hpp"
@ -140,6 +141,13 @@ SimulatedBlock::installSimulatedBlockFunctions(){
a[GSN_UTIL_UNLOCK_REF] = &SimulatedBlock::execUTIL_UNLOCK_REF;
a[GSN_UTIL_UNLOCK_CONF] = &SimulatedBlock::execUTIL_UNLOCK_CONF;
a[GSN_READ_CONFIG_REQ] = &SimulatedBlock::execREAD_CONFIG_REQ;
a[GSN_FSOPENREF] = &SimulatedBlock::execFSOPENREF;
a[GSN_FSCLOSEREF] = &SimulatedBlock::execFSCLOSEREF;
a[GSN_FSWRITEREF] = &SimulatedBlock::execFSWRITEREF;
a[GSN_FSREADREF] = &SimulatedBlock::execFSREADREF;
a[GSN_FSREMOVEREF] = &SimulatedBlock::execFSREMOVEREF;
a[GSN_FSSYNCREF] = &SimulatedBlock::execFSSYNCREF;
a[GSN_FSAPPENDREF] = &SimulatedBlock::execFSAPPENDREF;
}
void
@ -1781,6 +1789,61 @@ SimulatedBlock::execUPGRADE(Signal* signal){
}
}
void
SimulatedBlock::fsRefError(Signal* signal, Uint32 line, const char *msg)
{
const FsRef *fsRef = (FsRef*)signal->getDataPtr();
Uint32 errorCode = fsRef->errorCode;
Uint32 osErrorCode = fsRef->osErrorCode;
char msg2[100];
sprintf(msg2, "%s: %s. OS errno: %u", getBlockName(number()), msg, osErrorCode);
progError(line, errorCode, msg2);
}
void
SimulatedBlock::execFSWRITEREF(Signal* signal)
{
fsRefError(signal, __LINE__, "File system write failed");
}
void
SimulatedBlock::execFSREADREF(Signal* signal)
{
fsRefError(signal, __LINE__, "File system read failed");
}
void
SimulatedBlock::execFSCLOSEREF(Signal* signal)
{
fsRefError(signal, __LINE__, "File system close failed");
}
void
SimulatedBlock::execFSOPENREF(Signal* signal)
{
fsRefError(signal, __LINE__, "File system open failed");
}
void
SimulatedBlock::execFSREMOVEREF(Signal* signal)
{
fsRefError(signal, __LINE__, "File system remove failed");
}
void
SimulatedBlock::execFSSYNCREF(Signal* signal)
{
fsRefError(signal, __LINE__, "File system sync failed");
}
void
SimulatedBlock::execFSAPPENDREF(Signal* signal)
{
fsRefError(signal, __LINE__, "File system append failed");
}
#ifdef VM_TRACE
void
SimulatedBlock::clear_global_variables(){

View File

@ -507,6 +507,15 @@ private:
protected:
void execUPGRADE(Signal* signal);
void fsRefError(Signal* signal, Uint32 line, const char *msg);
void execFSWRITEREF(Signal* signal);
void execFSREADREF(Signal* signal);
void execFSOPENREF(Signal* signal);
void execFSCLOSEREF(Signal* signal);
void execFSREMOVEREF(Signal* signal);
void execFSSYNCREF(Signal* signal);
void execFSAPPENDREF(Signal* signal);
// Variable for storing inserted errors, see pc.H
ERROR_INSERT_VARIABLE;

View File

@ -1922,47 +1922,54 @@ CommandInterpreter::executeEventReporting(int processId,
return;
}
BaseString tmp(parameters);
Vector<BaseString> spec;
tmp.split(spec, "=");
if(spec.size() != 2){
ndbout << "Invalid loglevel specification: " << parameters << endl;
return;
}
Vector<BaseString> specs;
tmp.split(specs, " ");
spec[0].trim().ndb_toupper();
int category = ndb_mgm_match_event_category(spec[0].c_str());
if(category == NDB_MGM_ILLEGAL_EVENT_CATEGORY){
if(!convert(spec[0].c_str(), category) ||
category < NDB_MGM_MIN_EVENT_CATEGORY ||
category > NDB_MGM_MAX_EVENT_CATEGORY){
ndbout << "Unknown category: \"" << spec[0].c_str() << "\"" << endl;
return;
for (int i=0; i < specs.size(); i++)
{
Vector<BaseString> spec;
specs[i].split(spec, "=");
if(spec.size() != 2){
ndbout << "Invalid loglevel specification: " << specs[i] << endl;
continue;
}
spec[0].trim().ndb_toupper();
int category = ndb_mgm_match_event_category(spec[0].c_str());
if(category == NDB_MGM_ILLEGAL_EVENT_CATEGORY){
if(!convert(spec[0].c_str(), category) ||
category < NDB_MGM_MIN_EVENT_CATEGORY ||
category > NDB_MGM_MAX_EVENT_CATEGORY){
ndbout << "Unknown category: \"" << spec[0].c_str() << "\"" << endl;
continue;
}
}
int level;
if (!convert(spec[1].c_str(),level))
{
ndbout << "Invalid level: " << spec[1].c_str() << endl;
continue;
}
ndbout << "Executing CLUSTERLOG " << spec[0] << "=" << spec[1]
<< " on node " << processId << flush;
struct ndb_mgm_reply reply;
int result;
result = ndb_mgm_set_loglevel_clusterlog(m_mgmsrv,
processId,
(ndb_mgm_event_category)category,
level,
&reply);
if (result != 0) {
ndbout_c(" failed.");
printError();
} else {
ndbout_c(" OK!");
}
}
int level;
if (!convert(spec[1].c_str(),level))
{
ndbout << "Invalid level: " << spec[1].c_str() << endl;
return;
}
ndbout << "Executing CLUSTERLOG on node " << processId << flush;
struct ndb_mgm_reply reply;
int result;
result = ndb_mgm_set_loglevel_clusterlog(m_mgmsrv,
processId,
(ndb_mgm_event_category)category,
level,
&reply);
if (result != 0) {
ndbout_c(" failed.");
printError();
} else {
ndbout_c(" OK!");
}
}
/*****************************************************************************

View File

@ -2148,7 +2148,17 @@ const int ConfigInfo::m_NoOfParams = sizeof(m_ParamInfo) / sizeof(ParamInfo);
/****************************************************************************
* Ctor
****************************************************************************/
static void require(bool v) { if(!v) abort();}
static void require(bool v)
{
if(!v)
{
#ifndef DBUG_OFF
abort();
#else
exit(-1);
#endif
}
}
ConfigInfo::ConfigInfo()
: m_info(true), m_systemDefaults(true)
@ -2289,7 +2299,7 @@ ConfigInfo::ConfigInfo()
****************************************************************************/
inline void warning(const char * src, const char * arg){
ndbout << "Illegal call to ConfigInfo::" << src << "() - " << arg << endl;
abort();
require(false);
}
const Properties *
@ -3429,7 +3439,7 @@ fixDepricated(InitConfigFileParser::Context & ctx, const char * data){
}
case PropertiesType_Properties:
default:
abort();
::require(false);
}
}
return true;
@ -3441,7 +3451,7 @@ static bool
saveInConfigValues(InitConfigFileParser::Context & ctx, const char * data){
const Properties * sec;
if(!ctx.m_currentInfo->get(ctx.fname, &sec)){
abort();
require(false);
return false;
}
@ -3512,7 +3522,7 @@ saveInConfigValues(InitConfigFileParser::Context & ctx, const char * data){
break;
}
default:
abort();
require(false);
}
require(ok);
}

View File

@ -57,9 +57,6 @@ typedef struct ErrorBundle {
#define OE ndberror_cl_schema_object_already_exists
static const char REDO_BUFFER_MSG[]=
"REDO log buffers overloaded, consult online manual (increase RedoBuffer, and|or decrease TimeBetweenLocalCheckpoints, and|or increase NoOfFragmentLogFiles)";
static const char* empty_string = "";
/*
@ -168,8 +165,9 @@ ErrorBundle ErrorCodes[] = {
{ 830, TR, "Out of add fragment operation records" },
{ 873, TR, "Out of attrinfo records for scan in tuple manager" },
{ 1217, TR, "Out of operation records in local data manager (increase MaxNoOfLocalOperations)" },
{ 1220, TR, REDO_BUFFER_MSG },
{ 1220, TR, "REDO log files overloaded, consult online manual (decrease TimeBetweenLocalCheckpoints, and|or increase NoOfFragmentLogFiles)" },
{ 1222, TR, "Out of transaction markers in LQH" },
{ 1224, TR, "Out of Send Buffer space in LQH" },
{ 4021, TR, "Out of Send Buffer space in NDB API" },
{ 4022, TR, "Out of Send Buffer space in NDB API" },
{ 4032, TR, "Out of Send Buffer space in NDB API" },
@ -200,10 +198,10 @@ ErrorBundle ErrorCodes[] = {
/**
* OverloadError
*/
{ 410, OL, REDO_BUFFER_MSG },
{ 410, OL, "REDO log files overloaded, consult online manual (decrease TimeBetweenLocalCheckpoints, and|or increase NoOfFragmentLogFiles)" },
{ 677, OL, "Index UNDO buffers overloaded (increase UndoIndexBuffer)" },
{ 891, OL, "Data UNDO buffers overloaded (increase UndoDataBuffer)" },
{ 1221, OL, REDO_BUFFER_MSG },
{ 1221, OL, "REDO buffers overloaded, consult online manual (increase RedoBuffer)" },
{ 4006, OL, "Connect failure - out of connection objects (increase MaxNoOfConcurrentTransactions)" },

View File

@ -2407,6 +2407,7 @@ ha_innobase::open(
my_free((char*) upd_buff, MYF(0));
my_errno = ENOENT;
dict_table_decrement_handle_count(ib_table);
DBUG_RETURN(HA_ERR_NO_SUCH_TABLE);
}
@ -6682,7 +6683,7 @@ ha_innobase::store_lock(
if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK) {
/* Starting from 5.0.7, we weaken also the table locks
/* Starting from 5.0.7, we weaken also the table locks
set at the start of a MySQL stored procedure call, just like
we weaken the locks set at the start of an SQL statement.
MySQL does set thd->in_lock_tables TRUE there, but in reality
@ -6690,6 +6691,21 @@ ha_innobase::store_lock(
single transaction stored procedure call deterministic
(if it does not use a consistent read). */
if (lock_type == TL_READ && thd->in_lock_tables) {
/* We come here if MySQL is processing LOCK TABLES
... READ LOCAL. MyISAM under that table lock type
reads the table as it was at the time the lock was
granted (new inserts are allowed, but not seen by the
reader). To get a similar effect on an InnoDB table,
we must use LOCK TABLES ... READ. We convert the lock
type here, so that for InnoDB, READ LOCAL is
equivalent to READ. This will change the InnoDB
behavior in mysqldump, so that dumps of InnoDB tables
are consistent with dumps of MyISAM tables. */
lock_type = TL_READ_NO_INSERT;
}
/* If we are not doing a LOCK TABLE or DISCARD/IMPORT
TABLESPACE or TRUNCATE TABLE, then allow multiple writers */

View File

@ -461,11 +461,11 @@ String *Item_func_des_decrypt::val_str(String *str)
struct st_des_keyblock keyblock;
struct st_des_keyschedule keyschedule;
String *res= args[0]->val_str(str);
uint length= 0, tail;
uint length,tail;
if ((null_value=args[0]->null_value))
if ((null_value= args[0]->null_value))
return 0;
length=res->length();
length= res->length();
if (length < 9 || (length % 8) != 1 || !((*res)[0] & 128))
return res; // Skip decryption if not encrypted

View File

@ -2983,7 +2983,7 @@ Item_func_group_concat::fix_fields(THD *thd, Item **ref)
}
thd->allow_sum_func= 0;
maybe_null= 0;
maybe_null= 1;
/*
Fix fields for select list and ORDER clause
@ -2995,8 +2995,6 @@ Item_func_group_concat::fix_fields(THD *thd, Item **ref)
args[i]->fix_fields(thd, args + i)) ||
args[i]->check_cols(1))
return TRUE;
if (i < arg_count_field)
maybe_null|= args[i]->maybe_null;
}
if (agg_item_charsets(collation, func_name(),

View File

@ -3241,7 +3241,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
Field **f_ptr,*field;
for (f_ptr=table->field ; (field= *f_ptr) ; f_ptr++)
{
/* Check if field should be droped */
/* Check if field should be dropped */
Alter_drop *drop;
drop_it.rewind();
while ((drop=drop_it++))

View File

@ -9483,7 +9483,7 @@ static void test_create_drop()
rc= mysql_stmt_execute(stmt_drop);
check_execute(stmt_drop, rc);
if (!opt_silent)
fprintf(stdout, "droped %i\n", i);
fprintf(stdout, "dropped %i\n", i);
rc= mysql_stmt_execute(stmt_create_select);
check_execute(stmt_create, rc);
@ -9498,7 +9498,7 @@ static void test_create_drop()
rc= mysql_stmt_execute(stmt_drop);
check_execute(stmt_drop, rc);
if (!opt_silent)
fprintf(stdout, "droped %i\n", i);
fprintf(stdout, "dropped %i\n", i);
}
mysql_stmt_close(stmt_create);