Commit a5e9e473 authored by tomas@mc05.(none)'s avatar tomas@mc05.(none)

Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1-ndb

into mc05.(none):/space2/tomas/mysql-4.1
parents 565aa085 e2fd02e4
......@@ -19,13 +19,7 @@
#include <ndb_global.h>
#ifdef NDB_MACOSX
typedef unsigned int Size_t;
#elif defined(NDB_SPARC_64)
typedef unsigned int Size_t;
#else
typedef size_t Size_t;
#endif
typedef int Boolean_t;
......
......@@ -17,6 +17,8 @@
#ifndef NDB_MUTEX_H
#define NDB_MUTEX_H
#include <ndb_global.h>
#ifdef NDB_WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
......@@ -34,7 +36,7 @@ typedef SEMAPHORE NdbMutex;
#elif defined NDB_WIN32
typedef CRITICAL_SECTION NdbMutex;
#else
#include <pthread.h>
#include <my_pthread.h>
typedef pthread_mutex_t NdbMutex;
#define NDB_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
#endif
......
......@@ -19,10 +19,10 @@
**
** Main editing routines for editline library.
*/
#include <ndb_global.h>
#include "editline_internal.h"
#include <signal.h>
#include <ctype.h>
#include <unistd.h>
/*
** Manifest constants.
......
......@@ -16,7 +16,6 @@
#include <ndb_global.h>
#include <ndb_version.h>
#include <sys/stat.h>
#include <ConfigRetriever.hpp>
......
......@@ -18,7 +18,6 @@
#include <ndb_global.h>
#include <sys/mman.h>
#include <NdbOut.hpp>
#include <NdbThread.h>
......
......@@ -61,7 +61,6 @@ NdbCondition_Wait(struct NdbCondition* p_cond,
return result;
}
#include <time.h>
int
NdbCondition_WaitTimeout(struct NdbCondition* p_cond,
NdbMutex* p_mutex,
......
......@@ -19,15 +19,13 @@
#define NdbDaemon_ErrorSize 500
#if defined(NDB_LINUX) || defined(NDB_SOLARIS)
/* XXX fix other unixes */
long NdbDaemon_DaemonPid;
int NdbDaemon_ErrorCode;
char NdbDaemon_ErrorText[NdbDaemon_ErrorSize];
#endif
int
NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags)
{
/* XXX fix other unixes */
#if defined(NDB_LINUX) || defined(NDB_SOLARIS)
int lockfd = -1, logfd = -1, n;
char buf[64];
......@@ -129,10 +127,19 @@ NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags)
dup2(logfd, 2);
close(logfd);
}
#endif
/* Success */
return 0;
}
#else
int
NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags)
{
/* Fail */
snprintf(NdbDaemon_ErrorText, NdbDaemon_ErrorSize,
"Daemon mode not implemented");
return -1;
}
#endif
#ifdef NDB_DAEMON_TEST
......
......@@ -15,8 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_global.h>
#include "NdbHost.h"
#include <unistd.h>
int NdbHost_GetHostName(char* buf)
{
......
......@@ -14,13 +14,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <File.hpp>
#include <sys/stat.h>
#include <ndb_global.h>
#if defined NDB_OSE || defined NDB_SOFTOSE
#include <unistd.h>
#endif
#include <File.hpp>
#include <NdbOut.hpp>
......
......@@ -34,8 +34,6 @@
#include <ndb_global.h>
#include <time.h>
#include <ctype.h>
#include "getarg.h"
#define ISFLAG(X) ((X).type == arg_flag || (X).type == arg_negative_flag)
......
......@@ -32,7 +32,6 @@
*/
#include <ndb_global.h>
#include <ndb_types.h>
/* RCSID("$KTH: strlcat.c,v 1.1 2000/08/16 01:23:47 lha Exp $"); */
......
......@@ -32,16 +32,11 @@
*/
#include <ndb_global.h>
#include <ndb_types.h>
/* RCSID("$KTH: strlcpy.c,v 1.1 2000/08/16 01:23:48 lha Exp $"); */
#ifndef HAVE_STRLCPY
#ifdef NDB_WIN32
#include <string.h>
#endif
size_t
strlcpy (char *dst, const char *src, size_t dst_sz)
{
......
......@@ -25,10 +25,7 @@
#include "CPCD.hpp"
#include <pwd.h>
#include <sys/stat.h>
#include <sys/resource.h>
#include <sys/types.h>
#include <sys/wait.h>
void
CPCD::Process::print(FILE * f){
......
......@@ -14,11 +14,11 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_global.h>
#include "common.hpp"
#include <logger/Logger.hpp>
#include <pwd.h>
#include <sys/types.h>
#include <unistd.h>
#include <Properties.hpp>
#include <BaseString.hpp>
......
......@@ -14,9 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <sys/types.h> /* Needed for mkdir(2) */
#include <sys/stat.h> /* Needed for mkdir(2) */
#include <errno.h>
#include <ndb_global.h> /* Needed for mkdir(2) */
#include <signal.h>
#include "CPCD.hpp"
......
......@@ -16,7 +16,6 @@
#include <ndb_global.h>
#include <sys/stat.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
......
......@@ -16,7 +16,6 @@
#include <ndb_global.h>
#include <sys/stat.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
......
......@@ -16,10 +16,8 @@
//#define TESTDEBUG 1
#include <sys/stat.h>
#include <fcntl.h>
#include <ndb_global.h>
#include <string.h>
#include <kernel_types.h>
#include <Pool.hpp>
#include "AsyncFile.hpp"
......
......@@ -16,8 +16,8 @@
#include <ndb_global.h>
#include "TimeModule.hpp"
#include <time.h>
static const char* cMonth[] = { "x", "January", "February", "Mars", "April", "May", "June",
"July", "August", "September", "October", "November", "December"};
......
......@@ -42,9 +42,6 @@
#endif
extern EventLogger g_eventLogger;
#if defined (NDB_LINUX) || defined (NDB_SOLARIS)
#include <sys/wait.h>
#endif
void catchsigs(bool ignore); // for process signal handling
extern "C" void handler(int signo); // for process signal handling
......
......@@ -14,10 +14,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_global.h>
#include <my_pthread.h>
#include "MgmtSrvr.hpp"
#include "MgmtErrorReporter.hpp"
#include <ctype.h>
#include <NdbOut.hpp>
#include <AttrType.hpp>
#include <NdbApiSignal.hpp>
......@@ -42,15 +44,11 @@
#include <EventLogger.hpp>
#include <DebuggerNames.hpp>
#include <ndb_version.h>
#include <string.h>
#include "SocketServer.hpp"
#include "NodeLogLevel.hpp"
#include <NdbConfig.h>
#include <time.h>
#include <pthread.h>
//#define MGM_SRV_DEBUG
#ifdef MGM_SRV_DEBUG
#define DEBUG(x) do ndbout << x << endl; while(0)
......
......@@ -14,8 +14,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_global.h>
#include <signal.h>
#include <sys/ioctl.h>
#include "MgmtSrvr.hpp"
#include "EventLogger.hpp"
......@@ -198,7 +199,6 @@ NDB_MAIN(mgmsrv){
goto error_end;
}
#if defined (NDB_LINUX) || defined (NDB_SOLARIS)
if (glob.daemon) {
// Become a daemon
char homePath[255],lockfile[255], logfile[255];
......@@ -210,7 +210,6 @@ NDB_MAIN(mgmsrv){
return 1;
}
}
#endif
if(!glob.mgmObject->start()){
ndbout_c("Unable to start management server.");
......
......@@ -292,7 +292,7 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
if(useLongKeys){
longKeyAttrName = (char **) malloc(sizeof(char*) * tNoOfLongPK);
for (int i = 0; i < tNoOfLongPK; i++) {
for (Uint32 i = 0; i < tNoOfLongPK; i++) {
longKeyAttrName[i] = (char *) malloc(strlen("KEYATTR ") + 1);
memset(longKeyAttrName[i], 0, strlen("KEYATTR ") + 1);
sprintf(longKeyAttrName[i], "KEYATTR%i", i);
......@@ -531,7 +531,7 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
waitForThreads(pThreadsData);
void * tmp;
for(int i = 0; i<tNoOfThreads; i++){
for(Uint32 i = 0; i<tNoOfThreads; i++){
NdbThread_WaitFor(pThreadsData[i].threadLife, &tmp);
NdbThread_Destroy(&pThreadsData[i].threadLife);
}
......@@ -540,7 +540,7 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
if (useLongKeys == true) {
// Only free these areas if they have been allocated
// Otherwise cores will happen
for (int i = 0; i < tNoOfLongPK; i++)
for (Uint32 i = 0; i < tNoOfLongPK; i++)
free(longKeyAttrName[i]);
free(longKeyAttrName);
} // if
......@@ -629,13 +629,13 @@ static void* flexBenchThread(void* pArg)
if(useLongKeys){
// Allocate and populate the longkey array.
longKeyAttrValue = (unsigned ***) malloc(sizeof(unsigned**) * tNoOfOperations );
for (int n = 0; n < tNoOfOperations; n++)
for (Uint32 n = 0; n < tNoOfOperations; n++)
longKeyAttrValue[n] = (unsigned **) malloc(sizeof(unsigned*) * tNoOfLongPK );
for (int n = 0; n < tNoOfOperations; n++){
for (int i = 0; i < tNoOfLongPK ; i++) {
for (Uint32 n = 0; n < tNoOfOperations; n++){
for (Uint32 i = 0; i < tNoOfLongPK ; i++) {
longKeyAttrValue[n][i] = (unsigned *) malloc(sizeof(unsigned) * tSizeOfLongPK);
memset(longKeyAttrValue[n][i], 0, sizeof(unsigned) * tSizeOfLongPK);
for(int j = 0; j < tSizeOfLongPK; j++) {
for(Uint32 j = 0; j < tSizeOfLongPK; j++) {
// Repeat the unique value to fill up the long key.
longKeyAttrValue[n][i][j] = threadBase + n;
}
......@@ -645,10 +645,10 @@ static void* flexBenchThread(void* pArg)
int nRefOpOffset = 0 ;
//Assign reference attribute values to memory
for(int ops = 1 ; ops < tNoOfOperations ; ops++){
for(Uint32 ops = 1 ; ops < tNoOfOperations ; ops++){
// Calculate offset value before going into the next loop
nRefOpOffset = tAttributeSize*tNoOfAttributes*(ops-1) ;
for(int a = 0 ; a < tNoOfAttributes ; a++){
for(Uint32 a = 0 ; a < tNoOfAttributes ; a++){
*(int*)&attrRefValue[nRefOpOffset + tAttributeSize*a] =
(int)(threadBase + ops + a) ;
}
......@@ -757,7 +757,7 @@ static void* flexBenchThread(void* pArg)
if(useLongKeys){
// Loop the equal call so the complete key is send to the kernel.
for(int i = 0; i < tNoOfLongPK; i++)
for(Uint32 i = 0; i < tNoOfLongPK; i++)
pOps[countTables]->equal(longKeyAttrName[i],
(char *)longKeyAttrValue[count - 1][i], tSizeOfLongPK*4);
}
......@@ -923,8 +923,8 @@ static void* flexBenchThread(void* pArg)
if (useLongKeys == true) {
// Only free these areas if they have been allocated
// Otherwise cores will occur
for (int n = 0; n < tNoOfOperations; n++){
for (int i = 0; i < tNoOfLongPK; i++) {
for (Uint32 n = 0; n < tNoOfOperations; n++){
for (Uint32 i = 0; i < tNoOfLongPK; i++) {
free(longKeyAttrValue[n][i]);
}
free(longKeyAttrValue[n]);
......@@ -1064,13 +1064,13 @@ static void sleepBeforeStartingTest(int seconds){
static int
createTables(Ndb* pMyNdb){
for (int i = 0; i < tNoOfAttributes; i++){
for (Uint32 i = 0; i < tNoOfAttributes; i++){
snprintf(attrName[i], MAXSTRLEN, "COL%d", i);
}
// Note! Uses only uppercase letters in table name's
// so that we can look at the tables with SQL
for (int i = 0; i < tNoOfTables; i++){
for (Uint32 i = 0; i < tNoOfTables; i++){
if (theStdTableNameFlag == 0){
snprintf(tableName[i], MAXSTRLEN, "TAB%d_%d", i,
(int)(NdbTick_CurrentMillisecond() / 1000));
......@@ -1087,7 +1087,7 @@ createTables(Ndb* pMyNdb){
tmpTable.setStoredTable(!theTempTable);
if(useLongKeys){
for(int i = 0; i < tNoOfLongPK; i++) {
for(Uint32 i = 0; i < tNoOfLongPK; i++) {
NdbDictionary::Column col(longKeyAttrName[i]);
col.setType(NdbDictionary::Column::Unsigned);
col.setLength(tSizeOfLongPK);
......
......@@ -157,7 +157,7 @@ HugoCalculator::verifyRowValues(NDBT_ResultRow* const pRow) const{
<< ", NdbDict::Column::getLength(): " << attr->getLength()
<< endl;
const char* buf2 = pRow->attributeStore(i)->aRef();
for (int j = 0; j < pRow->attributeStore(i)->arraySize(); j++)
for (Uint32 j = 0; j < pRow->attributeStore(i)->arraySize(); j++)
{
g_err << j << ":" << buf[j] << "[" << buf2[j] << "]";
if (buf[j] != buf2[j])
......
......@@ -652,7 +652,7 @@ void HugoOperations::deallocRows(){
int HugoOperations::saveCopyOfRecord(int numRecords ){
if (numRecords > rows.size())
if (numRecords > (int)rows.size())
return NDBT_FAILED;
for (int i = 0; i < numRecords; i++){
......@@ -662,7 +662,7 @@ int HugoOperations::saveCopyOfRecord(int numRecords ){
}
BaseString HugoOperations::getRecordStr(int recordNum){
if (recordNum > rows.size())
if (recordNum > (int)rows.size())
return NULL;
return rows[recordNum]->c_str();
}
......@@ -673,7 +673,7 @@ int HugoOperations::getRecordGci(int recordNum){
int HugoOperations::compareRecordToCopy(int numRecords ){
if (numRecords > rows.size())
if (numRecords > (int)rows.size())
return NDBT_FAILED;
if ((unsigned)numRecords > savedRecords.size())
return NDBT_FAILED;
......
......@@ -1253,9 +1253,11 @@ HugoTransactions::eventOperation(Ndb* pNdb, void* pstats,
g_info << " UPDATE: ";
recEvent = recUpdateEvent;
break;
case NdbDictionary::Event::TE_ALL:
abort();
}
if (pk < records) {
if ((int)pk < records) {
recEvent[pk].pk = pk;
recEvent[pk].count++;
}
......@@ -1304,7 +1306,7 @@ HugoTransactions::eventOperation(Ndb* pNdb, void* pstats,
if (stats.n_updates > 0) {
stats.n_consecutive++;
}
for (Uint32 i = 0; i < records/3; i++) {
for (Uint32 i = 0; i < (Uint32)records/3; i++) {
if (recInsertEvent[i].pk != i) {
stats.n_consecutive ++;
ndbout << "missing insert pk " << i << endl;
......
......@@ -66,6 +66,7 @@ NDBT_ResultRow::attributeStore(const char* name){
return data[i];
}
assert(false);
return 0;
}
NdbOut &
......@@ -189,7 +190,8 @@ NDBT_ResultRow::clone () const {
NDBT_ResultRow * row = new NDBT_ResultRow(m_table, ad[0]);
row->m_ownData = true;
for(Uint32 i = 0; i<m_table.getNoOfColumns(); i++){
Uint32 noOfColumns = m_table.getNoOfColumns();
for(Uint32 i = 0; i < noOfColumns; i++){
row->data[i] = data[i]->clone();
}
......
......@@ -66,7 +66,6 @@ NdbBackup::getFileSystemPathForNode(int _node_id){
/**
* Fetch configuration from management server
*/
char buf[255];
ConfigRetriever cr;
......
......@@ -31,7 +31,6 @@ NdbConfig::getPropsForNode(unsigned int node_id,
/**
* Fetch configuration from management server
*/
char buf[255];
ConfigRetriever cr;
......@@ -111,7 +110,6 @@ NdbConfig::getHostName(unsigned int node_id,
/**
* Fetch configuration from management server
*/
char buf[255];
ConfigRetriever cr;
......
......@@ -167,7 +167,7 @@ NdbRestarter::getRandomNotMasterNodeId(int rand){
if(master == -1)
return -1;
int counter = 0;
Uint32 counter = 0;
rand = rand % ndbNodes.size();
while(counter++ < ndbNodes.size() && ndbNodes[rand].node_id == master)
rand = (rand + 1) % ndbNodes.size();
......@@ -196,7 +196,7 @@ NdbRestarter::getRandomNodeOtherNodeGroup(int nodeId, int rand){
return -1;
}
int counter = 0;
Uint32 counter = 0;
rand = rand % ndbNodes.size();
while(counter++ < ndbNodes.size() && ndbNodes[rand].node_group == node_group)
rand = (rand + 1) % ndbNodes.size();
......
......@@ -116,7 +116,7 @@ public:
}
virtual bool evaluate(SimpleCpcClient* c,const SimpleCpcClient::Process & p){
return p.m_id == id && c == host;
return p.m_id == (int)id && c == host;
}
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment