summaryrefslogtreecommitdiff
path: root/libmysqld
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2003-10-04 19:28:08 +0500
committerunknown <hf@deer.(none)>2003-10-04 19:28:08 +0500
commit759aabf7df936bd8c39d032ca168acc85e60d7b0 (patch)
treefc0a7f5d6971cd34c41f30f95658060011cf1f4f /libmysqld
parentee3bf94cbd001e9a97dfb4ba5ca6e298d91447cf (diff)
downloadmariadb-git-759aabf7df936bd8c39d032ca168acc85e60d7b0.tar.gz
Fix for bugs #1437, #1446
include/mysql.h: read_statistic added to virtual methods libmysql/client_settings.h: interface for cli_read_statistic added libmysql/libmysql.c: read_statistic and mysql_stat code changes libmysqld/lib_sql.cc: emb_read_statistic implemented server_version initialized sql-common/client.c: cli_read_statistic added to the table sql/sql_parse.cc: storage of result of COM_STATISTIC changed in embedded library
Diffstat (limited to 'libmysqld')
-rw-r--r--libmysqld/lib_sql.cc12
1 files changed, 11 insertions, 1 deletions
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;
}