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 @@
#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;
......
......@@ -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
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