1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#ifndef PLUGIN_MYSQL_PROTOCOL_OLDLIBDRIZZLE_H
21
#define PLUGIN_MYSQL_PROTOCOL_OLDLIBDRIZZLE_H
23
#include <drizzled/plugin/listen_tcp.h>
24
#include <drizzled/plugin/client.h>
28
class ListenMySQLProtocol: public drizzled::plugin::ListenTcp
31
bool using_mysql41_protocol;
34
ListenMySQLProtocol(std::string name_arg, bool using_mysql41_protocol_arg):
35
drizzled::plugin::ListenTcp(name_arg),
36
using_mysql41_protocol(using_mysql41_protocol_arg)
38
virtual const char* getHost(void) const;
39
virtual in_port_t getPort(void) const;
40
virtual drizzled::plugin::Client *getClient(int fd);
43
class ClientMySQLProtocol: public drizzled::plugin::Client
48
uint32_t client_capabilities;
49
bool using_mysql41_protocol;
51
bool checkConnection(void);
52
bool netStoreData(const unsigned char *from, size_t length);
53
void writeEOFPacket(uint32_t server_status, uint32_t total_warn_count);
56
ClientMySQLProtocol(int fd, bool using_mysql41_protocol_arg);
57
virtual ~ClientMySQLProtocol();
59
virtual int getFileDescriptor(void);
60
virtual bool isConnected();
61
virtual bool isReading(void);
62
virtual bool isWriting(void);
63
virtual bool flush(void);
64
virtual void close(void);
66
virtual bool authenticate(void);
67
virtual bool readCommand(char **packet, uint32_t *packet_length);
69
virtual void sendOK(void);
70
virtual void sendEOF(void);
71
virtual void sendError(uint32_t sql_errno, const char *err);
73
virtual bool sendFields(List<Item> *list);
76
virtual bool store(Field *from);
77
virtual bool store(void);
78
virtual bool store(int32_t from);
79
virtual bool store(uint32_t from);
80
virtual bool store(int64_t from);
81
virtual bool store(uint64_t from);
82
virtual bool store(double from, uint32_t decimals, String *buffer);
83
virtual bool store(const char *from, size_t length);
85
virtual bool haveError(void);
86
virtual bool haveMoreData(void);
87
virtual bool wasAborted(void);
90
#endif /* PLUGIN_MYSQL_PROTOCOL_OLDLIBDRIZZLE_H */