diff --git a/include/mysql_com.h b/include/mysql_com.h index d5a70e4dfe8..4d2b9d7cdce 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -245,7 +245,7 @@ my_bool net_realloc(NET *net, unsigned long length); #ifndef EMBEDDED_LIBRARY /* To be removed by HF */ my_bool net_flush(NET *net); #else -#define net_flush(A) +#define net_flush(A) ((my_bool)0) #endif my_bool my_net_write(NET *net,const char *packet,unsigned long len); 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) diff --git a/sql/protocol.cc b/sql/protocol.cc index edf74aee05e..79420fb71d5 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -28,6 +28,9 @@ #ifndef EMBEDDED_LIBRARY bool Protocol::net_store_data(const char *from, uint length) +#else +bool Protocol_prep::net_store_data(const char *from, uint length) +#endif { ulong packet_length=packet->length(); /* @@ -43,7 +46,6 @@ bool Protocol::net_store_data(const char *from, uint length) packet->length((uint) (to+length-packet->ptr())); return 0; } -#endif /* Send a error string to client */ diff --git a/sql/protocol.h b/sql/protocol.h index 8986757922e..94fd303e259 100644 --- a/sql/protocol.h +++ b/sql/protocol.h @@ -127,6 +127,7 @@ public: virtual void prepare_for_resend(); #ifdef EMBEDDED_LIBRARY virtual bool write(); + bool net_store_data(const char *from, uint length); #endif virtual bool store_null(); virtual bool store_tiny(longlong from); diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index d16b499815e..4b8001c11c4 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -666,13 +666,11 @@ static bool mysql_test_select_fields(PREP_STMT *stmt, TABLE_LIST *tables, wild_num, conds, og_num, order, group, having, proc, select_lex, unit, 0)) DBUG_RETURN(1); -#ifndef EMBEDDED_LIBRARY if (send_prep_stmt(stmt, fields.elements) || thd->protocol_simple.send_fields(&fields, 0) || net_flush(&thd->net) || send_item_params(stmt)) DBUG_RETURN(1); -#endif join->cleanup(); } DBUG_RETURN(0);