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
0ccaf940
Commit
0ccaf940
authored
Jan 04, 2003
by
Sinisa@sinisa.nasamreza.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing that 3.23 API / clients do not disconnect if a large
packet is issued.
parent
c6e42dfa
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
696 deletions
+35
-696
libmysql/libmysql.c
libmysql/libmysql.c
+15
-6
libmysql/net.c
libmysql/net.c
+0
-685
sql/net_serv.cc
sql/net_serv.cc
+19
-3
sql/sql_select.cc
sql/sql_select.cc
+1
-2
No files found.
libmysql/libmysql.c
View file @
0ccaf940
...
@@ -456,14 +456,23 @@ simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
...
@@ -456,14 +456,23 @@ simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
length
?
length
:
(
ulong
)
strlen
(
arg
)))
length
?
length
:
(
ulong
)
strlen
(
arg
)))
{
{
DBUG_PRINT
(
"error"
,(
"Can't send command to server. Error: %d"
,
socket_errno
));
DBUG_PRINT
(
"error"
,(
"Can't send command to server. Error: %d"
,
socket_errno
));
end_server
(
mysql
);
if
(
net
->
last_errno
==
ER_NET_PACKET_TOO_LARGE
)
if
(
mysql_reconnect
(
mysql
)
||
net_write_command
(
net
,(
uchar
)
command
,
arg
,
length
?
length
:
(
ulong
)
strlen
(
arg
)))
{
{
net
->
last_errno
=
CR_
SERVER_GONE_ERROR
;
net
->
last_errno
=
CR_
NET_PACKET_TOO_LARGE
;
strmov
(
net
->
last_error
,
ER
(
net
->
last_errno
));
strmov
(
net
->
last_error
,
ER
(
net
->
last_errno
));
goto
end
;
return
(
packet_error
);
}
else
{
end_server
(
mysql
);
if
(
mysql_reconnect
(
mysql
)
||
net_write_command
(
net
,(
uchar
)
command
,
arg
,
length
?
length
:
(
ulong
)
strlen
(
arg
)))
{
net
->
last_errno
=
CR_SERVER_GONE_ERROR
;
strmov
(
net
->
last_error
,
ER
(
net
->
last_errno
));
goto
end
;
}
}
}
}
}
result
=
0
;
result
=
0
;
...
...
libmysql/net.c
deleted
100644 → 0
View file @
c6e42dfa
This diff is collapsed.
Click to expand it.
sql/net_serv.cc
View file @
0ccaf940
...
@@ -34,13 +34,18 @@
...
@@ -34,13 +34,18 @@
#include <signal.h>
#include <signal.h>
#include <errno.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/types.h>
#ifdef MYSQL_SERVER
#include <violite.h>
#endif
#define MAX_PACKET_LENGTH (256L*256L*256L-1)
#ifdef MYSQL_SERVER
#ifdef MYSQL_SERVER
ulong
max_allowed_packet
=
65536
;
ulong
max_allowed_packet
=
65536
;
extern
ulong
net_read_timeout
,
net_write_timeout
;
extern
ulong
net_read_timeout
,
net_write_timeout
;
extern
uint
test_flags
;
extern
uint
test_flags
;
#else
#else
ulong
max_allowed_packet
=
16
*
1024
*
1024L
-
1
;
ulong
max_allowed_packet
=
MAX_PACKET_LENGTH
;
ulong
net_read_timeout
=
NET_READ_TIMEOUT
;
ulong
net_read_timeout
=
NET_READ_TIMEOUT
;
ulong
net_write_timeout
=
NET_WRITE_TIMEOUT
;
ulong
net_write_timeout
=
NET_WRITE_TIMEOUT
;
#endif
#endif
...
@@ -226,6 +231,12 @@ int
...
@@ -226,6 +231,12 @@ int
my_net_write
(
NET
*
net
,
const
char
*
packet
,
ulong
len
)
my_net_write
(
NET
*
net
,
const
char
*
packet
,
ulong
len
)
{
{
uchar
buff
[
NET_HEADER_SIZE
];
uchar
buff
[
NET_HEADER_SIZE
];
if
(
len
>=
MAX_PACKET_LENGTH
)
{
net
->
error
=
1
;
net
->
last_errno
=
ER_NET_PACKET_TOO_LARGE
;
return
1
;
}
int3store
(
buff
,
len
);
int3store
(
buff
,
len
);
buff
[
3
]
=
(
net
->
compress
)
?
0
:
(
uchar
)
(
net
->
pkt_nr
++
);
buff
[
3
]
=
(
net
->
compress
)
?
0
:
(
uchar
)
(
net
->
pkt_nr
++
);
if
(
net_write_buff
(
net
,(
char
*
)
buff
,
NET_HEADER_SIZE
))
if
(
net_write_buff
(
net
,(
char
*
)
buff
,
NET_HEADER_SIZE
))
...
@@ -238,7 +249,12 @@ net_write_command(NET *net,uchar command,const char *packet,ulong len)
...
@@ -238,7 +249,12 @@ net_write_command(NET *net,uchar command,const char *packet,ulong len)
{
{
uchar
buff
[
NET_HEADER_SIZE
+
1
];
uchar
buff
[
NET_HEADER_SIZE
+
1
];
uint
length
=
len
+
1
;
/* 1 extra byte for command */
uint
length
=
len
+
1
;
/* 1 extra byte for command */
if
(
length
>=
MAX_PACKET_LENGTH
)
{
net
->
error
=
1
;
net
->
last_errno
=
ER_NET_PACKET_TOO_LARGE
;
return
1
;
}
int3store
(
buff
,
length
);
int3store
(
buff
,
length
);
buff
[
3
]
=
(
net
->
compress
)
?
0
:
(
uchar
)
(
net
->
pkt_nr
++
);
buff
[
3
]
=
(
net
->
compress
)
?
0
:
(
uchar
)
(
net
->
pkt_nr
++
);
buff
[
4
]
=
command
;
buff
[
4
]
=
command
;
...
@@ -276,7 +292,7 @@ net_real_write(NET *net,const char *packet,ulong len)
...
@@ -276,7 +292,7 @@ net_real_write(NET *net,const char *packet,ulong len)
int
length
;
int
length
;
char
*
pos
,
*
end
;
char
*
pos
,
*
end
;
thr_alarm_t
alarmed
;
thr_alarm_t
alarmed
;
#if !defined(__WIN__)
#if !defined(__WIN__)
&& !defined(__EMX__) && !defined(OS2)
ALARM
alarm_buff
;
ALARM
alarm_buff
;
#endif
#endif
uint
retry_count
=
0
;
uint
retry_count
=
0
;
...
...
sql/sql_select.cc
View file @
0ccaf940
...
@@ -2328,8 +2328,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
...
@@ -2328,8 +2328,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
if
((
tab
->
keys
&
~
tab
->
const_keys
&&
i
>
0
)
||
if
((
tab
->
keys
&
~
tab
->
const_keys
&&
i
>
0
)
||
tab
->
const_keys
&&
i
==
join
->
const_tables
&&
tab
->
const_keys
&&
i
==
join
->
const_tables
&&
join
->
thd
->
select_limit
<
join
->
best_positions
[
i
].
records_read
&&
join
->
thd
->
select_limit
<
join
->
best_positions
[
i
].
records_read
)
join
->
tables
>
1
)
{
{
/* Join with outer join condition */
/* Join with outer join condition */
COND
*
orig_cond
=
sel
->
cond
;
COND
*
orig_cond
=
sel
->
cond
;
...
...
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