mirror of
https://github.com/MariaDB/server.git
synced 2026-04-20 07:15:33 +02:00
Bug #33831 mysql_real_connect() connects again if
given an already connected MYSQL handle mysql_real_connect() did not check whether the MYSQL connection handler was already connected and connected again even if so. Now a CR_ALREADY_CONNECTED error is returned.
This commit is contained in:
parent
f0195faf88
commit
c9248c6424
5 changed files with 65 additions and 13 deletions
|
|
@ -1919,6 +1919,13 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
|
|||
db ? db : "(Null)",
|
||||
user ? user : "(Null)"));
|
||||
|
||||
/* Test whether we're already connected */
|
||||
if (net->vio)
|
||||
{
|
||||
set_mysql_error(mysql, CR_ALREADY_CONNECTED, unknown_sqlstate);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
/* Don't give sigpipe errors if the client doesn't want them */
|
||||
set_sigpipe(mysql);
|
||||
mysql->methods= &client_methods;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue