MySQLnd
-Georg Richter, Andrey Hristov, Ulf Wendel
+Andrey Hristov, Ulf Wendel, Georg Richter
"mysqlnd_bt.c " +
"mysqlnd_charset.c " +
"mysqlnd_debug.c " +
+ "mysqlnd_driver.c " +
+ "mysqlnd_ext_plugin.c " +
"mysqlnd_loaddata.c " +
"mysqlnd_reverse_api.c " +
"mysqlnd_net.c " +
mysqlnd_ps_sources="mysqlnd_ps.c mysqlnd_ps_codec.c"
mysqlnd_base_sources="mysqlnd.c mysqlnd_alloc.c mysqlnd_bt.c mysqlnd_charset.c mysqlnd_wireprotocol.c \
mysqlnd_loaddata.c mysqlnd_reverse_api.c mysqlnd_net.c \
- mysqlnd_statistics.c mysqlnd_auth.c \
+ mysqlnd_statistics.c mysqlnd_driver.c mysqlnd_ext_plugin.c mysqlnd_auth.c \
mysqlnd_result.c mysqlnd_result_meta.c mysqlnd_debug.c\
mysqlnd_block_alloc.c mysqlnd_plugin.c php_mysqlnd.c"
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
- | Authors: Georg Richter <georg@mysql.com> |
- | Andrey Hristov <andrey@mysql.com> |
+ | Authors: Andrey Hristov <andrey@mysql.com> |
| Ulf Wendel <uwendel@mysql.com> |
+ | Georg Richter <georg@mysql.com> |
+----------------------------------------------------------------------+
*/
#include "mysqlnd_statistics.h"
#include "mysqlnd_charset.h"
#include "mysqlnd_debug.h"
-#include "mysqlnd_reverse_api.h"
/*
TODO :
PHPAPI const char * const mysqlnd_out_of_memory = "Out of memory";
PHPAPI MYSQLND_STATS *mysqlnd_global_stats = NULL;
-static zend_bool mysqlnd_library_initted = FALSE;
-
-static struct st_mysqlnd_conn_methods *mysqlnd_conn_methods;
static struct st_mysqlnd_plugin_core mysqlnd_plugin_core;
}
/* }}} */
-
-/* {{{ mysqlnd_library_end */
-PHPAPI void mysqlnd_library_end(TSRMLS_D)
-{
- if (mysqlnd_library_initted == TRUE) {
- mysqlnd_plugin_subsystem_end(TSRMLS_C);
- mysqlnd_stats_end(mysqlnd_global_stats);
- mysqlnd_global_stats = NULL;
- mysqlnd_library_initted = FALSE;
- mysqlnd_reverse_api_end(TSRMLS_C);
- }
-}
-/* }}} */
-
-
/* {{{ mysqlnd_conn::free_options */
static void
MYSQLND_METHOD(mysqlnd_conn, free_options)(MYSQLND * conn TSRMLS_DC)
/* }}} */
+/* {{{ mysqlnd_conn::init */
+static enum_func_status
+MYSQLND_METHOD(mysqlnd_conn, init)(MYSQLND * conn TSRMLS_DC)
+{
+ DBG_ENTER("mysqlnd_conn::init");
+ mysqlnd_stats_init(&conn->stats, STAT_LAST);
+ SET_ERROR_AFF_ROWS(conn);
+
+ conn->net = mysqlnd_net_init(conn->persistent, conn->stats, &conn->error_info TSRMLS_CC);
+ conn->protocol = mysqlnd_protocol_init(conn->persistent TSRMLS_CC);
+
+ DBG_RETURN(conn->stats && conn->net && conn->protocol? PASS:FAIL);
+}
+/* }}} */
MYSQLND_STMT * _mysqlnd_stmt_init(MYSQLND * const conn TSRMLS_DC);
-static enum_func_status MYSQLND_METHOD(mysqlnd_conn, init)(MYSQLND * conn TSRMLS_DC);
-static
+
MYSQLND_CLASS_METHODS_START(mysqlnd_conn)
MYSQLND_METHOD(mysqlnd_conn, init),
MYSQLND_METHOD(mysqlnd_conn, connect),
MYSQLND_CLASS_METHODS_END;
-/* {{{ mysqlnd_conn::init */
-static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn, init)(MYSQLND * conn TSRMLS_DC)
-{
- DBG_ENTER("mysqlnd_conn::init");
- mysqlnd_stats_init(&conn->stats, STAT_LAST);
- SET_ERROR_AFF_ROWS(conn);
-
- conn->net = mysqlnd_net_init(conn->persistent, conn->stats, &conn->error_info TSRMLS_CC);
- conn->protocol = mysqlnd_protocol_init(conn->persistent TSRMLS_CC);
-
- DBG_RETURN(conn->stats && conn->net && conn->protocol? PASS:FAIL);
-}
-/* }}} */
-
-
/* {{{ mysqlnd_init */
PHPAPI MYSQLND * _mysqlnd_init(zend_bool persistent TSRMLS_DC)
{
}
ret->persistent = persistent;
- ret->m = mysqlnd_conn_methods;
+ ret->m = mysqlnd_conn_get_methods();
CONN_SET_STATE(ret, CONN_ALLOCED);
ret->m->get_reference(ret TSRMLS_CC);
}
/* }}} */
-
-/* {{{ mysqlnd_library_init */
-PHPAPI void mysqlnd_library_init(TSRMLS_D)
-{
- if (mysqlnd_library_initted == FALSE) {
- mysqlnd_library_initted = TRUE;
- mysqlnd_conn_methods = &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_conn);
- _mysqlnd_init_ps_subsystem();
- /* Should be calloc, as mnd_calloc will reference LOCK_access*/
- mysqlnd_stats_init(&mysqlnd_global_stats, STAT_LAST);
- mysqlnd_plugin_subsystem_init(TSRMLS_C);
- {
- mysqlnd_plugin_core.plugin_header.plugin_stats.values = mysqlnd_global_stats;
- mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_plugin_core TSRMLS_CC);
- }
- mysqlnd_example_plugin_register(TSRMLS_C);
- mysqlnd_debug_trace_plugin_register(TSRMLS_C);
- mysqlnd_register_builtin_authentication_plugins(TSRMLS_C);
-
- mysqlnd_reverse_api_init(TSRMLS_C);
- }
-}
-/* }}} */
-
-
-/* {{{ mysqlnd_conn_get_methods */
-PHPAPI struct st_mysqlnd_conn_methods * mysqlnd_conn_get_methods()
-{
- return mysqlnd_conn_methods;
-}
-/* }}} */
-
-/* {{{ mysqlnd_conn_set_methods */
-PHPAPI void mysqlnd_conn_set_methods(struct st_mysqlnd_conn_methods *methods)
-{
- mysqlnd_conn_methods = methods;
-}
-/* }}} */
-
-
-/* {{{ _mysqlnd_plugin_get_plugin_connection_data */
-PHPAPI void ** _mysqlnd_plugin_get_plugin_connection_data(const MYSQLND * conn, unsigned int plugin_id TSRMLS_DC)
-{
- DBG_ENTER("_mysqlnd_plugin_get_plugin_connection_data");
- DBG_INF_FMT("plugin_id=%u", plugin_id);
- if (!conn || plugin_id >= mysqlnd_plugin_count()) {
- return NULL;
- }
- DBG_RETURN((void *)((char *)conn + sizeof(MYSQLND) + plugin_id * sizeof(void *)));
-}
-/* }}} */
-
-
-static struct st_mysqlnd_plugin_core mysqlnd_plugin_core =
-{
- {
- MYSQLND_PLUGIN_API_VERSION,
- "mysqlnd",
- MYSQLND_VERSION_ID,
- MYSQLND_VERSION,
- "PHP License 3.01",
- "Andrey Hristov <andrey@mysql.com>, Ulf Wendel <uwendel@mysql.com>, Georg Richter <georg@mysql.com>",
- {
- NULL, /* will be filled later */
- mysqlnd_stats_values_names,
- },
- {
- NULL /* plugin shutdown */
- }
- }
-};
-
-
/*
* Local variables:
* tab-width: 4
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
- | Authors: Georg Richter <georg@mysql.com> |
- | Andrey Hristov <andrey@mysql.com> |
+ | Authors: Andrey Hristov <andrey@mysql.com> |
| Ulf Wendel <uwendel@mysql.com> |
+ | Georg Richter <georg@mysql.com> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
PHPAPI void _mysqlnd_plugin_apply_with_argument(apply_func_arg_t apply_func, void * argument TSRMLS_DC);
#define mysqlnd_plugin_apply_with_argument(func, argument) _mysqlnd_plugin_apply_with_argument((func), (argument) TSRMLS_CC);
-PHPAPI void ** _mysqlnd_plugin_get_plugin_connection_data(const MYSQLND * conn, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_connection_data(c, p_id) _mysqlnd_plugin_get_plugin_connection_data((c), (p_id) TSRMLS_CC)
-
-PHPAPI void ** _mysqlnd_plugin_get_plugin_result_data(const MYSQLND_RES * result, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_result_data(r, p_id) _mysqlnd_plugin_get_plugin_result_data((r), (p_id) TSRMLS_CC)
-
-PHPAPI void ** _mysqlnd_plugin_get_plugin_stmt_data(const MYSQLND_STMT * stmt, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_stmt_data(s, p_id) _mysqlnd_plugin_get_plugin_stmt_data((s), (p_id) TSRMLS_CC)
-
-PHPAPI void ** _mysqlnd_plugin_get_plugin_protocol_data(const MYSQLND_PROTOCOL * protocol, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_protocol_data(p, p_id) _mysqlnd_plugin_get_plugin_protocol_data((p), (p_id) TSRMLS_CC)
-
-PHPAPI void ** _mysqlnd_plugin_get_plugin_net_data(const MYSQLND_NET * net, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_net_data(n, p_id) _mysqlnd_plugin_get_plugin_net_data((n), (p_id) TSRMLS_CC)
-
-
-PHPAPI struct st_mysqlnd_conn_methods * mysqlnd_conn_get_methods();
-PHPAPI void mysqlnd_conn_set_methods(struct st_mysqlnd_conn_methods *methods);
-
-PHPAPI struct st_mysqlnd_stmt_methods * mysqlnd_stmt_get_methods();
-PHPAPI void mysqlnd_stmt_set_methods(struct st_mysqlnd_stmt_methods *methods);
-
-
#define mysqlnd_restart_psession(conn) (conn)->m->restart_psession((conn) TSRMLS_CC)
#define mysqlnd_end_psession(conn) (conn)->m->end_psession((conn) TSRMLS_CC)
PHPAPI void mysqlnd_minfo_print_hash(zval *values);
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
- | Authors: Georg Richter <georg@mysql.com> |
- | Andrey Hristov <andrey@mysql.com> |
+ | Authors: Andrey Hristov <andrey@mysql.com> |
| Ulf Wendel <uwendel@mysql.com> |
+ | Georg Richter <georg@mysql.com> |
+----------------------------------------------------------------------+
*/
+
+/* $Id: mysqlnd_ps.c 316906 2011-09-17 10:24:18Z pajoye $ */
#include "php.h"
#include "php_globals.h"
#include "mysqlnd.h"
#include "mysqlnd_wireprotocol.h"
#include "mysqlnd_statistics.h"
#include "mysqlnd_debug.h"
-#include "ext/standard/sha1.h"
+#include "mysqlnd_ext_plugin.h"
#include "php_network.h"
#include "zend_ini.h"
#ifdef MYSQLND_COMPRESSION_ENABLED
/* }}} */
-static
MYSQLND_CLASS_METHODS_START(mysqlnd_net)
MYSQLND_METHOD(mysqlnd_net, init),
MYSQLND_METHOD(mysqlnd_net, dtor),
DBG_INF_FMT("persistent=%u", persistent);
if (net) {
net->persistent = persistent;
- net->m = mysqlnd_mysqlnd_net_methods;
+ net->m = *mysqlnd_net_get_methods();
if (PASS != net->m.init(net, stats, error_info TSRMLS_CC)) {
net->m.dtor(net, stats, error_info TSRMLS_CC);
/* }}} */
-/* {{{ _mysqlnd_plugin_get_plugin_net_data */
-PHPAPI void ** _mysqlnd_plugin_get_plugin_net_data(const MYSQLND_NET * net, unsigned int plugin_id TSRMLS_DC)
-{
- DBG_ENTER("_mysqlnd_plugin_get_plugin_net_data");
- DBG_INF_FMT("plugin_id=%u", plugin_id);
- if (!net || plugin_id >= mysqlnd_plugin_count()) {
- return NULL;
- }
- DBG_RETURN((void *)((char *)net + sizeof(MYSQLND_NET) + plugin_id * sizeof(void *)));
-}
-/* }}} */
-
-
-/* {{{ mysqlnd_net_get_methods */
-PHPAPI struct st_mysqlnd_net_methods *
-mysqlnd_net_get_methods()
-{
- return &mysqlnd_mysqlnd_net_methods;
-}
-/* }}} */
-
/*
* Local variables:
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
- | Authors: Georg Richter <georg@mysql.com> |
- | Andrey Hristov <andrey@mysql.com> |
+ | Authors: Andrey Hristov <andrey@mysql.com> |
| Ulf Wendel <uwendel@mysql.com> |
+ | Georg Richter <georg@mysql.com> |
+----------------------------------------------------------------------+
*/
PHPAPI MYSQLND_NET * mysqlnd_net_init(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC);
PHPAPI void mysqlnd_net_free(MYSQLND_NET * const net, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC);
-PHPAPI struct st_mysqlnd_net_methods * mysqlnd_net_get_methods();
-
#endif /* MYSQLND_NET_H */
/*
/* $Id: mysqlnd.c 306407 2010-12-16 12:56:19Z andrey $ */
#include "php.h"
#include "mysqlnd.h"
-#include "mysqlnd_wireprotocol.h"
#include "mysqlnd_priv.h"
-#include "mysqlnd_result.h"
#include "mysqlnd_statistics.h"
-#include "mysqlnd_charset.h"
#include "mysqlnd_debug.h"
-/* for php_get_current_user() */
-#include "ext/standard/basic_functions.h"
-
/*--------------------------------------------------------------------*/
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
- | Authors: Georg Richter <georg@mysql.com> |
- | Andrey Hristov <andrey@mysql.com> |
+ | Authors: Andrey Hristov <andrey@mysql.com> |
| Ulf Wendel <uwendel@mysql.com> |
+ | Georg Richter <georg@mysql.com> |
+----------------------------------------------------------------------+
*/
#endif
#define MYSQLND_CLASS_METHOD_TABLE_NAME(class) mysqlnd_##class##_methods
-#define MYSQLND_CLASS_METHODS_START(class) struct st_##class##_methods MYSQLND_CLASS_METHOD_TABLE_NAME(class) = {
+#define MYSQLND_CLASS_METHODS_START(class) MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(class) = {
#define MYSQLND_CLASS_METHODS_END }
+#define MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(class) struct st_##class##_methods MYSQLND_CLASS_METHOD_TABLE_NAME(class)
#if MYSQLND_UNICODE
#define mysqlnd_array_init(arg, field_count) \
PHPAPI extern const char * const mysqlnd_server_gone;
PHPAPI extern const char * const mysqlnd_out_of_memory;
+extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_conn);
+extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_res);
+extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_protocol);
+extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_net);
+
enum_func_status mysqlnd_handle_local_infile(MYSQLND *conn, const char *filename, zend_bool *is_warning TSRMLS_DC);
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
- | Authors: Georg Richter <georg@mysql.com> |
- | Andrey Hristov <andrey@mysql.com> |
+ | Authors: Andrey Hristov <andrey@mysql.com> |
| Ulf Wendel <uwendel@mysql.com> |
+ | Georg Richter <georg@mysql.com> |
+----------------------------------------------------------------------+
*/
#include "mysqlnd_statistics.h"
#include "mysqlnd_debug.h"
#include "mysqlnd_block_alloc.h"
-
+#include "mysqlnd_ext_plugin.h"
#define MYSQLND_SILENT
const char * const mysqlnd_not_bound_as_blob = "Can't send long data for non-string/non-binary data types";
const char * const mysqlnd_stmt_not_prepared = "Statement not prepared";
-static struct st_mysqlnd_stmt_methods *mysqlnd_stmt_methods;
-
/* Exported by mysqlnd_ps_codec.c */
enum_func_status mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC);
if (!ret) {
break;
}
- ret->m = mysqlnd_stmt_methods;
+ ret->m = mysqlnd_stmt_get_methods();
ret->persistent = conn->persistent;
stmt = ret->data = mnd_pecalloc(1, sizeof(MYSQLND_STMT_DATA), conn->persistent);
/* }}} */
-/* {{{ _mysqlnd_plugin_get_plugin_stmt_data */
-PHPAPI void ** _mysqlnd_plugin_get_plugin_stmt_data(const MYSQLND_STMT * stmt, unsigned int plugin_id TSRMLS_DC)
-{
- DBG_ENTER("_mysqlnd_plugin_get_plugin_stmt_data");
- DBG_INF_FMT("plugin_id=%u", plugin_id);
- if (!stmt || plugin_id >= mysqlnd_plugin_count()) {
- return NULL;
- }
- DBG_RETURN((void *)((char *)stmt + sizeof(MYSQLND_STMT) + plugin_id * sizeof(void *)));
-}
-/* }}} */
-
-
/* {{{ _mysqlnd_init_ps_subsystem */
void _mysqlnd_init_ps_subsystem()
{
- mysqlnd_stmt_methods = &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_stmt);
+ mysqlnd_stmt_set_methods(&MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_stmt));
_mysqlnd_init_ps_fetch_subsystem();
}
/* }}} */
-/* {{{ mysqlnd_conn_get_methods */
-PHPAPI struct st_mysqlnd_stmt_methods * mysqlnd_stmt_get_methods()
-{
- return mysqlnd_stmt_methods;
-}
-/* }}} */
-
-
-/* {{{ mysqlnd_conn_set_methods */
-PHPAPI void mysqlnd_stmt_set_methods(struct st_mysqlnd_stmt_methods *methods)
-{
- mysqlnd_stmt_methods = methods;
-}
-/* }}} */
-
-
/*
* Local variables:
* tab-width: 4
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
- | Authors: Georg Richter <georg@mysql.com> |
- | Andrey Hristov <andrey@mysql.com> |
+ | Authors: Andrey Hristov <andrey@mysql.com> |
| Ulf Wendel <uwendel@mysql.com> |
+ | Georg Richter <georg@mysql.com> |
+----------------------------------------------------------------------+
*/
#include "mysqlnd_result_meta.h"
#include "mysqlnd_statistics.h"
#include "mysqlnd_debug.h"
+#include "mysqlnd_ext_plugin.h"
#define MYSQLND_SILENT
/* }}} */
-static
MYSQLND_CLASS_METHODS_START(mysqlnd_res)
NULL, /* fetch_row */
mysqlnd_fetch_row_buffered,
ret->persistent = persistent;
ret->field_count = field_count;
- ret->m = mysqlnd_mysqlnd_res_methods;
+ ret->m = *mysqlnd_result_get_methods();
DBG_RETURN(ret);
}
/* }}} */
-/* {{{ _mysqlnd_plugin_get_plugin_result_data */
-PHPAPI void ** _mysqlnd_plugin_get_plugin_result_data(const MYSQLND_RES * result, unsigned int plugin_id TSRMLS_DC)
-{
- DBG_ENTER("_mysqlnd_plugin_get_plugin_result_data");
- DBG_INF_FMT("plugin_id=%u", plugin_id);
- if (!result || plugin_id >= mysqlnd_plugin_count()) {
- return NULL;
- }
- DBG_RETURN((void *)((char *)result + sizeof(MYSQLND_RES) + plugin_id * sizeof(void *)));
-}
-/* }}} */
-
-
-/* {{{ mysqlnd_result_get_methods */
-PHPAPI struct st_mysqlnd_res_methods *
-mysqlnd_result_get_methods()
-{
- return &mysqlnd_mysqlnd_res_methods;
-}
-/* }}} */
-
/*
* Local variables:
* tab-width: 4
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
- | Authors: Georg Richter <georg@mysql.com> |
- | Andrey Hristov <andrey@mysql.com> |
+ | Authors: Andrey Hristov <andrey@mysql.com> |
| Ulf Wendel <uwendel@mysql.com> |
+ | Georg Richter <georg@mysql.com> |
+----------------------------------------------------------------------+
*/
#define MYSQLND_RESULT_H
PHPAPI MYSQLND_RES * mysqlnd_result_init(unsigned int field_count, zend_bool persistent TSRMLS_DC);
-PHPAPI struct st_mysqlnd_res_methods * mysqlnd_result_get_methods();
enum_func_status mysqlnd_query_read_result_set_header(MYSQLND * conn, MYSQLND_STMT * stmt TSRMLS_DC);
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
- | Authors: Georg Richter <georg@mysql.com> |
- | Andrey Hristov <andrey@mysql.com> |
+ | Authors: Andrey Hristov <andrey@mysql.com> |
| Ulf Wendel <uwendel@mysql.com> |
+ | Georg Richter <georg@mysql.com> |
+----------------------------------------------------------------------+
*/
};
-
typedef enum_func_status (*func_mysqlnd_conn__init)(MYSQLND * conn TSRMLS_DC);
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);
typedef ulong (*func_mysqlnd_conn__escape_string)(MYSQLND * const conn, char *newstr, const char *escapestr, size_t escapestr_len TSRMLS_DC);
zend_uchar compressed_envelope_packet_no;
#ifdef MYSQLND_COMPRESSION_ENABLED
MYSQLND_READ_BUFFER * uncompressed_data;
+#else
+ void * unused_pad1;
#endif
#ifdef MYSQLND_DO_WIRE_CHECK_BEFORE_COMMAND
zend_uchar last_command;
+#else
+ zend_uchar unused_pad2;
#endif
/* cmd buffer */
MYSQLND_CMD_BUFFER cmd_buffer;
struct st_mysqlnd_protocol
{
- struct st_mysqlnd_protocol_methods m;
zend_bool persistent;
+ struct st_mysqlnd_protocol_methods m;
};
struct st_mysqlnd_res
{
- struct st_mysqlnd_res_methods m;
-
MYSQLND *conn;
enum_mysqlnd_res_type type;
unsigned int field_count;
MYSQLND_MEMORY_POOL * result_set_memory_pool;
zend_bool persistent;
+
+ struct st_mysqlnd_res_methods m;
};
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
- | Authors: Georg Richter <georg@mysql.com> |
- | Andrey Hristov <andrey@mysql.com> |
+ | Authors: Andrey Hristov <andrey@mysql.com> |
| Ulf Wendel <uwendel@mysql.com> |
+ | Georg Richter <georg@mysql.com> |
+----------------------------------------------------------------------+
*/
+
+/* $Id$ */
#include "php.h"
#include "php_globals.h"
#include "mysqlnd.h"
/* }}} */
-static
MYSQLND_CLASS_METHODS_START(mysqlnd_protocol)
MYSQLND_METHOD(mysqlnd_protocol, get_greet_packet),
MYSQLND_METHOD(mysqlnd_protocol, get_auth_packet),
/* }}} */
-/* {{{ _mysqlnd_plugin_get_plugin_protocol_data */
-PHPAPI void **
-_mysqlnd_plugin_get_plugin_protocol_data(const MYSQLND_PROTOCOL * protocol, unsigned int plugin_id TSRMLS_DC)
-{
- DBG_ENTER("_mysqlnd_plugin_get_plugin_protocol_data");
- DBG_INF_FMT("plugin_id=%u", plugin_id);
- if (!protocol || plugin_id >= mysqlnd_plugin_count()) {
- return NULL;
- }
- DBG_RETURN((void *)((char *)protocol + sizeof(MYSQLND_PROTOCOL) + plugin_id * sizeof(void *)));
-}
-/* }}} */
-
-
-/* {{{ mysqlnd_protocol_get_methods */
-PHPAPI struct st_mysqlnd_protocol_methods *
-mysqlnd_protocol_get_methods()
-{
- return &mysqlnd_mysqlnd_protocol_methods;
-}
-/* }}} */
-
-
/*
* Local variables:
* tab-width: 4
PHPAPI MYSQLND_PROTOCOL * mysqlnd_protocol_init(zend_bool persistent TSRMLS_DC);
PHPAPI void mysqlnd_protocol_free(MYSQLND_PROTOCOL * const protocol TSRMLS_DC);
-PHPAPI struct st_mysqlnd_protocol_methods * mysqlnd_protocol_get_methods();
#endif /* MYSQLND_WIREPROTOCOL_H */