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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
ed1ba992
Commit
ed1ba992
authored
Jan 02, 2012
by
Tatjana Azundris Nuernberg
Browse files
Options
Browse Files
Download
Plain Diff
manual up-merge of Bug#11755281
parents
cb80ad09
251fa88a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
2 deletions
+37
-2
mysql-test/r/init_connect.result
mysql-test/r/init_connect.result
+2
-0
mysql-test/t/init_connect.test
mysql-test/t/init_connect.test
+8
-0
sql/sql_connect.cc
sql/sql_connect.cc
+27
-2
No files found.
mysql-test/r/init_connect.result
View file @
ed1ba992
...
...
@@ -20,6 +20,8 @@ hex(a)
616263
set GLOBAL init_connect="adsfsdfsdfs";
select @a;
ERROR 08S01: Aborted connection to db: 'test' user: 'user_1' host: 'localhost' (init_connect command failed)
select @a;
Got one of the listed errors
drop table t1;
End of 4.1 tests
...
...
mysql-test/t/init_connect.test
View file @
ed1ba992
...
...
@@ -36,6 +36,14 @@ connection con0;
set
GLOBAL
init_connect
=
"adsfsdfsdfs"
;
connect
(
con5
,
localhost
,
user_1
,,);
connection
con5
;
# BUG#11755281/47032: ERROR 2006 / ERROR 2013 INSTEAD OF PROPER ERROR MESSAGE
# We now throw a proper error message here:
--
replace_regex
/
connection
.*
to
/
connection
to
/
--
error
ER_NEW_ABORTING_CONNECTION
select
@
a
;
# We got disconnected after receiving the above error message; any further
# requests should fail with a notice that no one's listening to us.
# --error CR_SERVER_GONE_ERROR,CR_SERVER_LOST
--
error
2013
,
2006
select
@
a
;
connection
con0
;
...
...
sql/sql_connect.cc
View file @
ed1ba992
...
...
@@ -668,13 +668,38 @@ void prepare_new_connection_state(THD* thd)
execute_init_command
(
thd
,
&
opt_init_connect
,
&
LOCK_sys_init_connect
);
if
(
thd
->
is_error
())
{
thd
->
killed
=
THD
::
KILL_CONNECTION
;
ulong
packet_length
;
NET
*
net
=
&
thd
->
net
;
sql_print_warning
(
ER
(
ER_NEW_ABORTING_CONNECTION
),
thd
->
thread_id
,(
thd
->
db
?
thd
->
db
:
"unconnected"
),
thd
->
thread_id
,
thd
->
db
?
thd
->
db
:
"unconnected"
,
sctx
->
user
?
sctx
->
user
:
"unauthenticated"
,
sctx
->
host_or_ip
,
"init_connect command failed"
);
sql_print_warning
(
"%s"
,
thd
->
stmt_da
->
message
());
thd
->
lex
->
current_select
=
0
;
my_net_set_read_timeout
(
net
,
thd
->
variables
.
net_wait_timeout
);
thd
->
clear_error
();
net_new_transaction
(
net
);
packet_length
=
my_net_read
(
net
);
/*
If my_net_read() failed, my_error() has been already called,
and the main Diagnostics Area contains an error condition.
*/
if
(
packet_length
!=
packet_error
)
my_error
(
ER_NEW_ABORTING_CONNECTION
,
MYF
(
0
),
thd
->
thread_id
,
thd
->
db
?
thd
->
db
:
"unconnected"
,
sctx
->
user
?
sctx
->
user
:
"unauthenticated"
,
sctx
->
host_or_ip
,
"init_connect command failed"
);
thd
->
server_status
&=
~
SERVER_STATUS_CLEAR_SET
;
thd
->
protocol
->
end_statement
();
thd
->
killed
=
THD
::
KILL_CONNECTION
;
return
;
}
thd
->
proc_info
=
0
;
thd
->
set_time
();
thd
->
init_for_queries
();
...
...
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