Commit c33a4508 authored by unknown's avatar unknown

Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-4.1

into deer.(none):/home/hf/work/mysql-4.1.2way

parents 8f2c2757 01397f5d
...@@ -72,6 +72,12 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, ...@@ -72,6 +72,12 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
mysql->field_count= 0; mysql->field_count= 0;
thd->store_globals(); // Fix if more than one connect thd->store_globals(); // Fix if more than one connect
/*
We have to call free_old_query before we start to fill mysql->fields
for new query. In the case of embedded server we collect field data
during query execution (not during data retrieval as it is in remote
client). So we have to call free_old_query here
*/
free_old_query(mysql); free_old_query(mysql);
result= dispatch_command(command, thd, (char *) arg, arg_length + 1); result= dispatch_command(command, thd, (char *) arg, arg_length + 1);
......
...@@ -311,14 +311,14 @@ error: ...@@ -311,14 +311,14 @@ error:
void STDCALL mysql_close(MYSQL *mysql) void STDCALL mysql_close(MYSQL *mysql)
{ {
DBUG_ENTER("mysql_close"); DBUG_ENTER("mysql_close");
if (mysql) /* Some simple safety */
{
if (mysql->methods != &embedded_methods) if (mysql->methods != &embedded_methods)
{ {
cli_mysql_close(mysql); cli_mysql_close(mysql);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
if (mysql) /* Some simple safety */
{
my_free(mysql->options.user,MYF(MY_ALLOW_ZERO_PTR)); my_free(mysql->options.user,MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->options.host,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)); my_free(mysql->options.password,MYF(MY_ALLOW_ZERO_PTR));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment