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
e9ad5085
Commit
e9ad5085
authored
Jan 20, 2005
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed problem of sending ERROR to client after OK or EOF (BUG#6804)
parent
a13efc7d
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
59 additions
and
3 deletions
+59
-3
include/mysql_com.h
include/mysql_com.h
+5
-0
mysql-test/r/kill.result
mysql-test/r/kill.result
+12
-0
mysql-test/t/kill.test
mysql-test/t/kill.test
+18
-0
sql/item_func.cc
sql/item_func.cc
+1
-1
sql/net_serv.cc
sql/net_serv.cc
+1
-2
sql/protocol.cc
sql/protocol.cc
+18
-0
sql/sql_parse.cc
sql/sql_parse.cc
+4
-0
No files found.
include/mysql_com.h
View file @
e9ad5085
...
...
@@ -187,6 +187,11 @@ typedef struct st_net {
char
save_char
;
my_bool
no_send_ok
;
/* For SPs and other things that do multiple stmts */
my_bool
no_send_eof
;
/* For SPs' first version read-only cursors */
/*
Set if OK packet is already sent, and we do not need to send error
messages
*/
my_bool
no_send_error
;
/*
Pointer to query object in query cache, do not equal NULL (0) for
queries in cache that have not stored its results yet
...
...
mysql-test/r/kill.result
View file @
e9ad5085
...
...
@@ -9,3 +9,15 @@ select 4;
4
4
drop table t1;
select get_lock("a", 10);
get_lock("a", 10)
1
select get_lock("a", 10);
get_lock("a", 10)
NULL
select 1;
1
1
select RELEASE_LOCK("a");
RELEASE_LOCK("a")
1
mysql-test/t/kill.test
View file @
e9ad5085
...
...
@@ -35,3 +35,21 @@ select @id != connection_id();
connection
con2
;
select
4
;
drop
table
t1
;
#
# test of blocking of sending ERROR after OK or EOF
#
connection
con1
;
select
get_lock
(
"a"
,
10
);
connection
con2
;
let
$ID
=
`select connection_id()`
;
send
select
get_lock
(
"a"
,
10
);
connection
con1
;
disable_query_log
;
eval
kill
query
$ID
;
enable_query_log
;
connection
con2
;
reap
;
select
1
;
connection
con1
;
select
RELEASE_LOCK
(
"a"
);
sql/item_func.cc
View file @
e9ad5085
...
...
@@ -3578,7 +3578,7 @@ Item_func_sp::execute(Item **itp)
#endif
/*
We don't need to surpress sen
f
ing of ok packet here (by setting
We don't need to surpress sen
d
ing of ok packet here (by setting
thd->net.no_send_ok to true), because we are not allowing statements
in functions now.
*/
...
...
sql/net_serv.cc
View file @
e9ad5085
...
...
@@ -121,8 +121,7 @@ my_bool my_net_init(NET *net, Vio* vio)
DBUG_RETURN
(
1
);
net
->
buff_end
=
net
->
buff
+
net
->
max_packet
;
net
->
vio
=
vio
;
net
->
no_send_ok
=
0
;
net
->
no_send_eof
=
0
;
net
->
no_send_ok
=
net
->
no_send_eof
=
net
->
no_send_error
=
0
;
net
->
error
=
0
;
net
->
return_errno
=
0
;
net
->
return_status
=
0
;
net
->
pkt_nr
=
net
->
compress_pkt_nr
=
0
;
net
->
write_pos
=
net
->
read_pos
=
net
->
buff
;
...
...
sql/protocol.cc
View file @
e9ad5085
...
...
@@ -65,6 +65,12 @@ void net_send_error(THD *thd, uint sql_errno, const char *err)
err
?
err
:
net
->
last_error
[
0
]
?
net
->
last_error
:
"NULL"
));
if
(
net
&&
net
->
no_send_error
)
{
thd
->
clear_error
();
DBUG_PRINT
(
"info"
,
(
"sending error messages prohibited"
));
DBUG_VOID_RETURN
;
}
if
(
thd
->
spcont
&&
thd
->
spcont
->
find_handler
(
sql_errno
,
MYSQL_ERROR
::
WARN_LEVEL_ERROR
))
{
...
...
@@ -154,6 +160,13 @@ net_printf_error(THD *thd, uint errcode, ...)
DBUG_ENTER
(
"net_printf_error"
);
DBUG_PRINT
(
"enter"
,(
"message: %u"
,
errcode
));
if
(
net
&&
net
->
no_send_error
)
{
thd
->
clear_error
();
DBUG_PRINT
(
"info"
,
(
"sending error messages prohibited"
));
DBUG_VOID_RETURN
;
}
if
(
thd
->
spcont
&&
thd
->
spcont
->
find_handler
(
errcode
,
MYSQL_ERROR
::
WARN_LEVEL_ERROR
))
{
...
...
@@ -300,6 +313,9 @@ send_ok(THD *thd, ha_rows affected_rows, ulonglong id, const char *message)
VOID
(
net_flush
(
net
));
/* We can't anymore send an error to the client */
thd
->
net
.
report_error
=
0
;
thd
->
net
.
no_send_error
=
1
;
DBUG_PRINT
(
"info"
,
(
"OK sent, so no more error sendong allowed"
));
DBUG_VOID_RETURN
;
}
...
...
@@ -357,6 +373,8 @@ send_eof(THD *thd, bool no_flush)
if
(
!
no_flush
)
VOID
(
net_flush
(
net
));
}
thd
->
net
.
no_send_error
=
1
;
DBUG_PRINT
(
"info"
,
(
"EOF sent, so no more error sendong allowed"
));
}
DBUG_VOID_RETURN
;
}
...
...
sql/sql_parse.cc
View file @
e9ad5085
...
...
@@ -960,6 +960,7 @@ void execute_init_command(THD *thd, sys_var_str *init_command_var,
*/
save_vio
=
thd
->
net
.
vio
;
thd
->
net
.
vio
=
0
;
thd
->
net
.
no_send_error
=
0
;
dispatch_command
(
COM_QUERY
,
thd
,
thd
->
query
,
thd
->
query_length
+
1
);
rw_unlock
(
var_mutex
);
thd
->
client_capabilities
=
save_client_capabilities
;
...
...
@@ -1019,6 +1020,7 @@ pthread_handler_decl(handle_one_connection,arg)
int
error
;
NET
*
net
=
&
thd
->
net
;
thd
->
thread_stack
=
(
char
*
)
&
thd
;
net
->
no_send_error
=
0
;
if
((
error
=
check_connection
(
thd
)))
{
// Wrong permissions
...
...
@@ -1057,6 +1059,7 @@ pthread_handler_decl(handle_one_connection,arg)
thd
->
init_for_queries
();
while
(
!
net
->
error
&&
net
->
vio
!=
0
&&
!
(
thd
->
killed
==
THD
::
KILL_CONNECTION
))
{
net
->
no_send_error
=
0
;
if
(
do_command
(
thd
))
break
;
}
...
...
@@ -2087,6 +2090,7 @@ mysql_execute_command(THD *thd)
/* most outer SELECT_LEX_UNIT of query */
SELECT_LEX_UNIT
*
unit
=
&
lex
->
unit
;
DBUG_ENTER
(
"mysql_execute_command"
);
thd
->
net
.
no_send_error
=
0
;
/*
In many cases first table of main SELECT_LEX have special meaning =>
...
...
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