diff options
author | unknown <msvensson@neptunus.(none)> | 2006-04-11 20:49:31 +0200 |
---|---|---|
committer | unknown <msvensson@neptunus.(none)> | 2006-04-11 20:49:31 +0200 |
commit | ad04c98c7ec6f9c308e90dd97297806aadc26a7f (patch) | |
tree | 2068ea123482df3aba7910762c99cee96eb7296f /client/mysqlslap.c | |
parent | b79cbc781cba4aacbb42dc5a539275dd481387ca (diff) | |
download | mariadb-git-ad04c98c7ec6f9c308e90dd97297806aadc26a7f.tar.gz |
Don't use the MYSQL* returned from mysql_real_connect to overwrite the already initalised mysql variable
client/mysqlslap.c:
Only use the MYSQL* returned from mysql_reqal_connect as an indicator wether the connect was successfull or not.
As the manual says about the return value from mysql_real_connect: "A MYSQL* connection handle if the connection
was successful, NULL if the connection was unsuccessful. For a successful connection, the
return value is the same as the value of the first parameter."
Diffstat (limited to 'client/mysqlslap.c')
-rw-r--r-- | client/mysqlslap.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 904bf432071..0f91d28cd0b 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -1132,11 +1132,11 @@ run_task(thread_context *con) my_lock(lock_file, F_RDLCK, 0, F_TO_EOF, MYF(0)); if (!opt_only_print) { - if (!(mysql= mysql_real_connect(mysql, host, user, opt_password, - create_schema_string, - opt_mysql_port, - opt_mysql_unix_port, - 0))) + if (!(mysql_real_connect(mysql, host, user, opt_password, + create_schema_string, + opt_mysql_port, + opt_mysql_unix_port, + 0))) { fprintf(stderr,"%s: %s\n",my_progname,mysql_error(mysql)); goto end; |