Back to index

php5  5.3.10
mysqlnd_structs.h
Go to the documentation of this file.
00001 /*
00002   +----------------------------------------------------------------------+
00003   | PHP Version 5                                                        |
00004   +----------------------------------------------------------------------+
00005   | Copyright (c) 2006-2012 The PHP Group                                |
00006   +----------------------------------------------------------------------+
00007   | This source file is subject to version 3.01 of the PHP license,      |
00008   | that is bundled with this package in the file LICENSE, and is        |
00009   | available through the world-wide-web at the following url:           |
00010   | http://www.php.net/license/3_01.txt                                  |
00011   | If you did not receive a copy of the PHP license and are unable to   |
00012   | obtain it through the world-wide-web, please send a note to          |
00013   | license@php.net so we can mail you a copy immediately.               |
00014   +----------------------------------------------------------------------+
00015   | Authors: Georg Richter <georg@mysql.com>                             |
00016   |          Andrey Hristov <andrey@mysql.com>                           |
00017   |          Ulf Wendel <uwendel@mysql.com>                              |
00018   +----------------------------------------------------------------------+
00019 */
00020 
00021 /* $Id: mysqlnd_structs.h 321634 2012-01-01 13:15:04Z felipe $ */
00022 
00023 #ifndef MYSQLND_STRUCTS_H
00024 #define MYSQLND_STRUCTS_H
00025 
00026 #define MYSQLND_TYPEDEFED_METHODS
00027 
00028 typedef struct st_mysqlnd_memory_pool MYSQLND_MEMORY_POOL;
00029 typedef struct st_mysqlnd_memory_pool_chunk MYSQLND_MEMORY_POOL_CHUNK;
00030 typedef struct st_mysqlnd_memory_pool_chunk_llist MYSQLND_MEMORY_POOL_CHUNK_LLIST;
00031 
00032 
00033 #define MYSQLND_MEMORY_POOL_CHUNK_LIST_SIZE 100
00034 
00035 struct st_mysqlnd_memory_pool
00036 {
00037        zend_uchar *arena;
00038        unsigned int refcount;
00039        unsigned int arena_size;
00040        unsigned int free_size;
00041 
00042        MYSQLND_MEMORY_POOL_CHUNK*  (*get_chunk)(MYSQLND_MEMORY_POOL * pool, unsigned int size TSRMLS_DC);
00043 };
00044 
00045 struct st_mysqlnd_memory_pool_chunk
00046 {
00047        size_t                      app;
00048        MYSQLND_MEMORY_POOL  *pool;
00049        zend_uchar                  *ptr;
00050        unsigned int         size;
00051        enum_func_status     (*resize_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int size TSRMLS_DC);
00052        void                        (*free_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk TSRMLS_DC);
00053        zend_bool                   from_pool;
00054 };
00055 
00056 
00057 typedef struct st_mysqlnd_cmd_buffer
00058 {
00059        zend_uchar           *buffer;
00060        size_t               length;
00061 } MYSQLND_CMD_BUFFER;
00062 
00063 
00064 typedef struct st_mysqlnd_field
00065 {
00066        const char *name;                  /* Name of column */
00067        const char *org_name;              /* Original column name, if an alias */
00068        const char *table;                 /* Table of column if column was a field */
00069        const char *org_table;             /* Org table name, if table was an alias */
00070        const char *db;                           /* Database for table */
00071        const char *catalog;        /* Catalog for table */
00072        char *def;                                /* Default value (set by mysql_list_fields) */
00073        unsigned long length;              /* Width of column (create length) */
00074        unsigned long max_length;   /* Max width for selected set */
00075        unsigned int name_length;
00076        unsigned int org_name_length;
00077        unsigned int table_length;
00078        unsigned int org_table_length;
00079        unsigned int db_length;
00080        unsigned int catalog_length;
00081        unsigned int def_length;
00082        unsigned int flags;                /* Diverse flags */
00083        unsigned int decimals;             /* Number of decimals in field */
00084        unsigned int charsetnr;            /* Character set */
00085        enum mysqlnd_field_types type;     /* Type of field. See mysql_com.h for types */
00086        char *root;
00087        size_t root_len;
00088 } MYSQLND_FIELD;
00089 
00090 
00091 typedef struct st_mysqlnd_upsert_result
00092 {
00093        unsigned int  warning_count;
00094        unsigned int  server_status;
00095        uint64_t             affected_rows;
00096        uint64_t             last_insert_id;
00097 } MYSQLND_UPSERT_STATUS;
00098 
00099 
00100 typedef struct st_mysqlnd_error_info
00101 {
00102        char error[MYSQLND_ERRMSG_SIZE+1];
00103        char sqlstate[MYSQLND_SQLSTATE_LENGTH + 1];
00104        unsigned int error_no;
00105 } MYSQLND_ERROR_INFO;
00106 
00107 
00108 typedef struct st_mysqlnd_infile_info
00109 {
00110        php_stream    *fd;
00111        int                  error_no;
00112        char          error_msg[MYSQLND_ERRMSG_SIZE + 1];
00113        const char    *filename;
00114 } MYSQLND_INFILE_INFO;
00115 
00116 
00117 /* character set information */
00118 typedef struct st_mysqlnd_charset
00119 {
00120        unsigned int  nr;
00121        const char           *name;
00122        const char           *collation;
00123        unsigned int  char_minlen;
00124        unsigned int  char_maxlen;
00125        const char           *comment;
00126        unsigned int  (*mb_charlen)(unsigned int c);
00127        unsigned int  (*mb_valid)(const char *start, const char *end);
00128 } MYSQLND_CHARSET;
00129 
00130 
00131 /* local infile handler */
00132 typedef struct st_mysqlnd_infile
00133 {
00134        int           (*local_infile_init)(void **ptr, char *filename, void **userdata TSRMLS_DC);
00135        int           (*local_infile_read)(void *ptr, char *buf, unsigned int buf_len TSRMLS_DC);
00136        int           (*local_infile_error)(void *ptr, char *error_msg, unsigned int error_msg_len TSRMLS_DC);
00137        void   (*local_infile_end)(void *ptr TSRMLS_DC);
00138        zval   *callback;
00139        void   *userdata;
00140 } MYSQLND_INFILE;
00141 
00142 typedef struct st_mysqlnd_options
00143 {
00144        ulong         flags;
00145 
00146        /* init commands - we need to send them to server directly after connect */
00147        unsigned int  num_commands;
00148        char                 **init_commands;
00149 
00150        /* configuration file information */
00151        char          *cfg_file;
00152        char          *cfg_section;
00153 
00154        /*
00155          We need to keep these because otherwise st_mysqlnd_conn will be changed.
00156          The ABI will be broken and the methods structure will be somewhere else
00157          in the memory which can crash external code. Feel free to reuse these.
00158        */
00159        char          * unused1;
00160        char          * unused2;
00161        char          * unused3;
00162        char          * unused4;
00163        char          * unused5;
00164 
00165        enum_mysqlnd_protocol_type protocol;
00166 
00167        char          *charset_name;
00168        /* maximum allowed packet size for communication */
00169        ulong         max_allowed_packet;
00170 
00171        zend_bool     numeric_and_datetime_as_unicode;
00172 #ifdef MYSQLND_STRING_TO_INT_CONVERSION
00173        zend_bool     int_and_float_native;
00174 #endif
00175 } MYSQLND_OPTIONS;
00176 
00177 typedef struct st_mysqlnd_net_options
00178 {
00179        /* timeouts */
00180        unsigned int timeout_connect;
00181        unsigned int timeout_read;
00182        unsigned int timeout_write;
00183 
00184        unsigned int net_read_buffer_size;
00185 
00186        /* SSL information */
00187        char          *ssl_key;
00188        char          *ssl_cert;
00189        char          *ssl_ca;
00190        char          *ssl_capath;
00191        char          *ssl_cipher;
00192        char          *ssl_passphrase;
00193        zend_bool     ssl_verify_peer;
00194        uint64_t      flags;
00195 } MYSQLND_NET_OPTIONS;
00196 
00197 
00198 typedef struct st_mysqlnd_connection MYSQLND;
00199 typedef struct st_mysqlnd_net      MYSQLND_NET;
00200 typedef struct st_mysqlnd_protocol MYSQLND_PROTOCOL;
00201 typedef struct st_mysqlnd_res      MYSQLND_RES;
00202 typedef char**                                   MYSQLND_ROW_C;              /* return data as array of strings */
00203 typedef struct st_mysqlnd_stmt_data       MYSQLND_STMT_DATA;
00204 typedef struct st_mysqlnd_stmt     MYSQLND_STMT;
00205 typedef unsigned int               MYSQLND_FIELD_OFFSET;
00206 
00207 typedef struct st_mysqlnd_param_bind MYSQLND_PARAM_BIND;
00208 
00209 typedef struct st_mysqlnd_result_bind MYSQLND_RESULT_BIND;
00210 
00211 typedef struct st_mysqlnd_result_metadata MYSQLND_RES_METADATA;
00212 typedef struct st_mysqlnd_buffered_result MYSQLND_RES_BUFFERED;
00213 typedef struct st_mysqlnd_unbuffered_result MYSQLND_RES_UNBUFFERED;
00214 
00215 typedef struct st_mysqlnd_debug MYSQLND_DEBUG;
00216 
00217 
00218 typedef MYSQLND_RES* (*mysqlnd_stmt_use_or_store_func)(MYSQLND_STMT * const TSRMLS_DC);
00219 typedef enum_func_status  (*mysqlnd_fetch_row_func)(MYSQLND_RES *result,
00220                                                                                            void *param,
00221                                                                                            unsigned int flags,
00222                                                                                            zend_bool *fetched_anything
00223                                                                                            TSRMLS_DC);
00224 
00225 typedef struct st_mysqlnd_stats MYSQLND_STATS;
00226 
00227 typedef void (*mysqlnd_stat_trigger)(MYSQLND_STATS * stats, enum_mysqlnd_collected_stats stat, int64_t change TSRMLS_DC);
00228 
00229 struct st_mysqlnd_stats
00230 {
00231        uint64_t                           *values;
00232        mysqlnd_stat_trigger *triggers;
00233        size_t                             count;
00234        zend_bool                          in_trigger;
00235 #ifdef ZTS
00236        MUTEX_T       LOCK_access;
00237 #endif
00238 };
00239 
00240 
00241 typedef struct st_mysqlnd_read_buffer {
00242        zend_uchar    * data;
00243        size_t               offset;
00244        size_t               size;
00245        size_t        len;
00246        zend_bool     (*is_empty)(struct st_mysqlnd_read_buffer *);
00247        void          (*read)(struct st_mysqlnd_read_buffer *, size_t count, zend_uchar * dest);
00248        size_t        (*bytes_left)(struct st_mysqlnd_read_buffer *);
00249        void          (*free_buffer)(struct st_mysqlnd_read_buffer ** TSRMLS_DC);
00250 } MYSQLND_READ_BUFFER;
00251 
00252 
00253 
00254 typedef enum_func_status    (*func_mysqlnd_net__connect)(MYSQLND_NET * net, const char * const scheme, size_t scheme_len, zend_bool persistent, char **errstr, int * errcode TSRMLS_DC);
00255 typedef size_t                            (*func_mysqlnd_net__send)(MYSQLND * const conn, char * const buf, size_t count TSRMLS_DC);
00256 typedef enum_func_status    (*func_mysqlnd_net__receive)(MYSQLND * conn, zend_uchar * buffer, size_t count TSRMLS_DC);
00257 typedef enum_func_status    (*func_mysqlnd_net__set_client_option)(MYSQLND_NET * const net, enum_mysqlnd_option option, const char * const value TSRMLS_DC);
00258 typedef enum_func_status    (*func_mysqlnd_net__network_read)(MYSQLND * conn, zend_uchar * buffer, size_t count TSRMLS_DC);
00259 typedef size_t                            (*func_mysqlnd_net__network_write)(MYSQLND * const conn, const zend_uchar * const buf, size_t count TSRMLS_DC);
00260 typedef enum_func_status    (*func_mysqlnd_net__decode)(zend_uchar * uncompressed_data, size_t uncompressed_data_len, const zend_uchar * const compressed_data, size_t compressed_data_len TSRMLS_DC);
00261 typedef enum_func_status    (*func_mysqlnd_net__encode)(zend_uchar * compress_buffer, size_t * compress_buffer_len, const zend_uchar * const uncompressed_data, size_t uncompressed_data_len TSRMLS_DC);
00262 typedef size_t                            (*func_mysqlnd_net__consume_uneaten_data)(MYSQLND_NET * const net, enum php_mysqlnd_server_command cmd TSRMLS_DC);
00263 typedef void                       (*func_mysqlnd_net__free_contents)(MYSQLND_NET * net TSRMLS_DC);
00264 typedef enum_func_status    (*func_mysqlnd_net__enable_ssl)(MYSQLND_NET * const net TSRMLS_DC);
00265 typedef enum_func_status    (*func_mysqlnd_net__disable_ssl)(MYSQLND_NET * const net TSRMLS_DC);
00266 
00267 
00268 struct st_mysqlnd_net_methods
00269 {
00270        func_mysqlnd_net__connect connect;
00271        func_mysqlnd_net__send send;
00272        func_mysqlnd_net__receive receive;
00273        func_mysqlnd_net__set_client_option set_client_option;
00274        func_mysqlnd_net__network_read network_read;
00275        func_mysqlnd_net__network_write network_write;
00276        func_mysqlnd_net__decode decode;
00277        func_mysqlnd_net__encode encode;
00278        func_mysqlnd_net__consume_uneaten_data consume_uneaten_data;
00279        func_mysqlnd_net__free_contents free_contents;
00280        func_mysqlnd_net__enable_ssl enable_ssl;
00281        func_mysqlnd_net__disable_ssl disable_ssl;
00282 
00283        void * unused1;
00284        void * unused2;
00285        void * unused3;
00286        void * unused4;
00287        void * unused5;
00288 };
00289 
00290 
00291 struct st_mysqlnd_packet_greet;
00292 struct st_mysqlnd_packet_greet;
00293 struct st_mysqlnd_packet_auth;
00294 struct st_mysqlnd_packet_ok;
00295 struct st_mysqlnd_packet_command;
00296 struct st_mysqlnd_packet_eof;
00297 struct st_mysqlnd_packet_rset_header;
00298 struct st_mysqlnd_packet_res_field;
00299 struct st_mysqlnd_packet_row;
00300 struct st_mysqlnd_packet_stats;
00301 struct st_mysqlnd_packet_prepare_response;
00302 struct st_mysqlnd_packet_chg_user_resp;
00303 
00304 typedef struct st_mysqlnd_packet_greet *         (*func_mysqlnd_protocol__get_greet_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
00305 typedef struct st_mysqlnd_packet_auth *                 (*func_mysqlnd_protocol__get_auth_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
00306 typedef struct st_mysqlnd_packet_ok *                   (*func_mysqlnd_protocol__get_ok_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
00307 typedef struct st_mysqlnd_packet_command *              (*func_mysqlnd_protocol__get_command_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
00308 typedef struct st_mysqlnd_packet_eof *                  (*func_mysqlnd_protocol__get_eof_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
00309 typedef struct st_mysqlnd_packet_rset_header *   (*func_mysqlnd_protocol__get_rset_header_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
00310 typedef struct st_mysqlnd_packet_res_field *     (*func_mysqlnd_protocol__get_result_field_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
00311 typedef struct st_mysqlnd_packet_row *                  (*func_mysqlnd_protocol__get_row_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
00312 typedef struct st_mysqlnd_packet_stats *         (*func_mysqlnd_protocol__get_stats_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
00313 typedef struct st_mysqlnd_packet_prepare_response *(*func_mysqlnd_protocol__get_prepare_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
00314 typedef struct st_mysqlnd_packet_chg_user_resp*(*func_mysqlnd_protocol__get_change_user_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
00315 
00316 struct st_mysqlnd_protocol_methods
00317 {
00318        func_mysqlnd_protocol__get_greet_packet get_greet_packet;
00319        func_mysqlnd_protocol__get_auth_packet get_auth_packet;
00320        func_mysqlnd_protocol__get_ok_packet get_ok_packet;
00321        func_mysqlnd_protocol__get_command_packet get_command_packet;
00322        func_mysqlnd_protocol__get_eof_packet get_eof_packet;
00323        func_mysqlnd_protocol__get_rset_header_packet get_rset_header_packet;
00324        func_mysqlnd_protocol__get_result_field_packet get_result_field_packet;
00325        func_mysqlnd_protocol__get_row_packet get_row_packet;
00326        func_mysqlnd_protocol__get_stats_packet get_stats_packet;
00327        func_mysqlnd_protocol__get_prepare_response_packet get_prepare_response_packet;
00328        func_mysqlnd_protocol__get_change_user_response_packet get_change_user_response_packet;
00329 
00330        void * unused1;
00331        void * unused2;
00332        void * unused3;
00333        void * unused4;
00334        void * unused5;
00335 };
00336 
00337 
00338 
00339 typedef enum_func_status    (*func_mysqlnd_conn__init)(MYSQLND * conn TSRMLS_DC);
00340 typedef enum_func_status    (*func_mysqlnd_conn__connect)(MYSQLND *conn, const char *host, const char * user, const char * passwd, unsigned int passwd_len, const char * db, unsigned int db_len, unsigned int port, const char * socket_or_pipe, unsigned int mysql_flags TSRMLS_DC);
00341 typedef ulong                      (*func_mysqlnd_conn__escape_string)(MYSQLND * const conn, char *newstr, const char *escapestr, size_t escapestr_len TSRMLS_DC);
00342 typedef enum_func_status    (*func_mysqlnd_conn__set_charset)(MYSQLND * const conn, const char * const charset TSRMLS_DC);
00343 typedef enum_func_status    (*func_mysqlnd_conn__query)(MYSQLND *conn, const char *query, unsigned int query_len TSRMLS_DC);
00344 typedef enum_func_status    (*func_mysqlnd_conn__send_query)(MYSQLND *conn, const char *query, unsigned int query_len TSRMLS_DC);
00345 typedef enum_func_status    (*func_mysqlnd_conn__reap_query)(MYSQLND *conn TSRMLS_DC);
00346 typedef MYSQLND_RES *              (*func_mysqlnd_conn__use_result)(MYSQLND * const conn TSRMLS_DC);
00347 typedef MYSQLND_RES *              (*func_mysqlnd_conn__store_result)(MYSQLND * const conn TSRMLS_DC);
00348 typedef enum_func_status    (*func_mysqlnd_conn__next_result)(MYSQLND * const conn TSRMLS_DC);
00349 typedef zend_bool                  (*func_mysqlnd_conn__more_results)(const MYSQLND * const conn TSRMLS_DC);
00350 
00351 typedef MYSQLND_STMT *             (*func_mysqlnd_conn__stmt_init)(MYSQLND * const conn TSRMLS_DC);
00352 
00353 typedef enum_func_status    (*func_mysqlnd_conn__shutdown_server)(MYSQLND * const conn, uint8_t level TSRMLS_DC);
00354 typedef enum_func_status    (*func_mysqlnd_conn__refresh_server)(MYSQLND * const conn, uint8_t options TSRMLS_DC);
00355 
00356 typedef enum_func_status    (*func_mysqlnd_conn__ping)(MYSQLND * const conn TSRMLS_DC);
00357 typedef enum_func_status    (*func_mysqlnd_conn__kill_connection)(MYSQLND *conn, unsigned int pid TSRMLS_DC);
00358 typedef enum_func_status    (*func_mysqlnd_conn__select_db)(MYSQLND * const conn, const char * const db, unsigned int db_len TSRMLS_DC);
00359 typedef enum_func_status    (*func_mysqlnd_conn__server_dump_debug_information)(MYSQLND * const conn TSRMLS_DC);
00360 typedef enum_func_status    (*func_mysqlnd_conn__change_user)(MYSQLND * const conn, const char * user, const char * passwd, const char * db, zend_bool silent TSRMLS_DC);
00361 
00362 typedef unsigned int        (*func_mysqlnd_conn__get_error_no)(const MYSQLND * const conn TSRMLS_DC);
00363 typedef const char *        (*func_mysqlnd_conn__get_error_str)(const MYSQLND * const conn TSRMLS_DC);
00364 typedef const char *        (*func_mysqlnd_conn__get_sqlstate)(const MYSQLND * const conn TSRMLS_DC);
00365 typedef uint64_t                   (*func_mysqlnd_conn__get_thread_id)(const MYSQLND * const conn TSRMLS_DC);
00366 typedef void                       (*func_mysqlnd_conn__get_statistics)(const MYSQLND * const conn, zval *return_value TSRMLS_DC ZEND_FILE_LINE_DC);
00367 
00368 typedef unsigned long              (*func_mysqlnd_conn__get_server_version)(const MYSQLND * const conn TSRMLS_DC);
00369 typedef const char *        (*func_mysqlnd_conn__get_server_information)(const MYSQLND * const conn TSRMLS_DC);
00370 typedef enum_func_status    (*func_mysqlnd_conn__get_server_statistics)(MYSQLND *conn, char **message, unsigned int * message_len TSRMLS_DC);
00371 typedef const char *        (*func_mysqlnd_conn__get_host_information)(const MYSQLND * const conn TSRMLS_DC);
00372 typedef unsigned int        (*func_mysqlnd_conn__get_protocol_information)(const MYSQLND * const conn TSRMLS_DC);
00373 typedef const char *        (*func_mysqlnd_conn__get_last_message)(const MYSQLND * const conn TSRMLS_DC);
00374 typedef const char *        (*func_mysqlnd_conn__charset_name)(const MYSQLND * const conn TSRMLS_DC);
00375 typedef MYSQLND_RES *              (*func_mysqlnd_conn__list_fields)(MYSQLND *conn, const char *table, const char *achtung_wild TSRMLS_DC);
00376 typedef MYSQLND_RES *              (*func_mysqlnd_conn__list_method)(MYSQLND *conn, const char *query, const char *achtung_wild, char *par1 TSRMLS_DC);
00377 
00378 typedef uint64_t                   (*func_mysqlnd_conn__get_last_insert_id)(const MYSQLND * const conn TSRMLS_DC);
00379 typedef uint64_t                   (*func_mysqlnd_conn__get_affected_rows)(const MYSQLND * const conn TSRMLS_DC);
00380 typedef unsigned int        (*func_mysqlnd_conn__get_warning_count)(const MYSQLND * const conn TSRMLS_DC);
00381 
00382 typedef unsigned int        (*func_mysqlnd_conn__get_field_count)(const MYSQLND * const conn TSRMLS_DC);
00383 
00384 typedef enum_func_status    (*func_mysqlnd_conn__set_server_option)(MYSQLND * const conn, enum_mysqlnd_server_option option TSRMLS_DC);
00385 typedef enum_func_status    (*func_mysqlnd_conn__set_client_option)(MYSQLND * const conn, enum_mysqlnd_option option, const char * const value TSRMLS_DC);
00386 typedef void                       (*func_mysqlnd_conn__free_contents)(MYSQLND *conn TSRMLS_DC);  /* private */
00387 typedef void                       (*func_mysqlnd_conn__free_options)(MYSQLND * conn TSRMLS_DC);  /* private */
00388 typedef enum_func_status    (*func_mysqlnd_conn__close)(MYSQLND *conn, enum_connection_close_type close_type TSRMLS_DC);
00389 typedef void                       (*func_mysqlnd_conn__dtor)(MYSQLND *conn TSRMLS_DC);    /* private */
00390 
00391 typedef enum_func_status    (*func_mysqlnd_conn__query_read_result_set_header)(MYSQLND *conn, MYSQLND_STMT *stmt TSRMLS_DC);
00392 
00393 typedef MYSQLND *                  (*func_mysqlnd_conn__get_reference)(MYSQLND * const conn TSRMLS_DC);
00394 typedef enum_func_status    (*func_mysqlnd_conn__free_reference)(MYSQLND * const conn TSRMLS_DC);
00395 typedef enum mysqlnd_connection_state (*func_mysqlnd_conn__get_state)(MYSQLND * const conn TSRMLS_DC);
00396 typedef void                       (*func_mysqlnd_conn__set_state)(MYSQLND * const conn, enum mysqlnd_connection_state new_state TSRMLS_DC);
00397 
00398 typedef enum_func_status    (*func_mysqlnd_conn__simple_command)(MYSQLND *conn, enum php_mysqlnd_server_command command, const char * const arg, size_t arg_len, enum mysqlnd_packet_type ok_packet, zend_bool silent, zend_bool ignore_upsert_status TSRMLS_DC);
00399 typedef enum_func_status    (*func_mysqlnd_conn__simple_command_handle_response)(MYSQLND *conn, enum mysqlnd_packet_type ok_packet, zend_bool silent, enum php_mysqlnd_server_command command, zend_bool ignore_upsert_status TSRMLS_DC);
00400 
00401 typedef enum_func_status    (*func_mysqlnd_conn__restart_psession)(MYSQLND *conn TSRMLS_DC);
00402 typedef enum_func_status    (*func_mysqlnd_conn__end_psession)(MYSQLND *conn TSRMLS_DC);
00403 typedef enum_func_status    (*func_mysqlnd_conn__send_close)(MYSQLND * conn TSRMLS_DC);
00404 
00405 typedef enum_func_status    (*func_mysqlnd_conn__ssl_set)(MYSQLND * const conn, const char * key, const char * const cert, const char * const ca, const char * const capath, const char * const cipher TSRMLS_DC);
00406 
00407 typedef MYSQLND_RES *              (*func_mysqlnd_conn__result_init)(unsigned int field_count, zend_bool persistent TSRMLS_DC);
00408 
00409 typedef enum_func_status    (*func_mysqlnd_conn__set_autocommit)(MYSQLND * conn, unsigned int mode TSRMLS_DC);
00410 typedef enum_func_status    (*func_mysqlnd_conn__tx_commit)(MYSQLND * conn TSRMLS_DC);
00411 typedef enum_func_status    (*func_mysqlnd_conn__tx_rollback)(MYSQLND * conn TSRMLS_DC);
00412 
00413 
00414 struct st_mysqlnd_conn_methods
00415 {
00416        func_mysqlnd_conn__init init;
00417        func_mysqlnd_conn__connect connect;
00418        func_mysqlnd_conn__escape_string escape_string;
00419        func_mysqlnd_conn__set_charset set_charset;
00420        func_mysqlnd_conn__query query;
00421        func_mysqlnd_conn__send_query send_query;
00422        func_mysqlnd_conn__reap_query reap_query;
00423        func_mysqlnd_conn__use_result use_result;
00424        func_mysqlnd_conn__store_result store_result;
00425        func_mysqlnd_conn__next_result next_result;
00426        func_mysqlnd_conn__more_results more_results;
00427 
00428        func_mysqlnd_conn__stmt_init stmt_init;
00429 
00430        func_mysqlnd_conn__shutdown_server shutdown_server;
00431        func_mysqlnd_conn__refresh_server refresh_server;
00432 
00433        func_mysqlnd_conn__ping ping;
00434        func_mysqlnd_conn__kill_connection kill_connection;
00435        func_mysqlnd_conn__select_db select_db;
00436        func_mysqlnd_conn__server_dump_debug_information server_dump_debug_information;
00437        func_mysqlnd_conn__change_user change_user;
00438 
00439        func_mysqlnd_conn__get_error_no get_error_no;
00440        func_mysqlnd_conn__get_error_str get_error_str;
00441        func_mysqlnd_conn__get_sqlstate get_sqlstate;
00442        func_mysqlnd_conn__get_thread_id get_thread_id;
00443        func_mysqlnd_conn__get_statistics get_statistics;
00444 
00445        func_mysqlnd_conn__get_server_version get_server_version;
00446        func_mysqlnd_conn__get_server_information get_server_information;
00447        func_mysqlnd_conn__get_server_statistics get_server_statistics;
00448        func_mysqlnd_conn__get_host_information get_host_information;
00449        func_mysqlnd_conn__get_protocol_information get_protocol_information;
00450        func_mysqlnd_conn__get_last_message get_last_message;
00451        func_mysqlnd_conn__charset_name charset_name;
00452        func_mysqlnd_conn__list_fields list_fields;
00453        func_mysqlnd_conn__list_method list_method;
00454 
00455        func_mysqlnd_conn__get_last_insert_id get_last_insert_id;
00456        func_mysqlnd_conn__get_affected_rows get_affected_rows;
00457        func_mysqlnd_conn__get_warning_count get_warning_count;
00458 
00459        func_mysqlnd_conn__get_field_count get_field_count;
00460 
00461        func_mysqlnd_conn__set_server_option set_server_option;
00462        func_mysqlnd_conn__set_client_option set_client_option;
00463        func_mysqlnd_conn__free_contents free_contents;
00464        func_mysqlnd_conn__free_options free_options;
00465        func_mysqlnd_conn__close close;
00466        func_mysqlnd_conn__dtor dtor;
00467 
00468        func_mysqlnd_conn__query_read_result_set_header query_read_result_set_header;
00469 
00470        func_mysqlnd_conn__get_reference get_reference;
00471        func_mysqlnd_conn__free_reference free_reference;
00472        func_mysqlnd_conn__get_state get_state;
00473        func_mysqlnd_conn__set_state set_state;
00474 
00475        func_mysqlnd_conn__simple_command simple_command;
00476        func_mysqlnd_conn__simple_command_handle_response simple_command_handle_response;
00477 
00478        func_mysqlnd_conn__restart_psession restart_psession;
00479        func_mysqlnd_conn__end_psession end_psession;
00480        func_mysqlnd_conn__send_close send_close;
00481 
00482        func_mysqlnd_conn__ssl_set ssl_set;
00483 
00484        func_mysqlnd_conn__result_init result_init;
00485 #ifdef AUTOCOMMIT_TX_COMMIT_ROLLBACK
00486        func_mysqlnd_conn__set_autocommit set_autocommit;
00487        func_mysqlnd_conn__tx_commit tx_commit;
00488        func_mysqlnd_conn__tx_rollback tx_rollback;
00489 #endif
00490 };
00491 
00492 
00493 
00494 
00495 typedef mysqlnd_fetch_row_func     fetch_row;
00496 typedef mysqlnd_fetch_row_func     fetch_row_normal_buffered; /* private */
00497 typedef mysqlnd_fetch_row_func     fetch_row_normal_unbuffered; /* private */
00498 
00499 typedef MYSQLND_RES *              (*func_mysqlnd_res__use_result)(MYSQLND_RES * const result, zend_bool ps_protocol TSRMLS_DC);
00500 typedef MYSQLND_RES *              (*func_mysqlnd_res__store_result)(MYSQLND_RES * result, MYSQLND * const conn, zend_bool ps TSRMLS_DC);
00501 typedef void                       (*func_mysqlnd_res__fetch_into)(MYSQLND_RES *result, unsigned int flags, zval *return_value, enum_mysqlnd_extension ext TSRMLS_DC ZEND_FILE_LINE_DC);
00502 typedef MYSQLND_ROW_C              (*func_mysqlnd_res__fetch_row_c)(MYSQLND_RES *result TSRMLS_DC);
00503 typedef void                       (*func_mysqlnd_res__fetch_all)(MYSQLND_RES *result, unsigned int flags, zval *return_value TSRMLS_DC ZEND_FILE_LINE_DC);
00504 typedef void                       (*func_mysqlnd_res__fetch_field_data)(MYSQLND_RES *result, unsigned int offset, zval *return_value TSRMLS_DC);
00505 typedef uint64_t                   (*func_mysqlnd_res__num_rows)(const MYSQLND_RES * const result TSRMLS_DC);
00506 typedef unsigned int        (*func_mysqlnd_res__num_fields)(const MYSQLND_RES * const result TSRMLS_DC);
00507 typedef enum_func_status    (*func_mysqlnd_res__skip_result)(MYSQLND_RES * const result TSRMLS_DC);
00508 typedef enum_func_status    (*func_mysqlnd_res__seek_data)(MYSQLND_RES * result, uint64_t row TSRMLS_DC);
00509 typedef MYSQLND_FIELD_OFFSET (*func_mysqlnd_res__seek_field)(MYSQLND_RES * const result, MYSQLND_FIELD_OFFSET field_offset TSRMLS_DC);
00510 typedef MYSQLND_FIELD_OFFSET (*func_mysqlnd_res__field_tell)(const MYSQLND_RES * const result TSRMLS_DC);
00511 typedef const MYSQLND_FIELD *(*func_mysqlnd_res__fetch_field)(MYSQLND_RES * const result TSRMLS_DC);
00512 typedef const MYSQLND_FIELD *(*func_mysqlnd_res__fetch_field_direct)(MYSQLND_RES * const result, MYSQLND_FIELD_OFFSET fieldnr TSRMLS_DC);
00513 typedef const MYSQLND_FIELD *(*func_mysqlnd_res__fetch_fields)(MYSQLND_RES * const result TSRMLS_DC);
00514 
00515 typedef enum_func_status    (*func_mysqlnd_res__read_result_metadata)(MYSQLND_RES *result, MYSQLND * conn TSRMLS_DC);
00516 typedef unsigned long *            (*func_mysqlnd_res__fetch_lengths)(MYSQLND_RES * const result TSRMLS_DC);
00517 typedef enum_func_status    (*func_mysqlnd_res__store_result_fetch_data)(MYSQLND * const conn, MYSQLND_RES *result, MYSQLND_RES_METADATA *meta, zend_bool binary_protocol, zend_bool to_cache TSRMLS_DC);
00518 typedef enum_func_status    (*func_mysqlnd_res__initialize_result_set_rest)(MYSQLND_RES * const result TSRMLS_DC);
00519 
00520 typedef void                       (*func_mysqlnd_res__free_result_buffers)(MYSQLND_RES * result TSRMLS_DC);    /* private */
00521 typedef enum_func_status    (*func_mysqlnd_res__free_result)(MYSQLND_RES * result, zend_bool implicit TSRMLS_DC);
00522 typedef void                       (*func_mysqlnd_res__free_result_internal)(MYSQLND_RES *result TSRMLS_DC);
00523 typedef void                       (*func_mysqlnd_res__free_result_contents)(MYSQLND_RES *result TSRMLS_DC);
00524 typedef void                       (*func_mysqlnd_res__free_buffered_data)(MYSQLND_RES *result TSRMLS_DC);
00525 typedef void                       (*func_mysqlnd_res__unbuffered_free_last_data)(MYSQLND_RES *result TSRMLS_DC);
00526 
00527        /* for decoding - binary or text protocol */
00528 typedef enum_func_status    (*func_mysqlnd_res__row_decoder)(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval ** fields,
00529                                                                unsigned int field_count, MYSQLND_FIELD *fields_metadata,
00530                                                                zend_bool persistent,
00531                                                                zend_bool as_unicode, zend_bool as_int_or_float,
00532                                                                MYSQLND_STATS * stats TSRMLS_DC);
00533 
00534 typedef MYSQLND_RES_METADATA * (*func_mysqlnd_res__result_meta_init)(unsigned int field_count, zend_bool persistent TSRMLS_DC);
00535 
00536 struct st_mysqlnd_res_methods
00537 {
00538        mysqlnd_fetch_row_func      fetch_row;
00539        mysqlnd_fetch_row_func      fetch_row_normal_buffered; /* private */
00540        mysqlnd_fetch_row_func      fetch_row_normal_unbuffered; /* private */
00541 
00542        func_mysqlnd_res__use_result use_result;
00543        func_mysqlnd_res__store_result store_result;
00544        func_mysqlnd_res__fetch_into fetch_into;
00545        func_mysqlnd_res__fetch_row_c fetch_row_c;
00546        func_mysqlnd_res__fetch_all fetch_all;
00547        func_mysqlnd_res__fetch_field_data fetch_field_data;
00548        func_mysqlnd_res__num_rows num_rows;
00549        func_mysqlnd_res__num_fields num_fields;
00550        func_mysqlnd_res__skip_result skip_result;
00551        func_mysqlnd_res__seek_data seek_data;
00552        func_mysqlnd_res__seek_field seek_field;
00553        func_mysqlnd_res__field_tell field_tell;
00554        func_mysqlnd_res__fetch_field fetch_field;
00555        func_mysqlnd_res__fetch_field_direct fetch_field_direct;
00556        func_mysqlnd_res__fetch_fields fetch_fields;
00557        func_mysqlnd_res__read_result_metadata read_result_metadata;
00558        func_mysqlnd_res__fetch_lengths fetch_lengths;
00559        func_mysqlnd_res__store_result_fetch_data store_result_fetch_data;
00560        func_mysqlnd_res__initialize_result_set_rest initialize_result_set_rest;
00561        func_mysqlnd_res__free_result_buffers free_result_buffers;
00562        func_mysqlnd_res__free_result free_result;
00563        func_mysqlnd_res__free_result_internal free_result_internal;
00564        func_mysqlnd_res__free_result_contents free_result_contents;
00565        func_mysqlnd_res__free_buffered_data free_buffered_data;
00566        func_mysqlnd_res__unbuffered_free_last_data unbuffered_free_last_data;
00567 
00568        /* for decoding - binary or text protocol */
00569        func_mysqlnd_res__row_decoder row_decoder;
00570 
00571        func_mysqlnd_res__result_meta_init result_meta_init;
00572 
00573        void * unused1;
00574        void * unused2;
00575        void * unused3;
00576        void * unused4;
00577        void * unused5;
00578 };
00579 
00580 
00581 typedef const MYSQLND_FIELD *      (*func_mysqlnd_res_meta__fetch_field)(MYSQLND_RES_METADATA * const meta TSRMLS_DC);
00582 typedef const MYSQLND_FIELD *      (*func_mysqlnd_res_meta__fetch_field_direct)(const MYSQLND_RES_METADATA * const meta, MYSQLND_FIELD_OFFSET fieldnr TSRMLS_DC);
00583 typedef const MYSQLND_FIELD *      (*func_mysqlnd_res_meta__fetch_fields)(MYSQLND_RES_METADATA * const meta TSRMLS_DC);
00584 typedef MYSQLND_FIELD_OFFSET       (*func_mysqlnd_res_meta__field_tell)(const MYSQLND_RES_METADATA * const meta TSRMLS_DC);
00585 typedef enum_func_status           (*func_mysqlnd_res_meta__read_metadata)(MYSQLND_RES_METADATA * const meta, MYSQLND * conn TSRMLS_DC);
00586 typedef MYSQLND_RES_METADATA *     (*func_mysqlnd_res_meta__clone_metadata)(const MYSQLND_RES_METADATA * const meta, zend_bool persistent TSRMLS_DC);
00587 typedef void                              (*func_mysqlnd_res_meta__free_metadata)(MYSQLND_RES_METADATA * meta TSRMLS_DC);
00588 
00589 struct st_mysqlnd_res_meta_methods
00590 {
00591        func_mysqlnd_res_meta__fetch_field fetch_field;
00592        func_mysqlnd_res_meta__fetch_field_direct fetch_field_direct;
00593        func_mysqlnd_res_meta__fetch_fields fetch_fields;
00594        func_mysqlnd_res_meta__field_tell field_tell;
00595        func_mysqlnd_res_meta__read_metadata read_metadata;
00596        func_mysqlnd_res_meta__clone_metadata clone_metadata;
00597        func_mysqlnd_res_meta__free_metadata free_metadata;
00598 };
00599 
00600 
00601 typedef enum_func_status    (*func_mysqlnd_stmt__prepare)(MYSQLND_STMT * const stmt, const char * const query, unsigned int query_len TSRMLS_DC);
00602 typedef enum_func_status    (*func_mysqlnd_stmt__execute)(MYSQLND_STMT * const stmt TSRMLS_DC);
00603 typedef MYSQLND_RES *              (*func_mysqlnd_stmt__use_result)(MYSQLND_STMT * const stmt TSRMLS_DC);
00604 typedef MYSQLND_RES *              (*func_mysqlnd_stmt__store_result)(MYSQLND_STMT * const stmt TSRMLS_DC);
00605 typedef MYSQLND_RES *              (*func_mysqlnd_stmt__get_result)(MYSQLND_STMT * const stmt TSRMLS_DC);
00606 typedef zend_bool                  (*func_mysqlnd_stmt__more_results)(const MYSQLND_STMT * const stmt TSRMLS_DC);
00607 typedef enum_func_status    (*func_mysqlnd_stmt__next_result)(MYSQLND_STMT * const stmt TSRMLS_DC);
00608 typedef enum_func_status    (*func_mysqlnd_stmt__free_result)(MYSQLND_STMT * const stmt TSRMLS_DC);
00609 typedef enum_func_status    (*func_mysqlnd_stmt__seek_data)(const MYSQLND_STMT * const stmt, uint64_t row TSRMLS_DC);
00610 typedef enum_func_status    (*func_mysqlnd_stmt__reset)(MYSQLND_STMT * const stmt TSRMLS_DC);
00611 typedef enum_func_status    (*func_mysqlnd_stmt__net_close)(MYSQLND_STMT * const stmt, zend_bool implicit TSRMLS_DC); /* private */
00612 typedef enum_func_status    (*func_mysqlnd_stmt__dtor)(MYSQLND_STMT * const stmt, zend_bool implicit TSRMLS_DC); /* use this for mysqlnd_stmt_close */
00613 typedef enum_func_status    (*func_mysqlnd_stmt__fetch)(MYSQLND_STMT * const stmt, zend_bool * const fetched_anything TSRMLS_DC);
00614 typedef enum_func_status    (*func_mysqlnd_stmt__bind_parameters)(MYSQLND_STMT * const stmt, MYSQLND_PARAM_BIND * const param_bind TSRMLS_DC);
00615 typedef enum_func_status    (*func_mysqlnd_stmt__bind_one_parameter)(MYSQLND_STMT * const stmt, unsigned int param_no, zval * const zv, zend_uchar type TSRMLS_DC);
00616 typedef enum_func_status    (*func_mysqlnd_stmt__refresh_bind_param)(MYSQLND_STMT * const stmt TSRMLS_DC);
00617 typedef enum_func_status    (*func_mysqlnd_stmt__bind_result)(MYSQLND_STMT * const stmt, MYSQLND_RESULT_BIND * const result_bind TSRMLS_DC);
00618 typedef enum_func_status    (*func_mysqlnd_stmt__bind_one_result)(MYSQLND_STMT * const stmt, unsigned int param_no TSRMLS_DC);
00619 typedef enum_func_status    (*func_mysqlnd_stmt__send_long_data)(MYSQLND_STMT * const stmt, unsigned int param_num, const char * const data, unsigned long length TSRMLS_DC);
00620 typedef MYSQLND_RES *              (*func_mysqlnd_stmt__get_parameter_metadata)(MYSQLND_STMT * const stmt TSRMLS_DC);
00621 typedef MYSQLND_RES *              (*func_mysqlnd_stmt__get_result_metadata)(MYSQLND_STMT * const stmt TSRMLS_DC);
00622 typedef uint64_t                   (*func_mysqlnd_stmt__get_last_insert_id)(const MYSQLND_STMT * const stmt TSRMLS_DC);
00623 typedef uint64_t                   (*func_mysqlnd_stmt__get_affected_rows)(const MYSQLND_STMT * const stmt TSRMLS_DC);
00624 typedef uint64_t                   (*func_mysqlnd_stmt__get_num_rows)(const MYSQLND_STMT * const stmt TSRMLS_DC);
00625 typedef unsigned int        (*func_mysqlnd_stmt__get_param_count)(const MYSQLND_STMT * const stmt TSRMLS_DC);
00626 typedef unsigned int        (*func_mysqlnd_stmt__get_field_count)(const MYSQLND_STMT * const stmt TSRMLS_DC);
00627 typedef unsigned int        (*func_mysqlnd_stmt__get_warning_count)(const MYSQLND_STMT * const stmt TSRMLS_DC);
00628 typedef unsigned int        (*func_mysqlnd_stmt__get_error_no)(const MYSQLND_STMT * const stmt TSRMLS_DC);
00629 typedef const char *        (*func_mysqlnd_stmt__get_error_str)(const MYSQLND_STMT * const stmt TSRMLS_DC);
00630 typedef const char *        (*func_mysqlnd_stmt__get_sqlstate)(const MYSQLND_STMT * const stmt TSRMLS_DC);
00631 typedef enum_func_status    (*func_mysqlnd_stmt__get_attribute)(const MYSQLND_STMT * const stmt, enum mysqlnd_stmt_attr attr_type, void * const value TSRMLS_DC);
00632 typedef enum_func_status    (*func_mysqlnd_stmt__set_attribute)(MYSQLND_STMT * const stmt, enum mysqlnd_stmt_attr attr_type, const void * const value TSRMLS_DC);
00633 typedef MYSQLND_PARAM_BIND *(*func_mysqlnd_stmt__alloc_param_bind)(MYSQLND_STMT * const stmt TSRMLS_DC);
00634 typedef MYSQLND_RESULT_BIND*(*func_mysqlnd_stmt__alloc_result_bind)(MYSQLND_STMT * const stmt TSRMLS_DC);
00635 typedef       void                        (*func_mysqlnd_stmt__free_parameter_bind)(MYSQLND_STMT * const stmt, MYSQLND_PARAM_BIND * TSRMLS_DC);
00636 typedef       void                        (*func_mysqlnd_stmt__free_result_bind)(MYSQLND_STMT * const stmt, MYSQLND_RESULT_BIND * TSRMLS_DC);
00637 typedef unsigned int        (*func_mysqlnd_stmt__server_status)(const MYSQLND_STMT * const stmt TSRMLS_DC);
00638 typedef enum_func_status    (*func_mysqlnd_stmt__generate_execute_request)(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC);
00639 typedef enum_func_status    (*func_mysqlnd_stmt__parse_execute_response)(MYSQLND_STMT * const s TSRMLS_DC);
00640 typedef void                       (*func_mysqlnd_stmt__free_stmt_content)(MYSQLND_STMT * const s TSRMLS_DC);
00641 
00642 struct st_mysqlnd_stmt_methods
00643 {
00644        func_mysqlnd_stmt__prepare prepare;
00645        func_mysqlnd_stmt__execute execute;
00646        func_mysqlnd_stmt__use_result use_result;
00647        func_mysqlnd_stmt__store_result store_result;
00648        func_mysqlnd_stmt__get_result get_result;
00649        func_mysqlnd_stmt__more_results more_results;
00650        func_mysqlnd_stmt__next_result next_result;
00651        func_mysqlnd_stmt__free_result free_result;
00652        func_mysqlnd_stmt__seek_data seek_data;
00653        func_mysqlnd_stmt__reset reset;
00654        func_mysqlnd_stmt__net_close net_close;
00655        func_mysqlnd_stmt__dtor dtor;
00656        func_mysqlnd_stmt__fetch fetch;
00657 
00658        func_mysqlnd_stmt__bind_parameters bind_parameters;
00659        func_mysqlnd_stmt__bind_one_parameter bind_one_parameter;
00660        func_mysqlnd_stmt__refresh_bind_param refresh_bind_param;
00661        func_mysqlnd_stmt__bind_result bind_result;
00662        func_mysqlnd_stmt__bind_one_result bind_one_result;
00663        func_mysqlnd_stmt__send_long_data send_long_data;
00664        func_mysqlnd_stmt__get_parameter_metadata get_parameter_metadata;
00665        func_mysqlnd_stmt__get_result_metadata get_result_metadata;
00666 
00667        func_mysqlnd_stmt__get_last_insert_id get_last_insert_id;
00668        func_mysqlnd_stmt__get_affected_rows get_affected_rows;
00669        func_mysqlnd_stmt__get_num_rows get_num_rows;
00670 
00671        func_mysqlnd_stmt__get_param_count get_param_count;
00672        func_mysqlnd_stmt__get_field_count get_field_count;
00673        func_mysqlnd_stmt__get_warning_count get_warning_count;
00674 
00675        func_mysqlnd_stmt__get_error_no get_error_no;
00676        func_mysqlnd_stmt__get_error_str get_error_str;
00677        func_mysqlnd_stmt__get_sqlstate get_sqlstate;
00678 
00679        func_mysqlnd_stmt__get_attribute get_attribute;
00680        func_mysqlnd_stmt__set_attribute set_attribute;
00681 
00682        func_mysqlnd_stmt__alloc_param_bind alloc_parameter_bind;
00683        func_mysqlnd_stmt__alloc_result_bind alloc_result_bind;
00684 
00685        func_mysqlnd_stmt__free_parameter_bind free_parameter_bind;
00686        func_mysqlnd_stmt__free_result_bind free_result_bind;
00687 
00688        func_mysqlnd_stmt__server_status get_server_status;
00689 
00690        func_mysqlnd_stmt__generate_execute_request generate_execute_request;
00691        func_mysqlnd_stmt__parse_execute_response parse_execute_response;
00692 
00693        func_mysqlnd_stmt__free_stmt_content free_stmt_content;
00694 };
00695 
00696 
00697 struct st_mysqlnd_net
00698 {
00699        php_stream                  *stream;
00700        struct st_mysqlnd_net_methods m;
00701 
00702        /* sequence for simple checking of correct packets */
00703        zend_uchar                  packet_no;
00704        zend_bool                   compressed;
00705        zend_uchar                  compressed_envelope_packet_no;
00706 #ifdef MYSQLND_COMPRESSION_ENABLED
00707        MYSQLND_READ_BUFFER  * uncompressed_data;
00708 #endif
00709 #ifdef MYSQLND_DO_WIRE_CHECK_BEFORE_COMMAND
00710        zend_uchar                  last_command;
00711 #endif
00712        /* cmd buffer */
00713        MYSQLND_CMD_BUFFER   cmd_buffer;
00714 
00715        MYSQLND_NET_OPTIONS  options;
00716 
00717        zend_bool                   persistent;
00718 };
00719 
00720 
00721 struct st_mysqlnd_protocol
00722 {
00723        struct st_mysqlnd_protocol_methods m;
00724        zend_bool persistent;
00725 };
00726 
00727 
00728 struct st_mysqlnd_connection
00729 {
00730 /* Operation related */
00731        MYSQLND_NET          * net;
00732        MYSQLND_PROTOCOL * protocol;
00733 
00734 /* Information related */
00735        char                 *host;
00736        unsigned int  host_len;
00737        char                 *unix_socket;
00738        unsigned int  unix_socket_len;
00739        char                 *user;
00740        unsigned int  user_len;
00741        char                 *passwd;
00742        unsigned int  passwd_len;
00743        char                 *scheme;
00744        unsigned int  scheme_len;
00745        uint64_t             thread_id;
00746        char                 *server_version;
00747        char                 *host_info;
00748        unsigned char *scramble;
00749        const MYSQLND_CHARSET *charset;
00750        const MYSQLND_CHARSET *greet_charset;
00751        char                 *connect_or_select_db;
00752        unsigned int  connect_or_select_db_len;
00753        MYSQLND_INFILE       infile;
00754        unsigned int  protocol_version;
00755        unsigned long max_packet_size;
00756        unsigned int  port;
00757        unsigned long client_flag;
00758        unsigned long server_capabilities;
00759 
00760        /* For UPSERT queries */
00761        MYSQLND_UPSERT_STATUS upsert_status;
00762        char                 *last_message;
00763        unsigned int  last_message_len;
00764 
00765        /* If error packet, we use these */
00766        MYSQLND_ERROR_INFO   error_info;
00767 
00768        /*
00769          To prevent queries during unbuffered fetches. Also to
00770          mark the connection as destroyed for garbage collection.
00771        */
00772        enum mysqlnd_connection_state      state;
00773        enum_mysqlnd_query_type                   last_query_type;
00774        /* Temporary storage between query and (use|store)_result() call */
00775        MYSQLND_RES                                      *current_result;
00776 
00777        /*
00778          How many result sets reference this connection.
00779          It won't be freed until this number reaches 0.
00780          The last one, please close the door! :-)
00781          The result set objects can determine by inspecting
00782          'quit_sent' whether the connection is still valid.
00783        */
00784        unsigned int  refcount;
00785 
00786        /* Temporal storage for mysql_query */
00787        unsigned int  field_count;
00788 
00789        /* persistent connection */
00790        zend_bool            persistent;
00791 
00792        /* options */
00793        MYSQLND_OPTIONS      options;
00794 
00795        /* stats */
00796        MYSQLND_STATS * stats;
00797 
00798        struct st_mysqlnd_conn_methods *m;
00799 };
00800 
00801 
00802 struct mysqlnd_field_hash_key
00803 {
00804        zend_bool            is_numeric;
00805        unsigned long key;
00806 #if MYSQLND_UNICODE
00807        zstr                 ustr;
00808        unsigned int  ulen;
00809 #endif
00810 };
00811 
00812 
00813 struct st_mysqlnd_result_metadata
00814 {
00815        MYSQLND_FIELD                             *fields;
00816        struct mysqlnd_field_hash_key      *zend_hash_keys;
00817        unsigned int                              current_field;
00818        unsigned int                              field_count;
00819        /* We need this to make fast allocs in rowp_read */
00820        unsigned int                              bit_fields_count;
00821        size_t                                           bit_fields_total_len; /* trailing \0 not counted */
00822        zend_bool                                        persistent;
00823 
00824        struct st_mysqlnd_res_meta_methods *m;
00825 };
00826 
00827 
00828 struct st_mysqlnd_buffered_result
00829 {
00830        zval                        **data;
00831        zval                        **data_cursor;
00832        MYSQLND_MEMORY_POOL_CHUNK **row_buffers;
00833        uint64_t                    row_count;
00834        uint64_t                    initialized_rows;
00835        zend_bool                   persistent;
00836 
00837        unsigned int         references;
00838 
00839        MYSQLND_ERROR_INFO   error_info;
00840 };
00841 
00842 
00843 struct st_mysqlnd_unbuffered_result
00844 {
00845        /* For unbuffered (both normal and PS) */
00846        zval                        **last_row_data;
00847        MYSQLND_MEMORY_POOL_CHUNK *last_row_buffer;
00848 
00849        uint64_t                    row_count;
00850        zend_bool                   eof_reached;
00851 };
00852 
00853 
00854 struct st_mysqlnd_res
00855 {
00856        struct st_mysqlnd_res_methods m;
00857 
00858        MYSQLND                                   *conn;
00859        enum_mysqlnd_res_type       type;
00860        unsigned int                field_count;
00861 
00862        /* For metadata functions */
00863        MYSQLND_RES_METADATA *meta;
00864 
00865        /* To be used with store_result() - both normal and PS */
00866        MYSQLND_RES_BUFFERED        *stored_data;
00867        MYSQLND_RES_UNBUFFERED             *unbuf;
00868 
00869        /*
00870          Column lengths of current row - both buffered and unbuffered.
00871          For buffered results it duplicates the data found in **data
00872        */
00873        unsigned long               *lengths;
00874 
00875        struct st_mysqlnd_packet_row * row_packet;
00876 
00877        MYSQLND_MEMORY_POOL         * result_set_memory_pool;
00878        zend_bool                          persistent;
00879 };
00880 
00881 
00882 struct st_mysqlnd_param_bind
00883 {
00884        zval          *zv;
00885        zend_uchar    type;
00886        enum_param_bind_flags       flags;
00887 };
00888 
00889 struct st_mysqlnd_result_bind
00890 {
00891        zval          *zv;
00892        zend_bool     bound;
00893 };
00894 
00895 
00896 struct st_mysqlnd_stmt_data
00897 {
00898        MYSQLND                                          *conn;
00899        unsigned long                      stmt_id;
00900        unsigned long                      flags;/* cursor is set here */
00901        enum_mysqlnd_stmt_state            state;
00902        unsigned int                       warning_count;
00903        MYSQLND_RES                               *result;
00904        unsigned int                       field_count;
00905        unsigned int                       param_count;
00906        unsigned char                      send_types_to_server;
00907        MYSQLND_PARAM_BIND                 *param_bind;
00908        MYSQLND_RESULT_BIND                *result_bind;
00909        zend_bool                                 result_zvals_separated_once;
00910        zend_bool                                 persistent;
00911 
00912        MYSQLND_UPSERT_STATUS              upsert_status;
00913 
00914        MYSQLND_ERROR_INFO                 error_info;
00915 
00916        zend_bool                                 update_max_length;
00917        unsigned long                      prefetch_rows;
00918 
00919        zend_bool                                 cursor_exists;
00920        mysqlnd_stmt_use_or_store_func default_rset_handler;
00921 
00922        MYSQLND_CMD_BUFFER                 execute_cmd_buffer;
00923        unsigned int                       execute_count;/* count how many times the stmt was executed */
00924 };
00925 
00926 
00927 struct st_mysqlnd_stmt
00928 {
00929        MYSQLND_STMT_DATA * data;
00930        struct st_mysqlnd_stmt_methods     *m;
00931        zend_bool persistent;
00932 };
00933 
00934 #endif /* MYSQLND_STRUCTS_H */