summaryrefslogtreecommitdiff
path: root/libmysqld
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2004-03-28 17:22:04 +0400
committerunknown <konstantin@mysql.com>2004-03-28 17:22:04 +0400
commit7e5cd910576c1149d6cac0b1babb0b71c76ca102 (patch)
tree5bf725b1d8706c37d5a6850017ab0655d21bae3e /libmysqld
parent76385f32b67ae6560cebd81a985d9793202b81c3 (diff)
downloadmariadb-git-7e5cd910576c1149d6cac0b1babb0b71c76ca102.tar.gz
Simplification: MYSQL_RES *result replaced with MYSQL_DATA result;
No need to check for result existence any more, store_result functions now are shorter. cli_read_binary_rows rewritten to handle MYSQL_DATA directly. include/mysql.h: MYSQL_RES * pointer replaced with MYSQL_DATA: it saves us at least 2 mallocs per store_result and simplifies stored result handling. Plus it's done with cursor fetch in mind: cursor fetch will use this structure to buffer fetched rows. libmysql/client_settings.h: signature of cli_read_binary_rows changed libmysql/libmysql.c: MYSQL_DATA is now used to handle result. cli_read_binary_rows rewritten to use MYSQL_DATA directly. libmysql/libmysql.def: declarations of new calls in the library libmysqld/lib_sql.cc: MYSQL_DATA is now used to handle result. cli_read_binary_rows rewritten to use MYSQL_DATA directly.
Diffstat (limited to 'libmysqld')
-rw-r--r--libmysqld/lib_sql.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index aa29f630b0d..6fb23f8f00d 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -200,9 +200,14 @@ static int emb_stmt_execute(MYSQL_STMT *stmt)
DBUG_RETURN(0);
}
-MYSQL_DATA *emb_read_binary_rows(MYSQL_STMT *stmt)
+int emb_read_binary_rows(MYSQL_STMT *stmt)
{
- return emb_read_rows(stmt->mysql, 0, 0);
+ MYSQL_DATA *data;
+ if (!(data= emb_read_rows(stmt->mysql, 0, 0)))
+ return 1;
+ stmt->result= *data;
+ my_free((char *) data, MYF(0));
+ return 0;
}
int emb_unbuffered_fetch(MYSQL *mysql, char **row)