summaryrefslogtreecommitdiff
path: root/libmysqld
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2003-09-19 14:05:28 +0500
committerunknown <hf@deer.(none)>2003-09-19 14:05:28 +0500
commit83e8881a5ad2a0fdfcb1ad06adca3614b6c7e0e4 (patch)
tree2577ed3a7cb5e2f36f2d4fbcadf4fec7b885e4b9 /libmysqld
parent4c63804846d1530b602a74ff30ad26df7645a94b (diff)
downloadmariadb-git-83e8881a5ad2a0fdfcb1ad06adca3614b6c7e0e4.tar.gz
SCRUM
prepared statements in embedded library. some fixes after testing include/mysql.h: virtual method added libmysql/client_settings.h: declaration added libmysql/libmysql.c: implementation added mysql_fetch changed to work in both libraries libmysqld/lib_sql.cc: implementation added sql-common/client.c: added items in methods table sql/client_settings.h: decided to remove such defines - i placed single #ifdef in client.c
Diffstat (limited to 'libmysqld')
-rw-r--r--libmysqld/lib_sql.cc28
1 files changed, 24 insertions, 4 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index d5f35b6c550..24ef3b76c0e 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -195,6 +195,26 @@ MYSQL_DATA *emb_read_binary_rows(MYSQL_STMT *stmt)
return emb_read_rows(stmt->mysql, 0, 0);
}
+int STDCALL emb_unbuffered_fetch(MYSQL *mysql, char **row)
+{
+ MYSQL_DATA *data= ((THD*)mysql->thd)->data;
+ if (!data || !data->data)
+ {
+ *row= NULL;
+ if (data)
+ {
+ free_rows(data);
+ ((THD*)mysql->thd)->data= NULL;
+ }
+ }
+ else
+ {
+ *row= (char *)data->data->data;
+ data->data= data->data->next;
+ }
+ return 0;
+}
+
MYSQL_METHODS embedded_methods=
{
emb_mysql_read_query_result,
@@ -205,7 +225,8 @@ MYSQL_METHODS embedded_methods=
emb_list_fields,
emb_read_prepare_result,
emb_stmt_execute,
- emb_read_binary_rows
+ emb_read_binary_rows,
+ emb_unbuffered_fetch
};
C_MODE_END
@@ -561,9 +582,8 @@ bool Protocol_prep::write()
*data->prev_ptr= cur;
data->prev_ptr= &cur->next;
- next_field=cur->data;
- next_mysql_field= thd->mysql->fields;
-
+ cur->next= 0;
+
return false;
}