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.


client/mysqltest.c:
  Set 'mysql_errno' variable.
This commit is contained in:
unknown 2008-03-17 13:39:56 +03:00
parent 2ebee313b5
commit 30d644f859

View File

@ -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,
CLIENT_MULTI_STATEMENTS))
{
var_set_errno(mysql_errno(con));
handle_error(command, mysql_errno(con), mysql_error(con),
mysql_sqlstate(con), ds);
return 0; /* Not connected */
}
var_set_errno(0);
handle_no_error(command);
return 1; /* Connected */
}