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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
64cebff7
Commit
64cebff7
authored
Feb 10, 2005
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into mysql.com:/home/jonas/src/mysql-5.0-ndb
parents
361532fb
eaec8e82
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
19 deletions
+25
-19
ndb/src/common/transporter/Transporter.cpp
ndb/src/common/transporter/Transporter.cpp
+5
-8
ndb/src/ndbapi/Ndb.cpp
ndb/src/ndbapi/Ndb.cpp
+20
-11
No files found.
ndb/src/common/transporter/Transporter.cpp
View file @
64cebff7
...
...
@@ -116,18 +116,18 @@ Transporter::connect_client() {
if
(
m_connected
)
return
true
;
DBUG_ENTER
(
"Transporter::connect_client"
);
DBUG_PRINT
(
"info"
,(
"port %d isMgmConnection=%d"
,
m_r_port
,
isMgmConnection
));
if
(
isMgmConnection
)
sockfd
=
m_socket_client
->
connect_without_auth
();
else
sockfd
=
m_socket_client
->
connect
();
if
(
sockfd
<
0
)
if
(
sockfd
==
NDB_INVALID_SOCKET
)
return
false
;
DBUG_ENTER
(
"Transporter::connect_client"
);
DBUG_PRINT
(
"info"
,(
"port %d isMgmConnection=%d"
,
m_r_port
,
isMgmConnection
));
SocketOutputStream
s_output
(
sockfd
);
SocketInputStream
s_input
(
sockfd
);
...
...
@@ -141,9 +141,6 @@ Transporter::connect_client() {
s_output
.
println
(
""
);
}
if
(
sockfd
==
NDB_INVALID_SOCKET
)
return
false
;
// send info about own id
// send info about own transporter type
...
...
ndb/src/ndbapi/Ndb.cpp
View file @
64cebff7
...
...
@@ -49,13 +49,15 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode)
Uint32
tAnyAlive
=
0
;
int
TretCode
=
0
;
DBUG_ENTER
(
"Ndb::doConnect"
);
if
(
tConNode
!=
0
)
{
TretCode
=
NDB_connect
(
tConNode
);
if
((
TretCode
==
1
)
||
(
TretCode
==
2
))
{
//****************************************************************************
// We have connections now to the desired node. Return
//****************************************************************************
return
getConnectedNdbTransaction
(
tConNode
);
DBUG_RETURN
(
getConnectedNdbTransaction
(
tConNode
)
);
}
else
if
(
TretCode
!=
0
)
{
tAnyAlive
=
1
;
}
//if
...
...
@@ -78,10 +80,11 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode)
//****************************************************************************
// We have connections now to the desired node. Return
//****************************************************************************
return
getConnectedNdbTransaction
(
tNode
);
DBUG_RETURN
(
getConnectedNdbTransaction
(
tNode
)
);
}
else
if
(
TretCode
!=
0
)
{
tAnyAlive
=
1
;
}
//if
DBUG_PRINT
(
"info"
,(
"tried node %d TretCode %d"
,
tNode
,
TretCode
));
}
}
else
// just do a regular round robin
...
...
@@ -103,10 +106,11 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode)
//****************************************************************************
// We have connections now to the desired node. Return
//****************************************************************************
return
getConnectedNdbTransaction
(
tNode
);
DBUG_RETURN
(
getConnectedNdbTransaction
(
tNode
)
);
}
else
if
(
TretCode
!=
0
)
{
tAnyAlive
=
1
;
}
//if
DBUG_PRINT
(
"info"
,(
"tried node %d TretCode %d"
,
tNode
,
TretCode
));
}
while
(
Tcount
<
tNoOfDbNodes
);
}
//****************************************************************************
...
...
@@ -121,7 +125,7 @@ NdbTransaction* Ndb::doConnect(Uint32 tConNode)
}
else
{
theError
.
code
=
4009
;
}
//if
return
NULL
;
DBUG_RETURN
(
NULL
)
;
}
int
...
...
@@ -134,29 +138,31 @@ Ndb::NDB_connect(Uint32 tNode)
int
tReturnCode
;
TransporterFacade
*
tp
=
TransporterFacade
::
instance
();
DBUG_ENTER
(
"Ndb::NDB_connect"
);
bool
nodeAvail
=
tp
->
get_node_alive
(
tNode
);
if
(
nodeAvail
==
false
){
return
0
;
DBUG_RETURN
(
0
)
;
}
NdbTransaction
*
tConArray
=
theConnectionArray
[
tNode
];
if
(
tConArray
!=
NULL
)
{
return
2
;
DBUG_RETURN
(
2
)
;
}
NdbTransaction
*
tNdbCon
=
getNdbCon
();
// Get free connection object.
if
(
tNdbCon
==
NULL
)
{
return
4
;
DBUG_RETURN
(
4
)
;
}
//if
NdbApiSignal
*
tSignal
=
getSignal
();
// Get signal object
if
(
tSignal
==
NULL
)
{
releaseNdbCon
(
tNdbCon
);
return
4
;
DBUG_RETURN
(
4
)
;
}
//if
if
(
tSignal
->
setSignal
(
GSN_TCSEIZEREQ
)
==
-
1
)
{
releaseNdbCon
(
tNdbCon
);
releaseSignal
(
tSignal
);
return
4
;
DBUG_RETURN
(
4
)
;
}
//if
tSignal
->
setData
(
tNdbCon
->
ptr2int
(),
1
);
//************************************************
...
...
@@ -192,13 +198,16 @@ Ndb::NDB_connect(Uint32 tNode)
tNdbCon
->
setMyBlockReference
(
theMyRef
);
theConnectionArray
[
tNode
]
=
tNdbCon
;
tNdbCon
->
theNext
=
tPrevFirst
;
return
1
;
DBUG_RETURN
(
1
)
;
}
else
{
releaseNdbCon
(
tNdbCon
);
//****************************************************************************
// Unsuccessful connect is indicated by 3.
//****************************************************************************
return
3
;
DBUG_PRINT
(
"info"
,
(
"unsuccessful connect tReturnCode %d, tNdbCon->Status() %d"
,
tReturnCode
,
tNdbCon
->
Status
()));
DBUG_RETURN
(
3
);
}
//if
}
//Ndb::NDB_connect()
...
...
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