33
33
#include "oldlibdrizzle.h"
34
34
#include "options.h"
36
#define PROTOCOL_VERSION 10
40
extern uint32_t global_thread_id;
36
43
using namespace std;
37
44
using namespace drizzled;
39
#define PROTOCOL_VERSION 10
41
extern uint32_t global_thread_id;
43
46
static const uint32_t DRIZZLE_TCP_PORT= 4427;
44
47
static const unsigned int PACKET_BUFFER_EXTRA_ALLOC= 1024;
45
48
static uint32_t port;
575
578
return netStoreData((unsigned char*) buff,
576
(size_t) (int10_to_str(from, buff, -10) - buff));
579
(size_t) (internal::int10_to_str(from, buff, -10) - buff));
579
582
bool ClientDrizzleProtocol::store(uint32_t from)
582
585
return netStoreData((unsigned char*) buff,
583
(size_t) (int10_to_str(from, buff, 10) - buff));
586
(size_t) (internal::int10_to_str(from, buff, 10) - buff));
586
589
bool ClientDrizzleProtocol::store(int64_t from)
589
592
return netStoreData((unsigned char*) buff,
590
(size_t) (int64_t10_to_str(from, buff, -10) - buff));
593
(size_t) (internal::int64_t10_to_str(from, buff, -10) - buff));
593
596
bool ClientDrizzleProtocol::store(uint64_t from)
596
599
return netStoreData((unsigned char*) buff,
597
(size_t) (int64_t10_to_str(from, buff, 10) - buff));
600
(size_t) (internal::int64_t10_to_str(from, buff, 10) - buff));
600
603
bool ClientDrizzleProtocol::store(double from, uint32_t decimals, String *buffer)
809
812
static ListenDrizzleProtocol *listen_obj= NULL;
811
static int init(drizzled::plugin::Registry ®istry)
814
static int init(plugin::Registry ®istry)
813
816
listen_obj= new ListenDrizzleProtocol("drizzle_protocol", false);
814
817
registry.add(listen_obj);
818
static int deinit(drizzled::plugin::Registry ®istry)
821
static int deinit(plugin::Registry ®istry)
820
823
registry.remove(listen_obj);
821
824
delete listen_obj;
843
846
static DRIZZLE_SYSVAR_STR(bind_address, bind_address, PLUGIN_VAR_READONLY,
844
847
N_("Address to bind to."), NULL, NULL, NULL);
846
static drizzle_sys_var* system_variables[]= {
849
static drizzle_sys_var* sys_variables[]= {
847
850
DRIZZLE_SYSVAR(port),
848
851
DRIZZLE_SYSVAR(connect_timeout),
849
852
DRIZZLE_SYSVAR(read_timeout),
865
868
init, /* Plugin Init */
866
869
deinit, /* Plugin Deinit */
867
870
NULL, /* status variables */
868
system_variables, /* system variables */
871
sys_variables, /* system variables */
869
872
NULL /* config options */
871
874
DRIZZLE_DECLARE_PLUGIN_END;