diff options
author | unknown <monty@mysql.com> | 2005-07-28 16:10:14 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2005-07-28 16:10:14 +0300 |
commit | 79f75d8fad96e7b1da588eb850a25f9e9697ac2e (patch) | |
tree | af22629d2c36ae4196e6f23584c4cecc393b874e /sql-common | |
parent | 520ebda4f22a4471ddedddf1a63561787f31c409 (diff) | |
download | mariadb-git-79f75d8fad96e7b1da588eb850a25f9e9697ac2e.tar.gz |
Cleanups during review of new code
Ensure mysql_close() is called if mysql_set_character_set() fails
libmysql/libmysql.c:
Indentation cleanup
mysql-test/r/select.result:
Fix bad merge & align code with 4.1
mysql-test/r/type_newdecimal.result:
Added test of extreme case
mysql-test/t/select.test:
Fix bad merge & align code with 4.1
mysql-test/t/type_newdecimal.test:
Added test of extreme case
mysys/charset.c:
Removed not used variable
mysys/default.c:
Simplify code
sql-common/client.c:
Ensure mysql_close() is called if mysql_set_character_set() fails
sql/log.cc:
strmov(strmov()) -> strxmov()
sql/sp.cc:
Indentation fixes
sql/sql_acl.cc:
Indentation fixes
sql/sql_base.cc:
Added commments
Moved variable to inner block
sql/sql_show.cc:
Simple optimization (removed loop variable)
sql/sql_trigger.cc:
strmov(strmov()) -> strxmov()
strings/decimal.c:
Indentation fixes
Diffstat (limited to 'sql-common')
-rw-r--r-- | sql-common/client.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sql-common/client.c b/sql-common/client.c index 4ecc8d26fc7..4ec919553c6 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -2206,14 +2206,22 @@ my_bool mysql_reconnect(MYSQL *mysql) tmp_mysql.rpl_pivot = mysql->rpl_pivot; if (!mysql_real_connect(&tmp_mysql,mysql->host,mysql->user,mysql->passwd, mysql->db, mysql->port, mysql->unix_socket, - mysql->client_flag | CLIENT_REMEMBER_OPTIONS) || - mysql_set_character_set(&tmp_mysql, mysql->charset->csname)) + mysql->client_flag | CLIENT_REMEMBER_OPTIONS)) { mysql->net.last_errno= tmp_mysql.net.last_errno; strmov(mysql->net.last_error, tmp_mysql.net.last_error); strmov(mysql->net.sqlstate, tmp_mysql.net.sqlstate); DBUG_RETURN(1); } + if (mysql_set_character_set(&tmp_mysql, mysql->charset->csname)) + { + mysql_close(&tmp_mysql); + mysql->net.last_errno= tmp_mysql.net.last_errno; + strmov(mysql->net.last_error, tmp_mysql.net.last_error); + strmov(mysql->net.sqlstate, tmp_mysql.net.sqlstate); + DBUG_RETURN(1); + } + tmp_mysql.reconnect= 1; tmp_mysql.free_me= mysql->free_me; |