summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2003-09-12 19:35:34 +0500
committerunknown <hf@deer.(none)>2003-09-12 19:35:34 +0500
commitdc250a6efc8bc451b301c74b494200dfb3dd3f8b (patch)
tree46609c9322de2696057f154dff31ea468a3f6280 /sql/sql_prepare.cc
parentd6f15e9d02d7fb33627c937ff47c948dd9ae0b2e (diff)
downloadmariadb-git-dc250a6efc8bc451b301c74b494200dfb3dd3f8b.tar.gz
SCRUM:
#977 Prepared statements in embedded library include/mysql.h: read_prepare_result function moved to 'virtual' libmysql/client_settings.h: declare proper function for libmysql libmysql/libmysql.c: some code moved from implementation of read_prepare_result to mysql_prepare_result to make creating separate (remote and embedded-server) versions easier libmysqld/libmysqld.c: emb_read_prepare_result prototype sql-common/client.c: cli_read_prepare_result added to the client_methods sql/client_settings.h: we don't need prepared statements in mini_client sql/sql_prepare.cc: embedded send_prep_stmt added
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r--sql/sql_prepare.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 4abbbcaff1f..088036e4c7e 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -142,6 +142,7 @@ void free_prep_stmt(PREP_STMT *stmt, TREE_FREE mode, void *not_used)
Send prepared stmt info to client after prepare
*/
+#ifndef EMBEDDED_LIBRARY
static bool send_prep_stmt(PREP_STMT *stmt, uint columns)
{
NET *net=&stmt->thd->net;
@@ -150,14 +151,20 @@ static bool send_prep_stmt(PREP_STMT *stmt, uint columns)
int4store(buff+1, stmt->stmt_id);
int2store(buff+5, columns);
int2store(buff+7, stmt->param_count);
-#ifndef EMBEDDED_LIBRARY
/* This should be fixed to work with prepared statements
*/
return (my_net_write(net, buff, sizeof(buff)) || net_flush(net));
+}
#else
- return true;
-#endif
+static bool send_prep_stmt(PREP_STMT *stmt, uint columns)
+{
+ MYSQL_STMT *client_stmt= stmt->thd->client_stmt;
+
+ client_stmt->stmt_id= stmt->stmt_id;
+ client_stmt->field_count= columns;
+ client_stmt->param_count= stmt->param_count;
}
+#endif /*!EMBEDDED_LIBRAYR*/
/*
Send information about all item parameters