Commit f2b39a5a authored by anozdrin/alik@quad's avatar anozdrin/alik@quad

A patch for Bug#35329: connect does not set mysql_errno variable.

The problem was that 'connect' command didn't set mysql_errno
variable, thus the script was unable to determine whether connection
was opened or not.

The fix is to set this variable.

Test cases will be added in the scope of Bug33507
into connect.test file.
parent d3575ce0
...@@ -4221,11 +4221,13 @@ int connect_n_handle_errors(struct st_command *command, ...@@ -4221,11 +4221,13 @@ int connect_n_handle_errors(struct st_command *command,
if (!mysql_real_connect(con, host, user, pass, db, port, sock ? sock: 0, if (!mysql_real_connect(con, host, user, pass, db, port, sock ? sock: 0,
CLIENT_MULTI_STATEMENTS)) CLIENT_MULTI_STATEMENTS))
{ {
var_set_errno(mysql_errno(con));
handle_error(command, mysql_errno(con), mysql_error(con), handle_error(command, mysql_errno(con), mysql_error(con),
mysql_sqlstate(con), ds); mysql_sqlstate(con), ds);
return 0; /* Not connected */ return 0; /* Not connected */
} }
var_set_errno(0);
handle_no_error(command); handle_no_error(command);
return 1; /* Connected */ return 1; /* Connected */
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment