Commit 6e922478 authored by unknown's avatar unknown

SCRUM

embedded library
missed memory freeing added


libmysqld/embedded_priv.h:
  declaration added
libmysqld/lib_sql.cc:
  implementation added
libmysqld/libmysqld.c:
  mysql->thd releasing
parent 83e8881a
......@@ -26,6 +26,7 @@ C_MODE_START
extern void lib_connection_phase(NET *net, int phase);
extern void init_embedded_mysql(MYSQL *mysql, int client_flag, char *db);
extern void *create_embedded_thd(int client_flag, char *db);
extern void free_embedded_thd(MYSQL *mysql);
extern MYSQL_METHODS embedded_methods;
void free_old_query(MYSQL *mysql);
extern my_bool server_inited;
......
......@@ -474,6 +474,16 @@ void *create_embedded_thd(int client_flag, char *db)
return thd;
}
void free_embedded_thd(MYSQL *mysql)
{
THD *thd= (THD*)mysql->thd;
if (!thd)
return;
if (thd->data)
free_rows(thd->data);
delete thd;
}
C_MODE_END
bool Protocol::send_fields(List<Item> *list, uint flag)
......
......@@ -289,6 +289,9 @@ void STDCALL mysql_close(MYSQL *mysql)
#endif /* HAVE_OPENSSL */
if (mysql->free_me)
my_free((gptr) mysql,MYF(0));
free_embedded_thd(mysql);
}
DBUG_VOID_RETURN;
}
......
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