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
59af6941
Commit
59af6941
authored
Feb 28, 2006
by
msvensson@shellback.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge shellback.(none):/home/msvensson/mysql/mysql-5.0
into shellback.(none):/home/msvensson/mysql/mysql-5.1
parents
a79c6b60
318bee86
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
6 deletions
+30
-6
sql/field.h
sql/field.h
+5
-2
sql/net_serv.cc
sql/net_serv.cc
+25
-4
No files found.
sql/field.h
View file @
59af6941
...
...
@@ -173,8 +173,9 @@ public:
virtual
int
cmp
(
const
char
*
,
const
char
*
)
=
0
;
virtual
int
cmp_binary
(
const
char
*
a
,
const
char
*
b
,
uint32
max_length
=~
0L
)
{
return
memcmp
(
a
,
b
,
pack_length
());
}
int
cmp_offset
(
uint
row_offset
)
{
return
cmp
(
ptr
,
ptr
+
row_offset
);
}
int
cmp_binary_offset
(
uint
row_offset
)
virtual
int
cmp_offset
(
uint
row_offset
)
{
return
cmp
(
ptr
,
ptr
+
row_offset
);
}
virtual
int
cmp_binary_offset
(
uint
row_offset
)
{
return
cmp_binary
(
ptr
,
ptr
+
row_offset
);
};
virtual
int
key_cmp
(
const
byte
*
a
,
const
byte
*
b
)
{
return
cmp
((
char
*
)
a
,(
char
*
)
b
);
}
...
...
@@ -1347,6 +1348,8 @@ public:
{
return
cmp_binary
((
char
*
)
a
,
(
char
*
)
b
);
}
int
key_cmp
(
const
byte
*
str
,
uint
length
);
int
cmp_offset
(
uint
row_offset
);
int
cmp_binary_offset
(
uint
row_offset
)
{
return
cmp_offset
(
row_offset
);
}
void
get_key_image
(
char
*
buff
,
uint
length
,
imagetype
type
);
void
set_key_image
(
char
*
buff
,
uint
length
)
{
Field_bit
::
store
(
buff
,
length
,
&
my_charset_bin
);
}
...
...
sql/net_serv.cc
View file @
59af6941
...
...
@@ -208,23 +208,40 @@ my_bool net_realloc(NET *net, ulong length)
RETURN VALUES
0 No data to read
1 Data or EOF to read
-1 Don't know if data is ready or not
*/
static
my_bool
net_data_is_ready
(
my_socket
sd
)
static
int
net_data_is_ready
(
my_socket
sd
)
{
#ifdef HAVE_POLL
struct
pollfd
ufds
;
int
res
;
ufds
.
fd
=
sd
;
ufds
.
events
=
POLLIN
|
POLLPRI
;
if
(
!
(
res
=
poll
(
&
ufds
,
1
,
0
)))
return
0
;
if
(
res
<
0
||
!
(
ufds
.
revents
&
(
POLLIN
|
POLLPRI
)))
return
0
;
return
1
;
#else
fd_set
sfds
;
struct
timeval
tv
;
int
res
;
if
(
sd
>=
FD_SETSIZE
)
return
-
1
;
FD_ZERO
(
&
sfds
);
FD_SET
(
sd
,
&
sfds
);
tv
.
tv_sec
=
tv
.
tv_usec
=
0
;
if
((
res
=
select
(
sd
+
1
,
&
sfds
,
NULL
,
NULL
,
&
tv
))
<
0
)
return
FALSE
;
return
0
;
else
return
test
(
res
?
FD_ISSET
(
sd
,
&
sfds
)
:
0
);
#endif
}
...
...
@@ -251,10 +268,10 @@ static my_bool net_data_is_ready(my_socket sd)
void
net_clear
(
NET
*
net
)
{
int
count
;
int
count
,
ready
;
DBUG_ENTER
(
"net_clear"
);
#if !defined(EMBEDDED_LIBRARY)
while
(
net_data_is_ready
(
net
->
vio
->
sd
)
)
while
(
(
ready
=
net_data_is_ready
(
net
->
vio
->
sd
))
!=
0
)
{
/* The socket is ready */
if
((
count
=
vio_read
(
net
->
vio
,
(
char
*
)
(
net
->
buff
),
...
...
@@ -269,6 +286,10 @@ void net_clear(NET *net)
}
else
{
/* No data to read and 'net_data_is_ready' returned "don't know" */
if
(
ready
==
-
1
)
break
;
DBUG_PRINT
(
"info"
,(
"socket ready but only EOF to read - disconnected"
));
net
->
error
=
2
;
break
;
...
...
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