diff options
author | unknown <hf@deer.(none)> | 2004-02-10 17:09:59 +0400 |
---|---|---|
committer | unknown <hf@deer.(none)> | 2004-02-10 17:09:59 +0400 |
commit | b4fc7c7fbf643b39f3686bfe344b21cdd7233fb5 (patch) | |
tree | 440516e57c4db729a22c4d8e8ccd54babc9dc6f0 /libmysqld | |
parent | e5ab70702c082c77401052f940b18b5f6d50a8c3 (diff) | |
download | mariadb-git-b4fc7c7fbf643b39f3686bfe344b21cdd7233fb5.tar.gz |
Fix for #2208 (multi-query returns wrong result in embedded library)
now we execute only one first select during mysql_real_query
others - during 'mysql_next_result'
include/mysql.h:
'virtual' next_result added
libmysql/client_settings.h:
cli_next_result declaration added
libmysql/libmysql.c:
mysql_next_result now works in embedded library as well
libmysqld/lib_sql.cc:
emb_next_result implemented
sql/sql_class.h:
fields to store the rest of the query added
sql/sql_parse.cc:
Saving the rest of the query added for embedded case
Diffstat (limited to 'libmysqld')
-rw-r--r-- | libmysqld/lib_sql.cc | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index e36e878d4b1..81235ce0c22 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -245,6 +245,18 @@ static MYSQL_RES * emb_mysql_store_result(MYSQL *mysql) return mysql_store_result(mysql); } +int emb_next_result(MYSQL *mysql) +{ + THD *thd= (THD*)mysql->thd; + DBUG_ENTER("emb_next_result"); + + if (emb_advanced_command(mysql, COM_QUERY,0,0, + thd->query_rest,thd->query_rest_length,1) + || emb_mysql_read_query_result(mysql)) + DBUG_RETURN(1); + + DBUG_RETURN(0); /* No more results */ +} MYSQL_METHODS embedded_methods= { @@ -259,7 +271,8 @@ MYSQL_METHODS embedded_methods= emb_read_binary_rows, emb_unbuffered_fetch, emb_free_embedded_thd, - emb_read_statistic + emb_read_statistic, + emb_next_result }; C_MODE_END @@ -749,6 +762,11 @@ bool Protocol::net_store_data(const char *from, uint length) return false; } +char *memdup_mysql(struct st_mysql *mysql, const char*data, int length) +{ + return memdup_root(&mysql->field_alloc, data, length); +} + #if 0 /* The same as Protocol::net_store_data but does the converstion */ |