1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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'
This commit is contained in:
hf@deer.(none)
2004-02-10 17:09:59 +04:00
parent d200443bed
commit 348bd98e48
6 changed files with 50 additions and 12 deletions

View File

@ -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
*/