~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/protocol.h

  • Committer: Monty Taylor
  • Date: 2008-10-23 23:53:49 UTC
  • mto: This revision was merged to the branch mainline in revision 557.
  • Revision ID: monty@inaugust.com-20081023235349-317wgwqwgccuacmq
SplitĀ outĀ nested_join.h.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#ifdef USE_PRAGMA_INTERFACE
21
 
#pragma interface                       /* gcc class implementation */
22
 
#endif
23
 
 
24
20
 
25
21
class i_string;
26
 
class THD;
 
22
class Session;
27
23
typedef struct st_drizzle_field DRIZZLE_FIELD;
28
24
typedef struct st_drizzle_rows DRIZZLE_ROWS;
29
25
 
30
26
class Protocol
31
27
{
32
28
protected:
33
 
  THD    *thd;
 
29
  Session        *session;
34
30
  String *packet;
35
31
  String *convert;
36
32
  uint32_t field_pos;
42
38
                        const CHARSET_INFO * const fromcs, const CHARSET_INFO * const tocs);
43
39
public:
44
40
  Protocol() {}
45
 
  Protocol(THD *thd_arg) { init(thd_arg); }
 
41
  Protocol(Session *session_arg) { init(session_arg); }
46
42
  virtual ~Protocol() {}
47
 
  void init(THD* thd_arg);
 
43
  void init(Session* session_arg);
48
44
 
49
45
  enum { SEND_NUM_ROWS= 1, SEND_DEFAULTS= 2, SEND_EOF= 4 };
50
46
  virtual bool send_fields(List<Item> *list, uint32_t flags);
71
67
    return 0;
72
68
  }
73
69
  virtual bool flush();
74
 
  virtual void end_partial_result_set(THD *thd);
 
70
  virtual void end_partial_result_set(Session *session);
75
71
  virtual void prepare_for_resend()=0;
76
72
 
77
73
  virtual bool store_null()=0;
108
104
{
109
105
public:
110
106
  Protocol_text() {}
111
 
  Protocol_text(THD *thd_arg) :Protocol(thd_arg) {}
 
107
  Protocol_text(Session *session_arg) :Protocol(session_arg) {}
112
108
  virtual void prepare_for_resend();
113
109
  virtual bool store_null();
114
110
  virtual bool store_tiny(int64_t from);
128
124
  virtual enum enum_protocol_type type() { return PROTOCOL_TEXT; };
129
125
};
130
126
 
131
 
void send_warning(THD *thd, uint32_t sql_errno, const char *err=0);
132
 
void net_send_error(THD *thd, uint32_t sql_errno=0, const char *err=0);
133
 
void net_end_statement(THD *thd);
 
127
void send_warning(Session *session, uint32_t sql_errno, const char *err=0);
 
128
void net_send_error(Session *session, uint32_t sql_errno=0, const char *err=0);
 
129
void net_end_statement(Session *session);
134
130
unsigned char *net_store_data(unsigned char *to,const unsigned char *from, size_t length);
135
131
unsigned char *net_store_data(unsigned char *to,int32_t from);
136
132
unsigned char *net_store_data(unsigned char *to,int64_t from);