Commit e227d502 authored by Olivier Bertrand's avatar Olivier Bertrand

- Change CRLF line endings to LF

modified:
  storage/connect/tabtbl.cpp
  storage/connect/tabtbl.h
parent 9df57eba
...@@ -77,15 +77,15 @@ ...@@ -77,15 +77,15 @@
#include "ha_connect.h" #include "ha_connect.h"
#include "mycat.h" // For GetHandler #include "mycat.h" // For GetHandler
#if defined(WIN32) #if defined(WIN32)
#if defined(__BORLANDC__) #if defined(__BORLANDC__)
#define SYSEXIT void _USERENTRY #define SYSEXIT void _USERENTRY
#else #else
#define SYSEXIT void #define SYSEXIT void
#endif #endif
#else // !WIN32 #else // !WIN32
#define SYSEXIT void * #define SYSEXIT void *
#endif // !WIN32 #endif // !WIN32
extern "C" int trace; extern "C" int trace;
...@@ -515,40 +515,40 @@ void TBTBLK::ReadColumn(PGLOBAL g) ...@@ -515,40 +515,40 @@ void TBTBLK::ReadColumn(PGLOBAL g)
/* ------------------------- Class TDBTBM ---------------------------- */ /* ------------------------- Class TDBTBM ---------------------------- */
/***********************************************************************/ /***********************************************************************/
/* Thread routine that check and open one remote connection. */ /* Thread routine that check and open one remote connection. */
/***********************************************************************/ /***********************************************************************/
pthread_handler_t ThreadOpen(void *p) pthread_handler_t ThreadOpen(void *p)
{ {
PTBMT cmp = (PTBMT)p; PTBMT cmp = (PTBMT)p;
if (!my_thread_init()) { if (!my_thread_init()) {
set_current_thd(cmp->Thd); set_current_thd(cmp->Thd);
// Try to open the connection // Try to open the connection
if (!cmp->Tap->GetTo_Tdb()->OpenDB(cmp->G)) { if (!cmp->Tap->GetTo_Tdb()->OpenDB(cmp->G)) {
cmp->Ready = true; cmp->Ready = true;
} else } else
cmp->Rc = RC_FX; cmp->Rc = RC_FX;
my_thread_end(); my_thread_end();
} else } else
cmp->Rc = RC_FX; cmp->Rc = RC_FX;
return NULL; return NULL;
} // end of ThreadOpen } // end of ThreadOpen
/***********************************************************************/ /***********************************************************************/
/* TDBTBM constructors. */ /* TDBTBM constructors. */
/***********************************************************************/ /***********************************************************************/
TDBTBM::TDBTBM(PTBLDEF tdp) : TDBTBL(tdp) TDBTBM::TDBTBM(PTBLDEF tdp) : TDBTBL(tdp)
{ {
Tmp = NULL; // To data table TBMT structures Tmp = NULL; // To data table TBMT structures
Cmp = NULL; // Current data table TBMT Cmp = NULL; // Current data table TBMT
Bmp = NULL; // To bad (unconnected) TBMT structures Bmp = NULL; // To bad (unconnected) TBMT structures
Done = false; // TRUE after first GetAllResults Done = false; // TRUE after first GetAllResults
Nrc = 0; // Number of remote connections Nrc = 0; // Number of remote connections
Nlc = 0; // Number of local connections Nlc = 0; // Number of local connections
} // end of TDBTBL standard constructor } // end of TDBTBL standard constructor
/***********************************************************************/ /***********************************************************************/
...@@ -580,8 +580,8 @@ int TDBTBM::RowNumber(PGLOBAL g, bool b) ...@@ -580,8 +580,8 @@ int TDBTBM::RowNumber(PGLOBAL g, bool b)
/***********************************************************************/ /***********************************************************************/
bool TDBTBM::OpenTables(PGLOBAL g) bool TDBTBM::OpenTables(PGLOBAL g)
{ {
int k; int k;
THD *thd = current_thd; THD *thd = current_thd;
PTABLE tabp, *ptabp = &Tablist; PTABLE tabp, *ptabp = &Tablist;
PTBMT tp, *ptp = &Tmp; PTBMT tp, *ptp = &Tmp;
...@@ -598,16 +598,16 @@ bool TDBTBM::OpenTables(PGLOBAL g) ...@@ -598,16 +598,16 @@ bool TDBTBM::OpenTables(PGLOBAL g)
tp->Tap = tabp; tp->Tap = tabp;
tp->Thd = thd; 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_init(&tp->attr);
// pthread_attr_setdetachstate(&tp->attr, PTHREAD_CREATE_JOINABLE); // pthread_attr_setdetachstate(&tp->attr, PTHREAD_CREATE_JOINABLE);
if ((k = pthread_create(&tp->Tid, &tp->attr, ThreadOpen, tp))) { if ((k = pthread_create(&tp->Tid, &tp->attr, ThreadOpen, tp))) {
sprintf(g->Message, "pthread_create error %d", k); sprintf(g->Message, "pthread_create error %d", k);
Nbc++; Nbc++;
continue; continue;
} // endif k } // endif k
// Add it to the remote list // Add it to the remote list
*ptp = tp; *ptp = tp;
ptp = &tp->Next; ptp = &tp->Next;
......
...@@ -14,26 +14,26 @@ typedef class TDBTBL *PTDBTBL; ...@@ -14,26 +14,26 @@ typedef class TDBTBL *PTDBTBL;
typedef class TDBTBM *PTDBTBM; typedef class TDBTBM *PTDBTBM;
typedef class MYSQLC *PMYC; typedef class MYSQLC *PMYC;
/***********************************************************************/ /***********************************************************************/
/* Defines the structures used for distributed TBM tables. */ /* Defines the structures used for distributed TBM tables. */
/***********************************************************************/ /***********************************************************************/
typedef struct _TBMtable *PTBMT; typedef struct _TBMtable *PTBMT;
typedef struct _TBMtable { typedef struct _TBMtable {
PTBMT Next; // Points to next data table struct PTBMT Next; // Points to next data table struct
PTABLE Tap; // Points to the sub table PTABLE Tap; // Points to the sub table
PGLOBAL G; // Needed in thread routine PGLOBAL G; // Needed in thread routine
bool Complete; // TRUE when all results are read bool Complete; // TRUE when all results are read
bool Ready; // TRUE when results are there bool Ready; // TRUE when results are there
int Rows; // Total number of rows read so far int Rows; // Total number of rows read so far
int ProgCur; // Current pos int ProgCur; // Current pos
int ProgMax; // Max pos int ProgMax; // Max pos
int Rc; // Return code int Rc; // Return code
THD *Thd; THD *Thd;
pthread_attr_t attr; // ??? pthread_attr_t attr; // ???
pthread_t Tid; // CheckOpen thread ID pthread_t Tid; // CheckOpen thread ID
} TBMT; } TBMT;
/***********************************************************************/ /***********************************************************************/
/* TBL table. */ /* TBL table. */
/***********************************************************************/ /***********************************************************************/
...@@ -156,10 +156,10 @@ class DllExport TDBTBM : public TDBTBL { ...@@ -156,10 +156,10 @@ class DllExport TDBTBM : public TDBTBL {
int ReadNextRemote(PGLOBAL g); int ReadNextRemote(PGLOBAL g);
// Members // Members
PTBMT Tmp; // To data table TBMT structures PTBMT Tmp; // To data table TBMT structures
PTBMT Cmp; // Current data table PLGF (to move to TDBTBL) PTBMT Cmp; // Current data table PLGF (to move to TDBTBL)
PTBMT Bmp; // To bad (unconnected) PLGF structures PTBMT Bmp; // To bad (unconnected) PLGF structures
bool Done; // TRUE after first GetAllResults bool Done; // TRUE after first GetAllResults
int Nrc; // Number of remote connections int Nrc; // Number of remote connections
int Nlc; // Number of local connections int Nlc; // Number of local connections
}; // end of class TDBTBM }; // end of class TDBTBM
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