diff options
author | unknown <anozdrin/alik@quad.> | 2008-03-17 13:39:56 +0300 |
---|---|---|
committer | unknown <anozdrin/alik@quad.> | 2008-03-17 13:39:56 +0300 |
commit | 30d644f859ee65748f12e3861abaf1fbb2c3b2c7 (patch) | |
tree | 084b84847f7fe739d3347b8f4bc1e49af025601d /client/mysqltest.c | |
parent | 2ebee313b5c4aed3a667b07bc93147eb9087f227 (diff) | |
download | mariadb-git-30d644f859ee65748f12e3861abaf1fbb2c3b2c7.tar.gz |
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.
Diffstat (limited to 'client/mysqltest.c')
-rw-r--r-- | client/mysqltest.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index 52e02789579..7ef184ae7e8 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -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 */ } |