summaryrefslogtreecommitdiff
path: root/libmysqld
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2003-09-18 12:25:00 +0500
committerunknown <hf@deer.(none)>2003-09-18 12:25:00 +0500
commit4535f6897f5ee132d086e0bd98bbc3a1fdaea54a (patch)
treefaa8a819d28509f6d514615b085cffbca009dd3d /libmysqld
parentd1e3e9f38f8555aa89422781506f4d99796bd738 (diff)
downloadmariadb-git-4535f6897f5ee132d086e0bd98bbc3a1fdaea54a.tar.gz
SCRUM
prepared statements in embedded library include/mysql_com.h: to make net_flush() working in expressions libmysqld/lib_sql.cc: some bugs fixed libmysqld/libmysqld.c: we already have the define in client_settings.h sql/protocol.cc: net_store_data should work that way in Protocol_prep (embedded server) sql/protocol.h: definition for net_store_data sql/sql_prepare.cc: now it works in embedded library
Diffstat (limited to 'libmysqld')
-rw-r--r--libmysqld/lib_sql.cc13
-rw-r--r--libmysqld/libmysqld.c2
2 files changed, 10 insertions, 5 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 68620c922c4..6b099158ae0 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -80,6 +80,12 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
client). So we have to call free_old_query here
*/
free_old_query(mysql);
+ if (!arg)
+ {
+ arg= header;
+ arg_length= header_length;
+ }
+
result= dispatch_command(command, thd, (char *) arg, arg_length + 1);
if (!skip_check)
@@ -136,6 +142,7 @@ static my_bool STDCALL emb_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
stmt->fields= mysql->fields;
stmt->mem_root= mysql->field_alloc;
+ mysql->fields= NULL;
}
return 0;
@@ -550,7 +557,7 @@ bool Protocol_prep::write()
return true;
}
cur->data= (MYSQL_ROW)(((char *)cur) + sizeof(MYSQL_ROWS));
- memcpy(cur->data, packet->ptr(), packet->length());
+ memcpy(cur->data, packet->ptr()+1, packet->length()-1);
*data->prev_ptr= cur;
data->prev_ptr= &cur->next;
@@ -674,7 +681,7 @@ bool setup_params_data(st_prep_stmt *stmt)
setup_param_functions(param, client_param->buffer_type);
if (!param->long_data_supplied)
{
- if (client_param->is_null)
+ if (*client_param->is_null)
param->maybe_null= param->null_value= 1;
else
{
@@ -712,7 +719,7 @@ bool setup_params_data_withlog(st_prep_stmt *stmt)
else
{
- if (client_param->is_null)
+ if (*client_param->is_null)
{
param->maybe_null= param->null_value= 1;
res= &null_string;
diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c
index 96e77aa340f..67dc00e4c1b 100644
--- a/libmysqld/libmysqld.c
+++ b/libmysqld/libmysqld.c
@@ -47,8 +47,6 @@
#define INADDR_NONE -1
#endif
-#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_TRANSACTIONS | CLIENT_PROTOCOL_41)
-
#if defined(MSDOS) || defined(__WIN__)
#define ERRNO WSAGetLastError()
#define perror(A)