From 8bc13b187450abb838cdc74217da7b7f73f1aa98 Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Sat, 4 Oct 2003 19:28:08 +0500 Subject: Fix for bugs #1437, #1446 --- libmysqld/lib_sql.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'libmysqld') diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index ddfd05d64b6..e70f34397d6 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -217,9 +217,16 @@ static void STDCALL emb_free_embedded_thd(MYSQL *mysql) THD *thd= (THD*)mysql->thd; if (thd->data) free_rows(thd->data); + thread_count--; delete thd; } +static const char * STDCALL emb_read_statistic(MYSQL *mysql) +{ + THD *thd= (THD*)mysql->thd; + return thd->net.last_error; +} + MYSQL_METHODS embedded_methods= { emb_mysql_read_query_result, @@ -232,7 +239,8 @@ MYSQL_METHODS embedded_methods= emb_stmt_execute, emb_read_binary_rows, emb_unbuffered_fetch, - emb_free_embedded_thd + emb_free_embedded_thd, + emb_read_statistic }; C_MODE_END @@ -431,6 +439,7 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag, char *db) { THD *thd = (THD *)mysql->thd; thd->mysql= mysql; + mysql->server_version= server_version; } void *create_embedded_thd(int client_flag, char *db) @@ -465,6 +474,7 @@ void *create_embedded_thd(int client_flag, char *db) thd->data= 0; + thread_count++; return thd; } -- cgit v1.2.1