~jan-kneschke/mysql-proxy/packet-tracking-assertions

« back to all changes in this revision

Viewing changes to src/network-mysqld-packet.h

  • Committer: Kay Roepke
  • Date: 2009-01-20 12:04:47 UTC
  • Revision ID: kay@mysql.com-20090120120447-fkoxq5ovwf9iyk4v
add the wrapper script/makefile fu to start mysql-proxy without having to set the environment variables

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* $%BEGINLICENSE%$
2
 
 Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
 
2
 Copyright (C) 2008 MySQL AB, 2008 Sun Microsystems, Inc
3
3
 
4
 
 This program is free software; you can redistribute it and/or
5
 
 modify it under the terms of the GNU General Public License as
6
 
 published by the Free Software Foundation; version 2 of the
7
 
 License.
 
4
 This program is free software; you can redistribute it and/or modify
 
5
 it under the terms of the GNU General Public License as published by
 
6
 the Free Software Foundation; version 2 of the License.
8
7
 
9
8
 This program is distributed in the hope that it will be useful,
10
9
 but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
10
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
11
 GNU General Public License for more details.
13
12
 
14
13
 You should have received a copy of the GNU General Public License
15
14
 along with this program; if not, write to the Free Software
16
 
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17
 
 02110-1301  USA
 
15
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
16
 
19
17
 $%ENDLICENSE%$ */
20
18
#ifndef __NETWORK_MYSQLD_PACKET__
37
35
 * - high-level (grouping packets into a sequence)
38
36
 */
39
37
 
40
 
typedef enum {
41
 
        NETWORK_MYSQLD_PROTOCOL_VERSION_PRE41,
42
 
        NETWORK_MYSQLD_PROTOCOL_VERSION_41
43
 
} network_mysqld_protocol_t;
44
 
 
45
38
/**
46
39
 * tracking the state of the response of a COM_QUERY packet
47
40
 */
50
43
                PARSE_COM_QUERY_INIT,
51
44
                PARSE_COM_QUERY_FIELD,
52
45
                PARSE_COM_QUERY_RESULT,
53
 
                PARSE_COM_QUERY_LOCAL_INFILE_DATA,
54
 
                PARSE_COM_QUERY_LOCAL_INFILE_RESULT
 
46
                PARSE_COM_QUERY_LOAD_DATA,
 
47
                PARSE_COM_QUERY_LOAD_DATA_END_DATA
55
48
        } state;
56
49
 
57
50
        guint16 server_status;
70
63
 
71
64
NETWORK_API network_mysqld_com_query_result_t *network_mysqld_com_query_result_new(void);
72
65
NETWORK_API void network_mysqld_com_query_result_free(network_mysqld_com_query_result_t *udata);
73
 
NETWORK_API int network_mysqld_com_query_result_track_state(network_packet *packet, network_mysqld_com_query_result_t *udata) G_GNUC_DEPRECATED;
74
 
NETWORK_API gboolean network_mysqld_com_query_result_is_load_data(network_mysqld_com_query_result_t *udata) G_GNUC_DEPRECATED;
75
 
NETWORK_API gboolean network_mysqld_com_query_result_is_local_infile(network_mysqld_com_query_result_t *udata);
 
66
NETWORK_API int network_mysqld_com_query_result_track_state(network_packet *packet, network_mysqld_com_query_result_t *udata);
 
67
NETWORK_API gboolean network_mysqld_com_query_result_is_load_data(network_mysqld_com_query_result_t *udata);
76
68
NETWORK_API int network_mysqld_proto_get_com_query_result(network_packet *packet, network_mysqld_com_query_result_t *udata, gboolean use_binary_row_data);
77
69
 
78
70
/**
108
100
                );
109
101
 
110
102
NETWORK_API int network_mysqld_proto_get_query_result(network_packet *packet, network_mysqld_con *con);
111
 
NETWORK_API int network_mysqld_con_command_states_init(network_mysqld_con *con, network_packet *packet);
112
 
 
113
103
NETWORK_API GList *network_mysqld_proto_get_fielddefs(GList *chunk, GPtrArray *fields);
114
104
 
115
105
typedef struct {
132
122
        GString *sqlstate;
133
123
 
134
124
        guint16 errcode;
135
 
        network_mysqld_protocol_t version;
136
125
} network_mysqld_err_packet_t;
137
126
 
138
127
NETWORK_API network_mysqld_err_packet_t *network_mysqld_err_packet_new(void);
139
 
NETWORK_API network_mysqld_err_packet_t *network_mysqld_err_packet_new_pre41(void);
140
128
NETWORK_API void network_mysqld_err_packet_free(network_mysqld_err_packet_t *udata);
141
129
 
142
130
NETWORK_API int network_mysqld_proto_get_err_packet(network_packet *packet, network_mysqld_err_packet_t *err_packet);