From 7b6909e972e14950fdeec889fed832d4a08e9f1a Mon Sep 17 00:00:00 2001 From: Olivier Bertrand <bertrandop@gmail.com> Date: Wed, 5 Jun 2013 00:46:06 +0200 Subject: [PATCH] - Change CRLF line endings to LF modified: storage/connect/tabtbl.cpp storage/connect/tabtbl.h --- storage/connect/tabtbl.cpp | 90 +++++++++++++++++++------------------- storage/connect/tabtbl.h | 50 ++++++++++----------- 2 files changed, 70 insertions(+), 70 deletions(-) diff --git a/storage/connect/tabtbl.cpp b/storage/connect/tabtbl.cpp index 61f9c8628d9..89acc53fd4a 100644 --- a/storage/connect/tabtbl.cpp +++ b/storage/connect/tabtbl.cpp @@ -77,15 +77,15 @@ #include "ha_connect.h" #include "mycat.h" // For GetHandler -#if defined(WIN32) -#if defined(__BORLANDC__) -#define SYSEXIT void _USERENTRY -#else -#define SYSEXIT void -#endif -#else // !WIN32 -#define SYSEXIT void * -#endif // !WIN32 +#if defined(WIN32) +#if defined(__BORLANDC__) +#define SYSEXIT void _USERENTRY +#else +#define SYSEXIT void +#endif +#else // !WIN32 +#define SYSEXIT void * +#endif // !WIN32 extern "C" int trace; @@ -515,40 +515,40 @@ void TBTBLK::ReadColumn(PGLOBAL g) /* ------------------------- Class TDBTBM ---------------------------- */ -/***********************************************************************/ -/* Thread routine that check and open one remote connection. */ -/***********************************************************************/ -pthread_handler_t ThreadOpen(void *p) - { - PTBMT cmp = (PTBMT)p; - - if (!my_thread_init()) { +/***********************************************************************/ +/* Thread routine that check and open one remote connection. */ +/***********************************************************************/ +pthread_handler_t ThreadOpen(void *p) + { + PTBMT cmp = (PTBMT)p; + + if (!my_thread_init()) { set_current_thd(cmp->Thd); - // Try to open the connection - if (!cmp->Tap->GetTo_Tdb()->OpenDB(cmp->G)) { - cmp->Ready = true; - } else - cmp->Rc = RC_FX; - - my_thread_end(); - } else - cmp->Rc = RC_FX; - - return NULL; - } // end of ThreadOpen - + // Try to open the connection + if (!cmp->Tap->GetTo_Tdb()->OpenDB(cmp->G)) { + cmp->Ready = true; + } else + cmp->Rc = RC_FX; + + my_thread_end(); + } else + cmp->Rc = RC_FX; + + return NULL; + } // end of ThreadOpen + /***********************************************************************/ /* TDBTBM constructors. */ /***********************************************************************/ TDBTBM::TDBTBM(PTBLDEF tdp) : TDBTBL(tdp) { - Tmp = NULL; // To data table TBMT structures - Cmp = NULL; // Current data table TBMT - Bmp = NULL; // To bad (unconnected) TBMT structures - Done = false; // TRUE after first GetAllResults - Nrc = 0; // Number of remote connections - Nlc = 0; // Number of local connections + Tmp = NULL; // To data table TBMT structures + Cmp = NULL; // Current data table TBMT + Bmp = NULL; // To bad (unconnected) TBMT structures + Done = false; // TRUE after first GetAllResults + Nrc = 0; // Number of remote connections + Nlc = 0; // Number of local connections } // end of TDBTBL standard constructor /***********************************************************************/ @@ -580,8 +580,8 @@ int TDBTBM::RowNumber(PGLOBAL g, bool b) /***********************************************************************/ bool TDBTBM::OpenTables(PGLOBAL g) { - int k; - THD *thd = current_thd; + int k; + THD *thd = current_thd; PTABLE tabp, *ptabp = &Tablist; PTBMT tp, *ptp = &Tmp; @@ -598,16 +598,16 @@ bool TDBTBM::OpenTables(PGLOBAL g) tp->Tap = tabp; tp->Thd = thd; - // Create the thread that will do the table opening. + // Create the thread that will do the table opening. pthread_attr_init(&tp->attr); // pthread_attr_setdetachstate(&tp->attr, PTHREAD_CREATE_JOINABLE); - if ((k = pthread_create(&tp->Tid, &tp->attr, ThreadOpen, tp))) { - sprintf(g->Message, "pthread_create error %d", k); - Nbc++; - continue; - } // endif k - + if ((k = pthread_create(&tp->Tid, &tp->attr, ThreadOpen, tp))) { + sprintf(g->Message, "pthread_create error %d", k); + Nbc++; + continue; + } // endif k + // Add it to the remote list *ptp = tp; ptp = &tp->Next; diff --git a/storage/connect/tabtbl.h b/storage/connect/tabtbl.h index cdd84a1dd29..7cc2ff0b92c 100644 --- a/storage/connect/tabtbl.h +++ b/storage/connect/tabtbl.h @@ -14,26 +14,26 @@ typedef class TDBTBL *PTDBTBL; typedef class TDBTBM *PTDBTBM; typedef class MYSQLC *PMYC; -/***********************************************************************/ -/* Defines the structures used for distributed TBM tables. */ -/***********************************************************************/ -typedef struct _TBMtable *PTBMT; - -typedef struct _TBMtable { - PTBMT Next; // Points to next data table struct - PTABLE Tap; // Points to the sub table - PGLOBAL G; // Needed in thread routine - bool Complete; // TRUE when all results are read - bool Ready; // TRUE when results are there - int Rows; // Total number of rows read so far - int ProgCur; // Current pos - int ProgMax; // Max pos - int Rc; // Return code - THD *Thd; +/***********************************************************************/ +/* Defines the structures used for distributed TBM tables. */ +/***********************************************************************/ +typedef struct _TBMtable *PTBMT; + +typedef struct _TBMtable { + PTBMT Next; // Points to next data table struct + PTABLE Tap; // Points to the sub table + PGLOBAL G; // Needed in thread routine + bool Complete; // TRUE when all results are read + bool Ready; // TRUE when results are there + int Rows; // Total number of rows read so far + int ProgCur; // Current pos + int ProgMax; // Max pos + int Rc; // Return code + THD *Thd; pthread_attr_t attr; // ??? - pthread_t Tid; // CheckOpen thread ID - } TBMT; - + pthread_t Tid; // CheckOpen thread ID + } TBMT; + /***********************************************************************/ /* TBL table. */ /***********************************************************************/ @@ -156,10 +156,10 @@ class DllExport TDBTBM : public TDBTBL { int ReadNextRemote(PGLOBAL g); // Members - PTBMT Tmp; // To data table TBMT structures - PTBMT Cmp; // Current data table PLGF (to move to TDBTBL) - PTBMT Bmp; // To bad (unconnected) PLGF structures - bool Done; // TRUE after first GetAllResults - int Nrc; // Number of remote connections - int Nlc; // Number of local connections + PTBMT Tmp; // To data table TBMT structures + PTBMT Cmp; // Current data table PLGF (to move to TDBTBL) + PTBMT Bmp; // To bad (unconnected) PLGF structures + bool Done; // TRUE after first GetAllResults + int Nrc; // Number of remote connections + int Nlc; // Number of local connections }; // end of class TDBTBM -- 2.30.9