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
ebf4de96
Commit
ebf4de96
authored
Nov 06, 2006
by
jonas@perch.ndb.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge perch.ndb.mysql.com:/home/jonas/src/50-work
into perch.ndb.mysql.com:/home/jonas/src/51-work
parents
79d8773e
c8d07748
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
32 deletions
+72
-32
storage/ndb/src/common/util/socket_io.cpp
storage/ndb/src/common/util/socket_io.cpp
+50
-32
storage/ndb/src/ndbapi/NdbTransaction.cpp
storage/ndb/src/ndbapi/NdbTransaction.cpp
+22
-0
No files found.
storage/ndb/src/common/util/socket_io.cpp
View file @
ebf4de96
...
...
@@ -53,10 +53,6 @@ readln_socket(NDB_SOCKET_TYPE socket, int timeout_millis,
if
(
buflen
<=
1
)
return
0
;
int
sock_flags
=
fcntl
(
socket
,
F_GETFL
);
if
(
fcntl
(
socket
,
F_SETFL
,
sock_flags
|
O_NONBLOCK
)
==
-
1
)
return
-
1
;
fd_set
readset
;
FD_ZERO
(
&
readset
);
FD_SET
(
socket
,
&
readset
);
...
...
@@ -76,43 +72,65 @@ readln_socket(NDB_SOCKET_TYPE socket, int timeout_millis,
}
if
(
selectRes
==
-
1
){
fcntl
(
socket
,
F_SETFL
,
sock_flags
);
return
-
1
;
}
const
int
t
=
recv
(
socket
,
buf
,
buflen
,
MSG_PEEK
);
char
*
ptr
=
buf
;
int
len
=
buflen
;
do
{
int
t
;
while
((
t
=
recv
(
socket
,
ptr
,
len
,
MSG_PEEK
))
==
-
1
&&
errno
==
EINTR
);
if
(
t
<
1
)
{
fcntl
(
socket
,
F_SETFL
,
sock_flags
);
return
-
1
;
}
for
(
int
i
=
0
;
i
<
t
;
i
++
)
for
(
int
i
=
0
;
i
<
t
;
i
++
)
{
if
(
ptr
[
i
]
==
'\n'
)
{
/**
* Now consume
*/
for
(
len
=
1
+
i
;
len
;
)
{
if
(
buf
[
i
]
==
'\n'
){
int
r
=
recv
(
socket
,
buf
,
i
+
1
,
0
);
buf
[
i
+
1
]
=
0
;
if
(
r
<
1
)
{
fcntl
(
socket
,
F_SETFL
,
sock_flags
);
while
((
t
=
recv
(
socket
,
ptr
,
len
,
0
))
==
-
1
&&
errno
==
EINTR
);
if
(
t
<
1
)
return
-
1
;
ptr
+=
t
;
len
-=
t
;
}
ptr
[
0
]
=
0
;
return
ptr
-
buf
;
}
if
(
i
>
0
&&
buf
[
i
-
1
]
==
'\r'
){
buf
[
i
-
1
]
=
'\n'
;
buf
[
i
]
=
'\0'
;
}
fcntl
(
socket
,
F_SETFL
,
sock_flags
);
return
r
;
for
(
int
tmp
=
t
;
tmp
;
)
{
while
((
t
=
recv
(
socket
,
ptr
,
tmp
,
0
))
==
-
1
&&
errno
==
EINTR
);
if
(
t
<
1
)
{
return
-
1
;
}
ptr
+=
t
;
len
-=
t
;
tmp
-=
t
;
}
int
r
=
recv
(
socket
,
buf
,
t
,
0
);
if
(
r
>=
0
)
buf
[
r
]
=
0
;
fcntl
(
socket
,
F_SETFL
,
sock_flags
);
return
r
;
FD_ZERO
(
&
readset
);
FD_SET
(
socket
,
&
readset
);
timeout
.
tv_sec
=
(
timeout_millis
/
1000
);
timeout
.
tv_usec
=
(
timeout_millis
%
1000
)
*
1000
;
const
int
selectRes
=
select
(
socket
+
1
,
&
readset
,
0
,
0
,
&
timeout
);
if
(
selectRes
!=
1
){
return
-
1
;
}
}
while
(
len
>
0
);
return
-
1
;
}
extern
"C"
...
...
storage/ndb/src/ndbapi/NdbTransaction.cpp
View file @
ebf4de96
...
...
@@ -366,8 +366,30 @@ NdbTransaction::execute(ExecType aTypeOfExec,
* operations, making postExecute impossible
*/
if
(
abortOption
==
AO_IgnoreError
)
{
if
(
theCompletedFirstOp
!=
NULL
)
{
if
(
tCompletedFirstOp
!=
NULL
)
{
tCompletedLastOp
->
next
(
theCompletedFirstOp
);
theCompletedFirstOp
=
tCompletedFirstOp
;
}
}
else
{
theCompletedFirstOp
=
tCompletedFirstOp
;
theCompletedLastOp
=
tCompletedLastOp
;
}
if
(
tPrepOp
!=
NULL
&&
tRestOp
!=
NULL
)
{
if
(
theFirstOpInList
==
NULL
)
theFirstOpInList
=
tRestOp
;
else
theLastOpInList
->
next
(
tRestOp
);
theLastOpInList
=
tLastOp
;
}
DBUG_RETURN
(
-
1
);
}
}
#ifdef ndb_api_crash_on_complex_blob_abort
assert
(
theFirstOpInList
==
NULL
&&
theLastOpInList
==
NULL
);
...
...
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