summaryrefslogtreecommitdiff
path: root/libmysqld/lib_sql.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libmysqld/lib_sql.cc')
-rw-r--r--libmysqld/lib_sql.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index e36e878d4b1..188227c21f9 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.ptr(),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
@@ -676,7 +689,10 @@ send_ok(THD *thd,ha_rows affected_rows,ulonglong id,const char *message)
mysql->affected_rows= affected_rows;
mysql->insert_id= id;
if (message)
+ {
strmake(thd->net.last_error, message, sizeof(thd->net.last_error)-1);
+ mysql->info= thd->net.last_error;
+ }
DBUG_VOID_RETURN;
}