diff options
author | monty@mishka.mysql.fi <> | 2005-09-14 01:41:44 +0300 |
---|---|---|
committer | monty@mishka.mysql.fi <> | 2005-09-14 01:41:44 +0300 |
commit | f348f62cc31fdba05be52f25a3adbc67cad3f245 (patch) | |
tree | fed5fb311670c7f36e10dc2e65ab02177c47316a /sql-common | |
parent | 8369e7de8a18397d4725d2f24d7f3bd40ec71132 (diff) | |
download | mariadb-git-f348f62cc31fdba05be52f25a3adbc67cad3f245.tar.gz |
Added option --valgrind-mysqltest to mysql-test-run
Added flag to Field::store(longlong) to specify if value is unsigned.
This fixes bug #12750: Incorrect storage of 9999999999999999999 in DECIMAL(19, 0)
Fixed warning from valgrind in CREATE ... SELECT
Fixed double free of mysql.options if reconnect failed
Diffstat (limited to 'sql-common')
-rw-r--r-- | sql-common/client.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sql-common/client.c b/sql-common/client.c index 43c50f12ae1..08ad906e2b6 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -2203,8 +2203,9 @@ my_bool mysql_reconnect(MYSQL *mysql) DBUG_RETURN(1); } mysql_init(&tmp_mysql); - tmp_mysql.options=mysql->options; - tmp_mysql.rpl_pivot = mysql->rpl_pivot; + tmp_mysql.options= mysql->options; + 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)) @@ -2216,6 +2217,8 @@ my_bool mysql_reconnect(MYSQL *mysql) } if (mysql_set_character_set(&tmp_mysql, mysql->charset->csname)) { + DBUG_PRINT("error", ("mysql_set_character_set() failed")); + bzero((char*) &tmp_mysql.options,sizeof(tmp_mysql.options)); mysql_close(&tmp_mysql); mysql->net.last_errno= tmp_mysql.net.last_errno; strmov(mysql->net.last_error, tmp_mysql.net.last_error); @@ -2223,6 +2226,7 @@ my_bool mysql_reconnect(MYSQL *mysql) DBUG_RETURN(1); } + DBUG_PRINT("info", ("reconnect succeded")); tmp_mysql.reconnect= 1; tmp_mysql.free_me= mysql->free_me; @@ -2286,6 +2290,8 @@ mysql_select_db(MYSQL *mysql, const char *db) static void mysql_close_free_options(MYSQL *mysql) { + DBUG_ENTER("mysql_close_free_options"); + my_free(mysql->options.user,MYF(MY_ALLOW_ZERO_PTR)); my_free(mysql->options.host,MYF(MY_ALLOW_ZERO_PTR)); my_free(mysql->options.password,MYF(MY_ALLOW_ZERO_PTR)); @@ -2314,6 +2320,7 @@ static void mysql_close_free_options(MYSQL *mysql) my_free(mysql->options.shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); #endif /* HAVE_SMEM */ bzero((char*) &mysql->options,sizeof(mysql->options)); + DBUG_VOID_RETURN; } |