Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
e227d502
Commit
e227d502
authored
Jun 05, 2013
by
Olivier Bertrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Change CRLF line endings to LF
modified: storage/connect/tabtbl.cpp storage/connect/tabtbl.h
parent
9df57eba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
70 deletions
+70
-70
storage/connect/tabtbl.cpp
storage/connect/tabtbl.cpp
+45
-45
storage/connect/tabtbl.h
storage/connect/tabtbl.h
+25
-25
No files found.
storage/connect/tabtbl.cpp
View file @
e227d502
...
...
@@ -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
;
...
...
storage/connect/tabtbl.h
View file @
e227d502
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment