[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd.c mysqlnd_wireprotocol.c php_mysqlnd.c
andrey Mon Jun 8 10:19:29 2009 UTC Modified files: /php-src/ext/mysqlndmysqlnd.c mysqlnd_wireprotocol.c php_mysqlnd.c Log: Merge with the branch, someone made changes in PHP5_3 and did not merge. Also switch off the zval cache for now. http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.39r2=1.40diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.c diff -u php-src/ext/mysqlnd/mysqlnd.c:1.39 php-src/ext/mysqlnd/mysqlnd.c:1.40 --- php-src/ext/mysqlnd/mysqlnd.c:1.39 Fri Mar 27 19:28:26 2009 +++ php-src/ext/mysqlnd/mysqlnd.c Mon Jun 8 10:19:29 2009 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd.c,v 1.39 2009/03/27 19:28:26 felipe Exp $ */ +/* $Id: mysqlnd.c,v 1.40 2009/06/08 10:19:29 andrey Exp $ */ #include php.h #include mysqlnd.h #include mysqlnd_wireprotocol.h @@ -664,7 +664,7 @@ { auth_packet-charset_no = charset-nr; } else { -#if PHP_MAJOR_VERSION = 6 +#if PHP_MAJOR_VERSION = 6 auth_packet-charset_no = 200;/* utf8 - swedish collation, check mysqlnd_charset.c */ #else auth_packet-charset_no = greet_packet.charset_no; @@ -991,7 +991,7 @@ #endif /* {{{ _mysqlnd_poll */ -enum_func_status +PHPAPI enum_func_status _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, uint * desc_num TSRMLS_DC) { http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_wireprotocol.c?r1=1.26r2=1.27diff_format=u Index: php-src/ext/mysqlnd/mysqlnd_wireprotocol.c diff -u php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.26 php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.27 --- php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.26 Wed Dec 31 11:12:33 2008 +++ php-src/ext/mysqlnd/mysqlnd_wireprotocol.c Mon Jun 8 10:19:29 2009 @@ -1378,7 +1378,7 @@ bit = 4;/* first 2 bits are reserved */ for (i = 0; current_field end_field; current_field++, i++) { -#if 1 +#ifdef USE_ZVAL_CACHE DBG_INF(Trying to use the zval cache); obj = mysqlnd_palloc_get_zval(conn-zval_cache, allocated TSRMLS_CC); if (allocated) { @@ -1474,11 +1474,12 @@ for (i = 0; current_field end_field; current_field++, i++) { /* Don't reverse the order. It is significant!*/ void *obj; - zend_bool allocated; + zend_bool allocated = TRUE; zend_uchar *this_field_len_pos = p; /* php_mysqlnd_net_field_length() call should be after *this_field_len_pos = p; */ unsigned long len = php_mysqlnd_net_field_length(p); +#ifdef USE_ZVAL_CACHE obj = mysqlnd_palloc_get_zval(conn-zval_cache, allocated TSRMLS_CC); if (allocated) { *current_field = (zval *) obj; @@ -1487,6 +1488,10 @@ *current_field = ((mysqlnd_zval *) obj)-zv; ((mysqlnd_zval *) obj)-point_type = MYSQLND_POINTS_FREE; } +#else + DBG_INF(Directly creating zval); + MAKE_STD_ZVAL(*current_field); +#endif if (current_field start_field last_field_was_string) { /* http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/php_mysqlnd.c?r1=1.13r2=1.14diff_format=u Index: php-src/ext/mysqlnd/php_mysqlnd.c diff -u php-src/ext/mysqlnd/php_mysqlnd.c:1.13 php-src/ext/mysqlnd/php_mysqlnd.c:1.14 --- php-src/ext/mysqlnd/php_mysqlnd.c:1.13 Tue May 26 13:42:43 2009 +++ php-src/ext/mysqlnd/php_mysqlnd.c Mon Jun 8 10:19:29 2009 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_mysqlnd.c,v 1.13 2009/05/26 13:42:43 andrey Exp $ */ +/* $Id: php_mysqlnd.c,v 1.14 2009/06/08 10:19:29 andrey Exp $ */ #include php.h #include php_ini.h #include mysqlnd.h @@ -47,12 +47,12 @@ zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(values), pos_values); while (zend_hash_get_current_data_ex(Z_ARRVAL_P(values), (void **)values_entry, pos_values) == SUCCESS) { + TSRMLS_FETCH(); zstrstring_key; uintstring_key_len; ulong num_key; int s_len; char*s = NULL; - TSRMLS_FETCH(); zend_hash_get_current_key_ex(Z_ARRVAL_P(values), string_key, string_key_len, num_key, 0, pos_values); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd.c mysqlnd.h mysqlnd_priv.h mysqlnd_ps.c mysqlnd_ps_codec.c
johannesMon Feb 16 17:25:37 2009 UTC Modified files: /php-src/ext/mysqlndmysqlnd.c mysqlnd.h mysqlnd_priv.h mysqlnd_ps.c mysqlnd_ps_codec.c Log: - Improve mysqlnd's internal method registration http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.37r2=1.38diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.c diff -u php-src/ext/mysqlnd/mysqlnd.c:1.37 php-src/ext/mysqlnd/mysqlnd.c:1.38 --- php-src/ext/mysqlnd/mysqlnd.c:1.37 Wed Dec 31 11:12:33 2008 +++ php-src/ext/mysqlnd/mysqlnd.c Mon Feb 16 17:25:37 2009 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd.c,v 1.37 2008/12/31 11:12:33 sebastian Exp $ */ +/* $Id: mysqlnd.c,v 1.38 2009/02/16 17:25:37 johannes Exp $ */ #include php.h #include mysqlnd.h #include mysqlnd_wireprotocol.h @@ -68,19 +68,7 @@ static enum_func_status mysqlnd_send_close(MYSQLND * conn TSRMLS_DC); - -/* {{{ mysqlnd_library_init */ -void mysqlnd_library_init(TSRMLS_D) -{ - if (mysqlnd_library_initted == FALSE) { - mysqlnd_library_initted = TRUE; - _mysqlnd_init_ps_subsystem(); - /* Should be calloc, as mnd_calloc will reference LOCK_access*/ - mysqlnd_stats_init(mysqlnd_global_stats); - } -} -/* }}} */ - +static struct st_mysqlnd_conn_methods *mysqlnd_conn_methods; /* {{{ mysqlnd_library_end */ void mysqlnd_library_end(TSRMLS_D) @@ -2125,7 +2113,6 @@ MYSQLND_STMT * _mysqlnd_stmt_init(MYSQLND * const conn TSRMLS_DC); - MYSQLND_CLASS_METHODS_START(mysqlnd_conn) MYSQLND_METHOD(mysqlnd_conn, escape_string), MYSQLND_METHOD(mysqlnd_conn, set_charset), @@ -2196,7 +2183,7 @@ SET_ERROR_AFF_ROWS(ret); ret-persistent = persistent; - ret-m = mysqlnd_mysqlnd_conn_methods; + ret-m = mysqlnd_conn_methods; ret-m-get_reference(ret TSRMLS_CC); #ifdef MYSQLND_THREADED @@ -2212,6 +2199,32 @@ } /* }}} */ +/* {{{ mysqlnd_library_init */ +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); + } +} +/* }}} */ + +/* {{{ 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; +} +/* }}} */ /* * Local variables: http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.h?r1=1.24r2=1.25diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.h diff -u php-src/ext/mysqlnd/mysqlnd.h:1.24 php-src/ext/mysqlnd/mysqlnd.h:1.25 --- php-src/ext/mysqlnd/mysqlnd.h:1.24 Wed Dec 31 11:12:33 2008 +++ php-src/ext/mysqlnd/mysqlnd.h Mon Feb 16 17:25:37 2009 @@ -18,12 +18,12 @@ +--+ */ -/* $Id: mysqlnd.h,v 1.24 2008/12/31 11:12:33 sebastian Exp $ */ +/* $Id: mysqlnd.h,v 1.25 2009/02/16 17:25:37 johannes Exp $ */ #ifndef MYSQLND_H #define MYSQLND_H -#define MYSQLND_VERSION mysqlnd 5.0.5-dev - 081106 - $Revision: 1.24 $ +#define MYSQLND_VERSION mysqlnd 5.0.5-dev - 081106 - $Revision: 1.25 $ #define MYSQLND_VERSION_ID 50005 /* This forces inlining of some accessor functions */ @@ -67,6 +67,13 @@ void mysqlnd_library_init(TSRMLS_D); void mysqlnd_library_end(TSRMLS_D); +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, cache) _mysqlnd_restart_psession((conn), (cache) TSRMLS_CC) PHPAPI void _mysqlnd_restart_psession(MYSQLND *conn, MYSQLND_THD_ZVAL_PCACHE *cache TSRMLS_DC); #define mysqlnd_end_psession(conn) _mysqlnd_end_psession((conn) TSRMLS_CC) @@ -354,7 +361,9 @@ void mysqlnd_qcache_put(MYSQLND_QCACHE * const cache, char * query, size_t query_len, MYSQLND_RES_BUFFERED * const result, MYSQLND_RES_METADATA * const meta); - +/* double check the class name to avoid naming conflicts when using these: */ +#define MYSQLND_METHOD(class, method) php_##class##_##method##_pub +#define MYSQLND_METHOD_PRIVATE(class, method) php_##class##_##method##_priv ZEND_BEGIN_MODULE_GLOBALS(mysqlnd) zend_bool collect_statistics;
[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd.c mysqlnd.h mysqlnd_debug.h mysqlnd_palloc.c mysqlnd_ps.c mysqlnd_structs.h
andrey Thu Nov 20 17:29:55 2008 UTC Modified files: /php-src/ext/mysqlndmysqlnd.c mysqlnd.h mysqlnd_debug.h mysqlnd_palloc.c mysqlnd_ps.c mysqlnd_structs.h Log: mysqlnd fixes for Windows : - less warnings - PHPAPI for mysqlnd_poll http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.35r2=1.36diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.c diff -u php-src/ext/mysqlnd/mysqlnd.c:1.35 php-src/ext/mysqlnd/mysqlnd.c:1.36 --- php-src/ext/mysqlnd/mysqlnd.c:1.35 Wed Nov 19 17:41:25 2008 +++ php-src/ext/mysqlnd/mysqlnd.c Thu Nov 20 17:29:55 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd.c,v 1.35 2008/11/19 17:41:25 andrey Exp $ */ +/* $Id: mysqlnd.c,v 1.36 2008/11/20 17:29:55 andrey Exp $ */ #include php.h #include mysqlnd.h #include mysqlnd_wireprotocol.h @@ -1382,7 +1382,7 @@ /* {{{ mysqlnd_conn::refresh */ static enum_func_status -MYSQLND_METHOD(mysqlnd_conn, refresh)(MYSQLND * const conn, unsigned long options TSRMLS_DC) +MYSQLND_METHOD(mysqlnd_conn, refresh)(MYSQLND * const conn, uint8_t options TSRMLS_DC) { zend_uchar bits[1]; DBG_ENTER(mysqlnd_conn::refresh); @@ -1397,7 +1397,7 @@ /* {{{ mysqlnd_conn::shutdown */ static enum_func_status -MYSQLND_METHOD(mysqlnd_conn, shutdown)(MYSQLND * const conn, unsigned long level TSRMLS_DC) +MYSQLND_METHOD(mysqlnd_conn, shutdown)(MYSQLND * const conn, uint8_t level TSRMLS_DC) { zend_uchar bits[1]; DBG_ENTER(mysqlnd_conn::shutdown); http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.h?r1=1.22r2=1.23diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.h diff -u php-src/ext/mysqlnd/mysqlnd.h:1.22 php-src/ext/mysqlnd/mysqlnd.h:1.23 --- php-src/ext/mysqlnd/mysqlnd.h:1.22 Tue Nov 18 16:54:38 2008 +++ php-src/ext/mysqlnd/mysqlnd.h Thu Nov 20 17:29:55 2008 @@ -18,12 +18,12 @@ +--+ */ -/* $Id: mysqlnd.h,v 1.22 2008/11/18 16:54:38 andrey Exp $ */ +/* $Id: mysqlnd.h,v 1.23 2008/11/20 17:29:55 andrey Exp $ */ #ifndef MYSQLND_H #define MYSQLND_H -#define MYSQLND_VERSION mysqlnd 5.0.5-dev - 081106 - $Revision: 1.22 $ +#define MYSQLND_VERSION mysqlnd 5.0.5-dev - 081106 - $Revision: 1.23 $ #define MYSQLND_VERSION_ID 50005 /* This forces inlining of some accessor functions */ @@ -111,7 +111,7 @@ #define mysqlnd_reap_async_query(conn) (conn)-m-reap_query((conn) TSRMLS_CC) #define mysqlnd_unbuffered_skip_result(result) (result)-m.skip_result((result) TSRMLS_CC) -enum_func_status _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, uint * desc_num TSRMLS_DC); +PHPAPI enum_func_status _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, uint * desc_num TSRMLS_DC); #define mysqlnd_use_result(conn) (conn)-m-use_result((conn) TSRMLS_CC) #define mysqlnd_store_result(conn) (conn)-m-store_result((conn) TSRMLS_CC) http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_debug.h?r1=1.9r2=1.10diff_format=u Index: php-src/ext/mysqlnd/mysqlnd_debug.h diff -u php-src/ext/mysqlnd/mysqlnd_debug.h:1.9 php-src/ext/mysqlnd/mysqlnd_debug.h:1.10 --- php-src/ext/mysqlnd/mysqlnd_debug.h:1.9 Thu Nov 6 10:36:30 2008 +++ php-src/ext/mysqlnd/mysqlnd_debug.h Thu Nov 20 17:29:55 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd_debug.h,v 1.9 2008/11/06 10:36:30 andrey Exp $ */ +/* $Id: mysqlnd_debug.h,v 1.10 2008/11/20 17:29:55 andrey Exp $ */ #ifndef MYSQLND_DEBUG_H #define MYSQLND_DEBUG_H @@ -92,13 +92,13 @@ #elif MYSQLND_DBG_ENABLED == 0 -static inline void DBG_INF(char *msg) {} -static inline void DBG_ERR(char *msg) {} -static inline void DBG_INF_FMT(char *format, ...) {} -static inline void DBG_ERR_FMT(char *format, ...) {} -static inline void DBG_ENTER(char *func_name) {} +static inline void DBG_INF(const char * const msg) {} +static inline void DBG_ERR(const char * const msg) {} +static inline void DBG_INF_FMT(const char * const format, ...) {} +static inline void DBG_ERR_FMT(const char * const format, ...) {} +static inline void DBG_ENTER(const char * const func_name) {} #define DBG_RETURN(value) return (value) -#define DBG_VOID_RETURNreturn; +#define DBG_VOID_RETURNreturn #endif http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_palloc.c?r1=1.13r2=1.14diff_format=u Index: php-src/ext/mysqlnd/mysqlnd_palloc.c diff -u php-src/ext/mysqlnd/mysqlnd_palloc.c:1.13 php-src/ext/mysqlnd/mysqlnd_palloc.c:1.14 --- php-src/ext/mysqlnd/mysqlnd_palloc.c:1.13 Fri Oct 31 20:30:33 2008 +++ php-src/ext/mysqlnd/mysqlnd_palloc.cThu Nov 20 17:29:55 2008 @@ -18,7
[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd.c
andrey Wed Nov 19 17:41:25 2008 UTC Modified files: /php-src/ext/mysqlndmysqlnd.c Log: Fix a small bug that mysqlnd::next_result didn't care about an error in a multi-statement. In an inner layer the error has been already set, thus it needed better massage on the top level. http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.34r2=1.35diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.c diff -u php-src/ext/mysqlnd/mysqlnd.c:1.34 php-src/ext/mysqlnd/mysqlnd.c:1.35 --- php-src/ext/mysqlnd/mysqlnd.c:1.34 Tue Nov 18 18:02:06 2008 +++ php-src/ext/mysqlnd/mysqlnd.c Wed Nov 19 17:41:25 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd.c,v 1.34 2008/11/18 18:02:06 andrey Exp $ */ +/* $Id: mysqlnd.c,v 1.35 2008/11/19 17:41:25 andrey Exp $ */ #include php.h #include mysqlnd.h #include mysqlnd_wireprotocol.h @@ -1733,9 +1733,17 @@ in mysqlnd_store_result() or mysqlnd_fetch_row_unbuffered() */ if (FAIL == (ret = mysqlnd_query_read_result_set_header(conn, NULL TSRMLS_CC))) { - DBG_ERR_FMT(Serious error. %s::%d, __FILE__, __LINE__); - php_error_docref(NULL TSRMLS_CC, E_WARNING, Serious error. PID=%d, getpid()); - CONN_SET_STATE(conn, CONN_QUIT_SENT); + /* + There can be an error in the middle of a multi-statement, which will cancel the multi-statement. + So there are no more results and we should just return FALSE, error_no has been set + */ + if (!conn-error_info.error_no) { + DBG_ERR_FMT(Serious error. %s::%d, __FILE__, __LINE__); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Serious error. PID=%d, getpid()); + CONN_SET_STATE(conn, CONN_QUIT_SENT); + } else { + DBG_INF_FMT(Error from the server : (%d) %s, conn-error_info.error_no, conn-error_info.error); + } } DBG_RETURN(ret); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd.c
andrey Tue Nov 18 18:02:07 2008 UTC Modified files: /php-src/ext/mysqlndmysqlnd.c Log: Fix windows build - pure C compiler http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.33r2=1.34diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.c diff -u php-src/ext/mysqlnd/mysqlnd.c:1.33 php-src/ext/mysqlnd/mysqlnd.c:1.34 --- php-src/ext/mysqlnd/mysqlnd.c:1.33 Tue Nov 18 16:54:38 2008 +++ php-src/ext/mysqlnd/mysqlnd.c Tue Nov 18 18:02:06 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd.c,v 1.33 2008/11/18 16:54:38 andrey Exp $ */ +/* $Id: mysqlnd.c,v 1.34 2008/11/18 18:02:06 andrey Exp $ */ #include php.h #include mysqlnd.h #include mysqlnd_wireprotocol.h @@ -890,9 +890,10 @@ static enum_func_status MYSQLND_METHOD(mysqlnd_conn, reap_query)(MYSQLND * conn TSRMLS_DC) { + enum_mysqlnd_connection_state state = CONN_GET_STATE(conn); DBG_ENTER(mysqlnd_conn::reap_query); DBG_INF_FMT(conn=%llu, conn-thread_id); - enum_mysqlnd_connection_state state = CONN_GET_STATE(conn); + if (state = CONN_READY || state == CONN_QUIT_SENT) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Connection not opened, clear or has been closed); DBG_RETURN(FAIL); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd.c mysqlnd.h mysqlnd_block_alloc.c mysqlnd_block_alloc.h mysqlnd_debug.c mysqlnd_debug.h mysqlnd_enum_n_def.h mysqlnd_libmysql_compat.h mysqlnd_palloc.c
2008/10/31 Andrey Hristov [EMAIL PROTECTED]: andrey Fri Oct 31 20:30:34 2008 UTC hi, 64bit fixes: - fixes to sprintf modifiers, cleaning warnings - use _t types, like uint64_t instead of uint64, thus skipping series of typedefs. That's a good step but sadly some changes broke the windows builds and certainly on other platforms. Type like uint, unint16 are not part of of stdint. Part of the errors log: ext\mysqlnd\mysqlnd.c(442) : error C2065: 'uint16' : undeclared identifier ext\mysqlnd\mysqlnd.c(442) : error C2059: syntax error : ')' On windows, please use: http://cvs.php.net/viewvc.cgi/php-src/win32/php_stdint.h?view=markup We use (or try to :) now in every extension that needs stdint, see fileinfo or standard/crypt API for examples. Feel free to come to me if you need any further info or tests (or a hand). Cheers, -- Pierre http://blog.thepimp.net | http://www.libgd.org -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd.c
johannesWed Oct 1 19:46:58 2008 UTC Modified files: /php-src/ext/mysqlndmysqlnd.c Log: Handle failed connections right http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.28r2=1.29diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.c diff -u php-src/ext/mysqlnd/mysqlnd.c:1.28 php-src/ext/mysqlnd/mysqlnd.c:1.29 --- php-src/ext/mysqlnd/mysqlnd.c:1.28 Mon Sep 15 18:10:38 2008 +++ php-src/ext/mysqlnd/mysqlnd.c Wed Oct 1 19:46:58 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd.c,v 1.28 2008/09/15 18:10:38 andrey Exp $ */ +/* $Id: mysqlnd.c,v 1.29 2008/10/01 19:46:58 johannes Exp $ */ #include php.h #include mysqlnd.h #include mysqlnd_wireprotocol.h @@ -1261,10 +1261,12 @@ DBG_ENTER(mysqlnd_conn::close); DBG_INF_FMT(conn=%llu, conn-thread_id); - MYSQLND_INC_CONN_STATISTIC(conn-stats, stat); - MYSQLND_DEC_CONN_STATISTIC(conn-stats, STAT_OPENED_CONNECTIONS); - if (conn-persistent) { - MYSQLND_DEC_CONN_STATISTIC(conn-stats, STAT_OPENED_PERSISTENT_CONNECTIONS); + if (conn-state = CONN_READY) { + MYSQLND_INC_CONN_STATISTIC(conn-stats, stat); + MYSQLND_DEC_CONN_STATISTIC(conn-stats, STAT_OPENED_CONNECTIONS); + if (conn-persistent) { + MYSQLND_DEC_CONN_STATISTIC(conn-stats, STAT_OPENED_PERSISTENT_CONNECTIONS); + } } /* -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd.c
johannesTue Aug 19 10:15:57 2008 UTC Modified files: /php-src/ext/mysqlndmysqlnd.c Log: Fix empty error message when connecting to a bad server http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.25r2=1.26diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.c diff -u php-src/ext/mysqlnd/mysqlnd.c:1.25 php-src/ext/mysqlnd/mysqlnd.c:1.26 --- php-src/ext/mysqlnd/mysqlnd.c:1.25 Tue Jul 15 13:12:27 2008 +++ php-src/ext/mysqlnd/mysqlnd.c Tue Aug 19 10:15:56 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd.c,v 1.25 2008/07/15 13:12:27 andrey Exp $ */ +/* $Id: mysqlnd.c,v 1.26 2008/08/19 10:15:56 johannes Exp $ */ #include php.h #include mysqlnd.h #include mysqlnd_wireprotocol.h @@ -58,7 +58,7 @@ - +const char * mysqlnd_old_passwd = mysqlnd cannot connect to MySQL 4.1+ using old authentication; const char * mysqlnd_server_gone = MySQL server has gone away; const char * mysqlnd_out_of_sync = Commands out of sync; you can't run this command now; @@ -692,8 +692,8 @@ if (FAIL == PACKET_READ_ALLOCA(ok_packet, conn) || ok_packet.field_count = 0xFE) { if (ok_packet.field_count == 0xFE) { /* old authentication with new server !*/ - DBG_ERR(mysqlnd cannot connect to MySQL 4.1+ using old authentication); - php_error_docref(NULL TSRMLS_CC, E_WARNING, mysqlnd cannot connect to MySQL 4.1+ using old authentication); + DBG_ERR(mysqlnd_old_passwd); + SET_CLIENT_ERROR(conn-error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, mysqlnd_old_passwd); } else if (ok_packet.field_count == 0xFF) { if (ok_packet.sqlstate[0]) { if (!self_alloced) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd.c mysqlnd_priv.h
johannesTue Aug 19 10:42:01 2008 UTC Modified files: /php-src/ext/mysqlndmysqlnd.c mysqlnd_priv.h Log: constify strings http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.26r2=1.27diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.c diff -u php-src/ext/mysqlnd/mysqlnd.c:1.26 php-src/ext/mysqlnd/mysqlnd.c:1.27 --- php-src/ext/mysqlnd/mysqlnd.c:1.26 Tue Aug 19 10:15:56 2008 +++ php-src/ext/mysqlnd/mysqlnd.c Tue Aug 19 10:42:00 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd.c,v 1.26 2008/08/19 10:15:56 johannes Exp $ */ +/* $Id: mysqlnd.c,v 1.27 2008/08/19 10:42:00 johannes Exp $ */ #include php.h #include mysqlnd.h #include mysqlnd_wireprotocol.h @@ -58,9 +58,9 @@ -const char * mysqlnd_old_passwd = mysqlnd cannot connect to MySQL 4.1+ using old authentication; -const char * mysqlnd_server_gone = MySQL server has gone away; -const char * mysqlnd_out_of_sync = Commands out of sync; you can't run this command now; +const char * const mysqlnd_old_passwd = mysqlnd cannot connect to MySQL 4.1+ using old authentication; +const char * const mysqlnd_server_gone = MySQL server has gone away; +const char * const mysqlnd_out_of_sync = Commands out of sync; you can't run this command now; MYSQLND_STATS *mysqlnd_global_stats = NULL; static zend_bool mysqlnd_library_initted = FALSE; http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_priv.h?r1=1.15r2=1.16diff_format=u Index: php-src/ext/mysqlnd/mysqlnd_priv.h diff -u php-src/ext/mysqlnd/mysqlnd_priv.h:1.15 php-src/ext/mysqlnd/mysqlnd_priv.h:1.16 --- php-src/ext/mysqlnd/mysqlnd_priv.h:1.15 Thu Apr 24 14:04:58 2008 +++ php-src/ext/mysqlnd/mysqlnd_priv.h Tue Aug 19 10:42:00 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd_priv.h,v 1.15 2008/04/24 14:04:58 andrey Exp $ */ +/* $Id: mysqlnd_priv.h,v 1.16 2008/08/19 10:42:00 johannes Exp $ */ #ifndef MYSQLND_PRIV_H #define MYSQLND_PRIV_H @@ -163,8 +163,9 @@ extern struct st_mysqlnd_perm_bind mysqlnd_ps_fetch_functions[MYSQL_TYPE_LAST + 1]; -extern const char * mysqlnd_out_of_sync; -extern const char * mysqlnd_server_gone; +extern const char * const mysqlnd_old_passwd; +extern const char * const mysqlnd_out_of_sync; +extern const char * const mysqlnd_server_gone; enum_func_status mysqlnd_handle_local_infile(MYSQLND *conn, const char *filename, zend_bool *is_warning TSRMLS_DC); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd.c mysqlnd.h mysqlnd_enum_n_def.h mysqlnd_libmysql_compat.h mysqlnd_result.c mysqlnd_statistics.c php_mysqlnd.c
andrey Wed May 7 15:16:27 2008 UTC Modified files: /php-src/ext/mysqlndmysqlnd.c mysqlnd.h mysqlnd_enum_n_def.h mysqlnd_libmysql_compat.h mysqlnd_result.c mysqlnd_statistics.c php_mysqlnd.c Log: Update mysqlnd - new ini variable http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.22r2=1.23diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.c diff -u php-src/ext/mysqlnd/mysqlnd.c:1.22 php-src/ext/mysqlnd/mysqlnd.c:1.23 --- php-src/ext/mysqlnd/mysqlnd.c:1.22 Thu Apr 24 14:04:58 2008 +++ php-src/ext/mysqlnd/mysqlnd.c Wed May 7 15:16:27 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd.c,v 1.22 2008/04/24 14:04:58 andrey Exp $ */ +/* $Id: mysqlnd.c,v 1.23 2008/05/07 15:16:27 andrey Exp $ */ #include php.h #include mysqlnd.h #include mysqlnd_wireprotocol.h @@ -1390,7 +1390,7 @@ } /* }}} */ - +#if !defined(MYSQLND_USE_OPTIMISATIONS) || MYSQLND_USE_OPTIMISATIONS == 0 /* {{{ mysqlnd_get_client_info */ PHPAPI const char * mysqlnd_get_client_info() { @@ -1405,7 +1405,7 @@ return MYSQLND_VERSION_ID; } /* }}} */ - +#endif /* {{{ mysqlnd_conn::get_server_info */ static const char * http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.h?r1=1.16r2=1.17diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.h diff -u php-src/ext/mysqlnd/mysqlnd.h:1.16 php-src/ext/mysqlnd/mysqlnd.h:1.17 --- php-src/ext/mysqlnd/mysqlnd.h:1.16 Thu Apr 24 14:04:58 2008 +++ php-src/ext/mysqlnd/mysqlnd.h Wed May 7 15:16:27 2008 @@ -18,13 +18,13 @@ +--+ */ -/* $Id: mysqlnd.h,v 1.16 2008/04/24 14:04:58 andrey Exp $ */ +/* $Id: mysqlnd.h,v 1.17 2008/05/07 15:16:27 andrey Exp $ */ #ifndef MYSQLND_H #define MYSQLND_H -#define MYSQLND_VERSION mysqlnd 5.0.3-dev - 080129 - $Revision: 1.16 $ -#define MYSQLND_VERSION_ID 50002 +#define MYSQLND_VERSION mysqlnd 5.0.4-dev - 080501 - $Revision: 1.17 $ +#define MYSQLND_VERSION_ID 50004 /* This forces inlining of some accessor functions */ #define MYSQLND_USE_OPTIMISATIONS 0 @@ -138,13 +138,13 @@ #define mysqlnd_get_proto_info(conn) (conn)-protocol_version #define mysqlnd_thread_id(conn)(conn)-thread_id -#define mysqlnd_num_rows(result) ((result)-data? (result)-data-row_count:0) +#define mysqlnd_num_rows(result) ((result)-stored_data? (result)-stored_data-row_count:0) #define mysqlnd_num_fields(result) (result)-field_count #define mysqlnd_fetch_lengths(result) ((result)-m.fetch_lengths? (result)-m.fetch_lengths((result)):NULL) #define mysqlnd_field_seek(result, ofs) (result)-m.seek_field((result), (ofs)) -#define mysqlnd_field_tell(result) (result)-meta? (result)-meta-current_field:0) +#define mysqlnd_field_tell(result) ((result)-meta? (result)-meta-current_field:0) #define mysqlnd_fetch_field(result) (result)-m.fetch_field((result) TSRMLS_CC) #define mysqlnd_fetch_field_direct(result,fnr) ((result)-meta? ((result)-meta-fields[(fnr)]):NULL) #define mysqlnd_fetch_fields(result) ((result)-meta? (result)-meta-fields: NULL) @@ -358,6 +358,7 @@ MYSQLND_DEBUG *dbg; /* The DBG object */ longnet_cmd_buffer_size; longnet_read_buffer_size; + longlog_mask; #ifdef MYSQLND_THREADED THREAD_Tthread_id; #endif http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_enum_n_def.h?r1=1.7r2=1.8diff_format=u Index: php-src/ext/mysqlnd/mysqlnd_enum_n_def.h diff -u php-src/ext/mysqlnd/mysqlnd_enum_n_def.h:1.7 php-src/ext/mysqlnd/mysqlnd_enum_n_def.h:1.8 --- php-src/ext/mysqlnd/mysqlnd_enum_n_def.h:1.7Thu Apr 24 14:04:58 2008 +++ php-src/ext/mysqlnd/mysqlnd_enum_n_def.hWed May 7 15:16:27 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd_enum_n_def.h,v 1.7 2008/04/24 14:04:58 andrey Exp $ */ +/* $Id: mysqlnd_enum_n_def.h,v 1.8 2008/05/07 15:16:27 andrey Exp $ */ #ifndef MYSQLND_ENUM_N_DEF_H #define MYSQLND_ENUM_N_DEF_H @@ -31,8 +31,8 @@ #define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */ #define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */ #define SERVER_MORE_RESULTS_EXISTS 8 /* Multi query - next query exists */ -#define MYSQLND_SERVER_QUERY_NO_GOOD_INDEX_USED16 -#define MYSQLND_SERVER_QUERY_NO_INDEX_USED 32 +#define SERVER_QUERY_NO_GOOD_INDEX_USED16 +#define SERVER_QUERY_NO_INDEX_USED 32 /* The server was able to fulfill
[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd.c mysqlnd.h mysqlnd_block_alloc.c mysqlnd_block_alloc.h mysqlnd_debug.c mysqlnd_debug.h mysqlnd_enum_n_def.h mysqlnd_palloc.c mysqlnd_palloc.h mysqlnd_priv.
andrey Thu Feb 14 12:51:00 2008 UTC Modified files: /php-src/ext/mysqlndmysqlnd.c mysqlnd.h mysqlnd_block_alloc.c mysqlnd_block_alloc.h mysqlnd_debug.c mysqlnd_debug.h mysqlnd_enum_n_def.h mysqlnd_palloc.c mysqlnd_palloc.h mysqlnd_priv.h mysqlnd_ps.c mysqlnd_ps_codec.c mysqlnd_qcache.c mysqlnd_result.c mysqlnd_result.h mysqlnd_result_meta.c mysqlnd_result_meta.h mysqlnd_statistics.c mysqlnd_statistics.h mysqlnd_structs.h mysqlnd_wireprotocol.c mysqlnd_wireprotocol.h php_mysqlnd.c php_mysqlnd.h Log: Update mysqlnd - fix bg_store http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.18r2=1.19diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.c diff -u php-src/ext/mysqlnd/mysqlnd.c:1.18 php-src/ext/mysqlnd/mysqlnd.c:1.19 --- php-src/ext/mysqlnd/mysqlnd.c:1.18 Mon Feb 11 16:45:15 2008 +++ php-src/ext/mysqlnd/mysqlnd.c Thu Feb 14 12:51:00 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd.c,v 1.18 2008/02/11 16:45:15 andrey Exp $ */ +/* $Id: mysqlnd.c,v 1.19 2008/02/14 12:51:00 andrey Exp $ */ #include php.h #include mysqlnd.h #include mysqlnd_wireprotocol.h @@ -546,7 +546,7 @@ PACKET_INIT_ALLOCA(greet_packet, PROT_GREET_PACKET); - PACKET_INIT(auth_packet, PROT_AUTH_PACKET, php_mysql_packet_auth *); + PACKET_INIT(auth_packet, PROT_AUTH_PACKET, php_mysql_packet_auth *, FALSE); PACKET_INIT_ALLOCA(ok_packet, PROT_OK_PACKET); if (!conn) { @@ -851,7 +851,7 @@ FALSE TSRMLS_CC)) { DBG_RETURN(FAIL); } - + CONN_SET_STATE(conn, CONN_QUERY_SENT); /* Here read the result set. We don't do it in simple_command because it need information from the ok packet. We will fetch it ourselves. @@ -1340,6 +1340,7 @@ #ifdef MYSQLND_THREADED tsrm_mutex_lock(conn-LOCK_state); #endif + DBG_INF_FMT(New state=%d, new_state); conn-state = new_state; #ifdef MYSQLND_THREADED tsrm_mutex_unlock(conn-LOCK_state); http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.h?r1=1.11r2=1.12diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.h diff -u php-src/ext/mysqlnd/mysqlnd.h:1.11 php-src/ext/mysqlnd/mysqlnd.h:1.12 --- php-src/ext/mysqlnd/mysqlnd.h:1.11 Mon Feb 11 16:45:15 2008 +++ php-src/ext/mysqlnd/mysqlnd.h Thu Feb 14 12:51:00 2008 @@ -18,12 +18,12 @@ +--+ */ -/* $Id: mysqlnd.h,v 1.11 2008/02/11 16:45:15 andrey Exp $ */ +/* $Id: mysqlnd.h,v 1.12 2008/02/14 12:51:00 andrey Exp $ */ #ifndef MYSQLND_H #define MYSQLND_H -#define MYSQLND_VERSION mysqlnd 5.0.3-dev - 080129 - $Revision: 1.11 $ +#define MYSQLND_VERSION mysqlnd 5.0.3-dev - 080129 - $Revision: 1.12 $ #define MYSQLND_VERSION_ID 50002 /* This forces inlining of some accessor functions */ @@ -346,6 +346,9 @@ MYSQLND_DEBUG *dbg; /* The DBG object */ longnet_cmd_buffer_size; longnet_read_buffer_size; +#ifdef ZTS + THREAD_Tthread_id; +#endif ZEND_END_MODULE_GLOBALS(mysqlnd) ZEND_EXTERN_MODULE_GLOBALS(mysqlnd); http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_block_alloc.c?r1=1.4r2=1.5diff_format=u Index: php-src/ext/mysqlnd/mysqlnd_block_alloc.c diff -u php-src/ext/mysqlnd/mysqlnd_block_alloc.c:1.4 php-src/ext/mysqlnd/mysqlnd_block_alloc.c:1.5 --- php-src/ext/mysqlnd/mysqlnd_block_alloc.c:1.4 Mon Feb 4 17:32:43 2008 +++ php-src/ext/mysqlnd/mysqlnd_block_alloc.c Thu Feb 14 12:51:00 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd_block_alloc.c,v 1.4 2008/02/04 17:32:43 andrey Exp $ */ +/* $Id: mysqlnd_block_alloc.c,v 1.5 2008/02/14 12:51:00 andrey Exp $ */ #include php.h #include mysqlnd.h http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_block_alloc.h?r1=1.2r2=1.3diff_format=u Index: php-src/ext/mysqlnd/mysqlnd_block_alloc.h diff -u php-src/ext/mysqlnd/mysqlnd_block_alloc.h:1.2 php-src/ext/mysqlnd/mysqlnd_block_alloc.h:1.3 --- php-src/ext/mysqlnd/mysqlnd_block_alloc.h:1.2 Mon Jan 28 22:54:21 2008 +++ php-src/ext/mysqlnd/mysqlnd_block_alloc.h Thu Feb 14 12:51:00 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd_block_alloc.h,v 1.2 2008/01/28 22:54:21 andrey Exp $ */ +/* $Id: mysqlnd_block_alloc.h,v 1.3 2008/02/14 12:51:00 andrey Exp $ */ #ifndef
[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd.c
andrey Mon Feb 4 17:55:51 2008 UTC Modified files: /php-src/ext/mysqlndmysqlnd.c Log: MFB: Simplify unique string generation and plug a leak. http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.16r2=1.17diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.c diff -u php-src/ext/mysqlnd/mysqlnd.c:1.16 php-src/ext/mysqlnd/mysqlnd.c:1.17 --- php-src/ext/mysqlnd/mysqlnd.c:1.16 Tue Jan 29 18:13:12 2008 +++ php-src/ext/mysqlnd/mysqlnd.c Mon Feb 4 17:55:51 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd.c,v 1.16 2008/01/29 18:13:12 andrey Exp $ */ +/* $Id: mysqlnd.c,v 1.17 2008/02/04 17:55:51 andrey Exp $ */ #include php.h #include mysqlnd.h #include mysqlnd_wireprotocol.h @@ -28,8 +28,6 @@ #include mysqlnd_charset.h #include mysqlnd_debug.h #include mysqlnd_block_alloc.h -#include ext/standard/basic_functions.h -#include ext/standard/php_lcg.h /* the server doesn't support 4byte utf8, but let's make it forward compatible */ #define MYSQLND_MAX_ALLOWED_USER_LEN 256 /* 64 char * 4byte */ @@ -544,15 +542,6 @@ } DBG_INF_FMT(transport=%p, transport); - if (conn-persistent) { - struct timeval tv; - gettimeofday(tv, NULL); - /* We should generate something unique */ - hashed_details_len = spprintf(hashed_details, 0, [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED], - transport, user, db, tv.tv_sec, (long int)tv.tv_usec, - php_combined_lcg(TSRMLS_C) * 10); - DBG_INF_FMT(hashed_details=%s, hashed_details); - } PACKET_INIT_ALLOCA(greet_packet, PROT_GREET_PACKET); PACKET_INIT(auth_packet, PROT_AUTH_PACKET, php_mysql_packet_auth *); @@ -563,6 +552,19 @@ self_alloced = TRUE; } + if (conn-persistent) { +#if 0 + struct timeval tv; + gettimeofday(tv, NULL); + /* We should generate something unique */ + hashed_details_len = spprintf(hashed_details, 0, [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED], + transport, user, db, tv.tv_sec, (long int)tv.tv_usec, + php_combined_lcg(TSRMLS_C) * 10); +#endif + hashed_details_len = spprintf(hashed_details, 0, %p, conn); + DBG_INF_FMT(hashed_details=%s, hashed_details); + } + CONN_SET_STATE(conn, CONN_ALLOCED); conn-net.packet_no = 0; @@ -584,6 +586,9 @@ DBG_INF_FMT(stream=%p, conn-net.stream); if (errstr || !conn-net.stream) { + if (hashed_details) { + mnd_efree(hashed_details); + } goto err; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd.c mysqlnd_statistics.c mysqlnd_statistics.h
andrey Tue Jan 29 12:00:52 2008 UTC Modified files: /php-src/ext/mysqlndmysqlnd.c mysqlnd_statistics.c mysqlnd_statistics.h Log: Moved initialization into a separate function http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.14r2=1.15diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.c diff -u php-src/ext/mysqlnd/mysqlnd.c:1.14 php-src/ext/mysqlnd/mysqlnd.c:1.15 --- php-src/ext/mysqlnd/mysqlnd.c:1.14 Mon Jan 28 23:24:05 2008 +++ php-src/ext/mysqlnd/mysqlnd.c Tue Jan 29 12:00:52 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd.c,v 1.14 2008/01/28 23:24:05 andrey Exp $ */ +/* $Id: mysqlnd.c,v 1.15 2008/01/29 12:00:52 andrey Exp $ */ #include php.h #include mysqlnd.h #include mysqlnd_wireprotocol.h @@ -133,10 +133,7 @@ mysqlnd_library_initted = TRUE; _mysqlnd_init_ps_subsystem(); /* Should be calloc, as mnd_calloc will reference LOCK_access*/ - mysqlnd_global_stats = calloc(1, sizeof(MYSQLND_STATS)); -#ifdef ZTS - mysqlnd_global_stats-LOCK_access = tsrm_mutex_alloc(); -#endif + mysqlnd_stats_init(mysqlnd_global_stats); } } /* }}} */ @@ -146,11 +143,7 @@ void mysqlnd_library_end(TSRMLS_D) { if (mysqlnd_library_initted == TRUE) { -#ifdef ZTS - tsrm_mutex_free(mysqlnd_global_stats-LOCK_access); -#endif - /* mnd_free will reference LOCK_access and crash...*/ - free(mysqlnd_global_stats); + mysqlnd_stats_end(mysqlnd_global_stats); mysqlnd_global_stats = NULL; mysqlnd_library_initted = FALSE; } http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_statistics.c?r1=1.3r2=1.4diff_format=u Index: php-src/ext/mysqlnd/mysqlnd_statistics.c diff -u php-src/ext/mysqlnd/mysqlnd_statistics.c:1.3 php-src/ext/mysqlnd/mysqlnd_statistics.c:1.4 --- php-src/ext/mysqlnd/mysqlnd_statistics.c:1.3Mon Dec 31 07:12:12 2007 +++ php-src/ext/mysqlnd/mysqlnd_statistics.cTue Jan 29 12:00:52 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd_statistics.c,v 1.3 2007/12/31 07:12:12 sebastian Exp $ */ +/* $Id: mysqlnd_statistics.c,v 1.4 2008/01/29 12:00:52 andrey Exp $ */ #include php.h #include mysqlnd.h #include mysqlnd_priv.h @@ -145,6 +145,32 @@ /* }}} */ +/* {{{ mysqlnd_stats_init */ +void +mysqlnd_stats_init(MYSQLND_STATS ** stats) +{ + *stats = calloc(1, sizeof(MYSQLND_STATS)); +#ifdef ZTS + (*stats)-LOCK_access = tsrm_mutex_alloc(); +#endif + +} +/* }}} */ + + +/* {{{ mysqlnd_stats_end */ +void +mysqlnd_stats_end(MYSQLND_STATS * stats) +{ +#ifdef ZTS + tsrm_mutex_free(stats-LOCK_access); +#endif + /* mnd_free will reference LOCK_access and crash...*/ + free(stats); +} +/* }}} */ + + /* * Local variables: * tab-width: 4 http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_statistics.h?r1=1.6r2=1.7diff_format=u Index: php-src/ext/mysqlnd/mysqlnd_statistics.h diff -u php-src/ext/mysqlnd/mysqlnd_statistics.h:1.6 php-src/ext/mysqlnd/mysqlnd_statistics.h:1.7 --- php-src/ext/mysqlnd/mysqlnd_statistics.h:1.6Wed Jan 2 21:16:46 2008 +++ php-src/ext/mysqlnd/mysqlnd_statistics.hTue Jan 29 12:00:52 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd_statistics.h,v 1.6 2008/01/02 21:16:46 andrey Exp $ */ +/* $Id: mysqlnd_statistics.h,v 1.7 2008/01/29 12:00:52 andrey Exp $ */ #ifndef MYSQLND_STATISTICS_H #define MYSQLND_STATISTICS_H @@ -196,6 +196,10 @@ void mysqlnd_fill_stats_hash(const MYSQLND_STATS * const stats, zval *return_value TSRMLS_DC ZEND_FILE_LINE_DC); + +void mysqlnd_stats_init(MYSQLND_STATS ** stats); +void mysqlnd_stats_end(MYSQLND_STATS * stats); + #endif /* MYSQLND_STATISTICS_H */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd.c mysqlnd.h mysqlnd_charset.c mysqlnd_charset.h mysqlnd_libmysql_compat.h mysqlnd_loaddata.c mysqlnd_palloc.c mysqlnd_portability.h mysqlnd_priv.h mysqlnd_p
andrey Wed Jan 23 19:09:33 2008 UTC Modified files: /php-src/ext/mysqlndmysqlnd.c mysqlnd.h mysqlnd_charset.c mysqlnd_charset.h mysqlnd_libmysql_compat.h mysqlnd_loaddata.c mysqlnd_palloc.c mysqlnd_portability.h mysqlnd_priv.h mysqlnd_ps.c mysqlnd_result.c mysqlnd_result_meta.c mysqlnd_structs.h mysqlnd_wireprotocol.c mysqlnd_wireprotocol.h Log: Merge with internal version http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.10r2=1.11diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.c diff -u php-src/ext/mysqlnd/mysqlnd.c:1.10 php-src/ext/mysqlnd/mysqlnd.c:1.11 --- php-src/ext/mysqlnd/mysqlnd.c:1.10 Tue Jan 8 13:13:39 2008 +++ php-src/ext/mysqlnd/mysqlnd.c Wed Jan 23 19:09:33 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd.c,v 1.10 2008/01/08 13:13:39 andrey Exp $ */ +/* $Id: mysqlnd.c,v 1.11 2008/01/23 19:09:33 andrey Exp $ */ #include php.h #include mysqlnd.h #include mysqlnd_wireprotocol.h @@ -67,7 +67,7 @@ static zend_bool mysqlnd_library_initted = FALSE; -enum_func_status mysqlnd_send_close(MYSQLND * conn TSRMLS_DC); +static enum_func_status mysqlnd_send_close(MYSQLND * conn TSRMLS_DC); /* {{{ mysqlnd_library_init */ static @@ -454,11 +454,11 @@ /* {{{ mysqlnd_connect */ PHPAPI MYSQLND *mysqlnd_connect(MYSQLND *conn, -char *host, char *user, -char *passwd, unsigned int passwd_len, -char *db, unsigned int db_len, +const char *host, const char *user, +const char *passwd, unsigned int passwd_len, +const char *db, unsigned int db_len, unsigned int port, -char *socket, +const char *socket, unsigned int mysql_flags, MYSQLND_THD_ZVAL_PCACHE *zval_cache TSRMLS_DC) @@ -949,7 +949,7 @@ /* {{{ mysqlnd_old_escape_string */ -PHPAPI ulong mysqlnd_old_escape_string(char *newstr, const char *escapestr, int escapestr_len TSRMLS_DC) +PHPAPI ulong mysqlnd_old_escape_string(char *newstr, const char *escapestr, size_t escapestr_len TSRMLS_DC) { DBG_ENTER(mysqlnd_old_escape_string); DBG_RETURN(mysqlnd_cset_escape_slashes(mysqlnd_find_charset_name(latin1), @@ -961,7 +961,7 @@ /* {{{ mysqlnd_conn::escape_string */ static ulong MYSQLND_METHOD(mysqlnd_conn, escape_string)(const MYSQLND * const conn, char *newstr, - const char *escapestr, int escapestr_len TSRMLS_DC) + const char *escapestr, size_t escapestr_len TSRMLS_DC) { DBG_ENTER(mysqlnd_conn::escape_string); DBG_INF_FMT(conn=%llu, conn-thread_id); @@ -1088,7 +1088,7 @@ /* }}} */ -/* {{{ _mysqlnd_conn::set_charset */ +/* {{{ mysqlnd_conn::set_charset */ static enum_func_status MYSQLND_METHOD(mysqlnd_conn, set_charset)(MYSQLND * const conn, const char * const csname TSRMLS_DC) { @@ -1696,8 +1696,8 @@ /* }}} */ -/* {{{ _mysqlnd_conn::use_result */ -MYSQLND_RES * +/* {{{ mysqlnd_conn::use_result */ +static MYSQLND_RES * MYSQLND_METHOD(mysqlnd_conn, use_result)(MYSQLND * const conn TSRMLS_DC) { MYSQLND_RES *result; @@ -1729,8 +1729,8 @@ /* }}} */ -/* {{{ _mysqlnd_conn::store_result */ -MYSQLND_RES * +/* {{{ mysqlnd_conn::store_result */ +static MYSQLND_RES * MYSQLND_METHOD(mysqlnd_conn, store_result)(MYSQLND * const conn TSRMLS_DC) { MYSQLND_RES *result; @@ -1762,7 +1762,7 @@ /* {{{ mysqlnd_conn::get_connection_stats */ -void +static void MYSQLND_METHOD(mysqlnd_conn, get_connection_stats)(const MYSQLND * const conn, zval *return_value TSRMLS_DC ZEND_FILE_LINE_DC) http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.h?r1=1.6r2=1.7diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.h diff -u php-src/ext/mysqlnd/mysqlnd.h:1.6 php-src/ext/mysqlnd/mysqlnd.h:1.7 --- php-src/ext/mysqlnd/mysqlnd.h:1.6 Tue Jan 8 13:13:39 2008 +++ php-src/ext/mysqlnd/mysqlnd.h Wed Jan 23 19:09:33 2008 @@ -18,12
[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd.c mysqlnd.h mysqlnd_loaddata.c mysqlnd_priv.h mysqlnd_result.c mysqlnd_structs.h mysqlnd_wireprotocol.c
andrey Tue Jan 8 13:13:39 2008 UTC Modified files: /php-src/ext/mysqlndmysqlnd.c mysqlnd.h mysqlnd_loaddata.c mysqlnd_priv.h mysqlnd_result.c mysqlnd_structs.h mysqlnd_wireprotocol.c Log: strncpy-strlcpy http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.9r2=1.10diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.c diff -u php-src/ext/mysqlnd/mysqlnd.c:1.9 php-src/ext/mysqlnd/mysqlnd.c:1.10 --- php-src/ext/mysqlnd/mysqlnd.c:1.9 Wed Jan 2 21:16:46 2008 +++ php-src/ext/mysqlnd/mysqlnd.c Tue Jan 8 13:13:39 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd.c,v 1.9 2008/01/02 21:16:46 andrey Exp $ */ +/* $Id: mysqlnd.c,v 1.10 2008/01/08 13:13:39 andrey Exp $ */ #include php.h #include mysqlnd.h #include mysqlnd_wireprotocol.h @@ -676,14 +676,14 @@ } else if (ok_packet.field_count == 0xFF) { if (ok_packet.sqlstate[0]) { if (!self_alloced) { - strncpy(conn-error_info.sqlstate, ok_packet.sqlstate, sizeof(conn-error_info.sqlstate)); + strlcpy(conn-error_info.sqlstate, ok_packet.sqlstate, sizeof(conn-error_info.sqlstate)); } DBG_ERR_FMT(ERROR:%d [SQLSTATE:%s] %s, ok_packet.error_no, ok_packet.sqlstate, ok_packet.error); } if (!self_alloced) { conn-error_info.error_no = ok_packet.error_no; - strncpy(conn-error_info.error, ok_packet.error, sizeof(conn-error_info.error)); + strlcpy(conn-error_info.error, ok_packet.error, sizeof(conn-error_info.error)); } } } else { http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.h?r1=1.5r2=1.6diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.h diff -u php-src/ext/mysqlnd/mysqlnd.h:1.5 php-src/ext/mysqlnd/mysqlnd.h:1.6 --- php-src/ext/mysqlnd/mysqlnd.h:1.5 Wed Jan 2 21:16:46 2008 +++ php-src/ext/mysqlnd/mysqlnd.h Tue Jan 8 13:13:39 2008 @@ -18,12 +18,12 @@ +--+ */ -/* $Id: mysqlnd.h,v 1.5 2008/01/02 21:16:46 andrey Exp $ */ +/* $Id: mysqlnd.h,v 1.6 2008/01/08 13:13:39 andrey Exp $ */ #ifndef MYSQLND_H #define MYSQLND_H -#define MYSQLND_VERSION mysqlnd 5.0.2-dev - 070928 - $Revision: 1.5 $ +#define MYSQLND_VERSION mysqlnd 5.0.2-dev - 070928 - $Revision: 1.6 $ #define MYSQLND_VERSION_ID 50002 /* This forces inlining of some accessor functions */ http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_loaddata.c?r1=1.3r2=1.4diff_format=u Index: php-src/ext/mysqlnd/mysqlnd_loaddata.c diff -u php-src/ext/mysqlnd/mysqlnd_loaddata.c:1.3 php-src/ext/mysqlnd/mysqlnd_loaddata.c:1.4 --- php-src/ext/mysqlnd/mysqlnd_loaddata.c:1.3 Mon Dec 31 07:12:12 2007 +++ php-src/ext/mysqlnd/mysqlnd_loaddata.c Tue Jan 8 13:13:39 2008 @@ -113,7 +113,7 @@ DBG_ENTER(mysqlnd_local_infile_error); if (info) { - strncpy(error_buf, info-error_msg, error_buf_len); + strlcpy(error_buf, info-error_msg, error_buf_len); DBG_INF_FMT(have info, %d, info-error_no); DBG_RETURN(info-error_no); } http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_priv.h?r1=1.7r2=1.8diff_format=u Index: php-src/ext/mysqlnd/mysqlnd_priv.h diff -u php-src/ext/mysqlnd/mysqlnd_priv.h:1.7 php-src/ext/mysqlnd/mysqlnd_priv.h:1.8 --- php-src/ext/mysqlnd/mysqlnd_priv.h:1.7 Wed Jan 2 21:16:46 2008 +++ php-src/ext/mysqlnd/mysqlnd_priv.h Tue Jan 8 13:13:39 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd_priv.h,v 1.7 2008/01/02 21:16:46 andrey Exp $ */ +/* $Id: mysqlnd_priv.h,v 1.8 2008/01/08 13:13:39 andrey Exp $ */ #ifndef MYSQLND_PRIV_H #define MYSQLND_PRIV_H @@ -143,7 +143,7 @@ { \ error_info.error_no = 0; \ error_info.error[0] = '\0'; \ - strncpy(error_info.sqlstate, 0, sizeof(0) - 1); \ + strlcpy(error_info.sqlstate, 0, sizeof(error_info.sqlstate)); \ } #define SET_CLIENT_ERROR(error_info, a, b, c) \ http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_result.c?r1=1.8r2=1.9diff_format=u Index: php-src/ext/mysqlnd/mysqlnd_result.c diff -u php-src/ext/mysqlnd/mysqlnd_result.c:1.8 php-src/ext/mysqlnd/mysqlnd_result.c:1.9 --- php-src/ext/mysqlnd/mysqlnd_result.c:1.8Wed Jan 2 21:16:46 2008 +++ php-src/ext/mysqlnd/mysqlnd_result.cTue Jan 8 13:13:39 2008 @@ -18,7 +18,7 @@
[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd.c mysqlnd.h mysqlnd_libmysql_compat.h mysqlnd_portability.h mysqlnd_priv.h mysqlnd_ps.c mysqlnd_ps_codec.c mysqlnd_result.c mysqlnd_statistics.h mysqlnd_str
andrey Wed Jan 2 21:16:46 2008 UTC Modified files: /php-src/ext/mysqlndmysqlnd.c mysqlnd.h mysqlnd_libmysql_compat.h mysqlnd_portability.h mysqlnd_priv.h mysqlnd_ps.c mysqlnd_ps_codec.c mysqlnd_result.c mysqlnd_statistics.h mysqlnd_structs.h mysqlnd_wireprotocol.c mysqlnd_wireprotocol.h Log: - Fix problems with double definitions - Clean up a bit a type mess - 4 types less. No need to have aliases for the same thing (unification is the name). - New macro for Johannes mysqlnd_stmt_ro_result_metadata -- http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.8r2=1.9diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.c diff -u php-src/ext/mysqlnd/mysqlnd.c:1.8 php-src/ext/mysqlnd/mysqlnd.c:1.9 --- php-src/ext/mysqlnd/mysqlnd.c:1.8 Mon Dec 31 07:12:12 2007 +++ php-src/ext/mysqlnd/mysqlnd.c Wed Jan 2 21:16:46 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd.c,v 1.8 2007/12/31 07:12:12 sebastian Exp $ */ +/* $Id: mysqlnd.c,v 1.9 2008/01/02 21:16:46 andrey Exp $ */ #include php.h #include mysqlnd.h #include mysqlnd_wireprotocol.h @@ -1283,7 +1283,7 @@ /* {{{ mysqlnd_conn::insert_id */ -static mynd_ulonglong +static uint64 MYSQLND_METHOD(mysqlnd_conn, insert_id)(const MYSQLND * const conn) { return conn-upsert_status.last_insert_id; @@ -1292,7 +1292,7 @@ /* {{{ mysqlnd_conn::affected_rows */ -static mynd_ulonglong +static uint64 MYSQLND_METHOD(mysqlnd_conn, affected_rows)(const MYSQLND * const conn) { return conn-upsert_status.affected_rows; @@ -1371,7 +1371,7 @@ /* {{{ mysqlnd_conn::thread_id */ -static mynd_ulonglong +static uint64 MYSQLND_METHOD(mysqlnd_conn, thread_id)(const MYSQLND * const conn) { return conn-thread_id; @@ -1425,7 +1425,7 @@ } SET_EMPTY_ERROR(conn-error_info); - conn-upsert_status.affected_rows= ~(mynd_ulonglong) 0; + SET_ERROR_AFF_ROWS(conn); /* We are sure that there is a result set, since conn-state is set accordingly in mysqlnd_store_result() or mysqlnd_fetch_row_unbuffered() http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.h?r1=1.4r2=1.5diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.h diff -u php-src/ext/mysqlnd/mysqlnd.h:1.4 php-src/ext/mysqlnd/mysqlnd.h:1.5 --- php-src/ext/mysqlnd/mysqlnd.h:1.4 Mon Dec 31 07:12:12 2007 +++ php-src/ext/mysqlnd/mysqlnd.h Wed Jan 2 21:16:46 2008 @@ -18,12 +18,12 @@ +--+ */ -/* $Id: mysqlnd.h,v 1.4 2007/12/31 07:12:12 sebastian Exp $ */ +/* $Id: mysqlnd.h,v 1.5 2008/01/02 21:16:46 andrey Exp $ */ #ifndef MYSQLND_H #define MYSQLND_H -#define MYSQLND_VERSION mysqlnd 5.0.2-dev - 070928 - $Revision: 1.4 $ +#define MYSQLND_VERSION mysqlnd 5.0.2-dev - 070928 - $Revision: 1.5 $ #define MYSQLND_VERSION_ID 50002 /* This forces inlining of some accessor functions */ @@ -250,6 +250,7 @@ #define mysqlnd_stmt_bind_result(stmt,bind)(stmt)-m-bind_result((stmt), (bind) TSRMLS_CC) #define mysqlnd_stmt_param_metadata(stmt) (stmt)-m-get_parameter_metadata((stmt)) #define mysqlnd_stmt_result_metadata(stmt) (stmt)-m-get_result_metadata((stmt) TSRMLS_CC) +#define mysqlnd_stmt_ronly_result_metadata(stmt) ((stmt)-result) #definemysqlnd_stmt_free_result(stmt) (stmt)-m-free_result((stmt) TSRMLS_CC) #definemysqlnd_stmt_close(stmt, implicit) (stmt)-m-dtor((stmt), (implicit) TSRMLS_CC) http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_libmysql_compat.h?r1=1.2r2=1.3diff_format=u Index: php-src/ext/mysqlnd/mysqlnd_libmysql_compat.h diff -u php-src/ext/mysqlnd/mysqlnd_libmysql_compat.h:1.2 php-src/ext/mysqlnd/mysqlnd_libmysql_compat.h:1.3 --- php-src/ext/mysqlnd/mysqlnd_libmysql_compat.h:1.2 Mon Dec 31 07:12:12 2007 +++ php-src/ext/mysqlnd/mysqlnd_libmysql_compat.h Wed Jan 2 21:16:46 2008 @@ -31,7 +31,7 @@ #define MYSQL_ROW MYSQLND_ROW #define MYSQL MYSQLND #define my_boolzend_bool -#define my_ulonglong mynd_ulonglong +#define my_ulonglong uint64 #define MYSQL_VERSION_ID MYSQLND_VERSION_ID #define MYSQL_SERVER_VERSION MYSQLND_VERSION http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_portability.h?r1=1.6r2=1.7diff_format=u Index: php-src/ext/mysqlnd/mysqlnd_portability.h diff -u php-src/ext/mysqlnd/mysqlnd_portability.h:1.6 php-src/ext/mysqlnd/mysqlnd_portability.h:1.7 --- php-src/ext/mysqlnd/mysqlnd_portability.h:1.6 Tue Oct 16 20:58:35 2007 +++
[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd.c
andrey Thu Nov 8 17:29:06 2007 UTC Modified files: /php-src/ext/mysqlndmysqlnd.c Log: Fix segfault in debug build http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.6r2=1.7diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.c diff -u php-src/ext/mysqlnd/mysqlnd.c:1.6 php-src/ext/mysqlnd/mysqlnd.c:1.7 --- php-src/ext/mysqlnd/mysqlnd.c:1.6 Tue Oct 23 10:17:39 2007 +++ php-src/ext/mysqlnd/mysqlnd.c Thu Nov 8 17:29:06 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd.c,v 1.6 2007/10/23 10:17:39 andrey Exp $ */ +/* $Id: mysqlnd.c,v 1.7 2007/11/08 17:29:06 andrey Exp $ */ #include php.h #include mysqlnd.h #include mysqlnd_wireprotocol.h @@ -571,6 +571,10 @@ NULL /*ctx*/, errstr, errcode); DBG_INF_FMT(stream=%p, conn-net.stream); + if (errstr || !conn-net.stream) { + goto err; + } + if (hashed_details) { /* If persistent, the streams register it in EG(persistent_list). @@ -597,10 +601,6 @@ mnd_efree(hashed_details); } - if (errstr || !conn-net.stream) { - goto err; - } - if (conn-options.timeout_read) { tv.tv_sec = conn-options.timeout_read; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd.c mysqlnd_debug.h
andrey Tue Oct 23 10:17:39 2007 UTC Modified files: /php-src/ext/mysqlndmysqlnd.c mysqlnd_debug.h Log: MFB: Fix compile failure on windows http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.5r2=1.6diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.c diff -u php-src/ext/mysqlnd/mysqlnd.c:1.5 php-src/ext/mysqlnd/mysqlnd.c:1.6 --- php-src/ext/mysqlnd/mysqlnd.c:1.5 Tue Oct 2 10:43:09 2007 +++ php-src/ext/mysqlnd/mysqlnd.c Tue Oct 23 10:17:39 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd.c,v 1.5 2007/10/02 10:43:09 andrey Exp $ */ +/* $Id: mysqlnd.c,v 1.6 2007/10/23 10:17:39 andrey Exp $ */ #include php.h #include mysqlnd.h #include mysqlnd_wireprotocol.h @@ -2032,7 +2032,7 @@ DBG_ENTER(RSHUTDOWN); if (dbg) { dbg-m-close(dbg); - dbg-m-free(dbg); + dbg-m-free_handle(dbg); MYSQLND_G(dbg) = NULL; } #endif http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_debug.h?r1=1.2r2=1.3diff_format=u Index: php-src/ext/mysqlnd/mysqlnd_debug.h diff -u php-src/ext/mysqlnd/mysqlnd_debug.h:1.2 php-src/ext/mysqlnd/mysqlnd_debug.h:1.3 --- php-src/ext/mysqlnd/mysqlnd_debug.h:1.2 Tue Oct 16 20:58:35 2007 +++ php-src/ext/mysqlnd/mysqlnd_debug.h Tue Oct 23 10:17:39 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd_debug.h,v 1.2 2007/10/16 20:58:35 andrey Exp $ */ +/* $Id: mysqlnd_debug.h,v 1.3 2007/10/23 10:17:39 andrey Exp $ */ #ifndef MYSQLND_DEBUG_H #define MYSQLND_DEBUG_H @@ -39,7 +39,7 @@ char * func_name, uint func_name_len); enum_func_status (*func_leave)(MYSQLND_DEBUG *self, unsigned int line, const char * const file); enum_func_status (*close)(MYSQLND_DEBUG *self); - enum_func_status (*free)(MYSQLND_DEBUG *self); + enum_func_status (*free_handle)(MYSQLND_DEBUG *self); }; struct st_mysqlnd_debug -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/mysqlnd mysqlnd.c mysqlnd.h mysqlnd_portability.h mysqlnd_priv.h mysqlnd_ps.c mysqlnd_ps_codec.c mysqlnd_result.c mysqlnd_result_meta.c mysqlnd_statistics.h mysqlnd_wirepro
andrey Fri Aug 3 16:32:27 2007 UTC Modified files: /php-src/ext/mysqlndmysqlnd.c mysqlnd.h mysqlnd_portability.h mysqlnd_priv.h mysqlnd_ps.c mysqlnd_ps_codec.c mysqlnd_result.c mysqlnd_result_meta.c mysqlnd_statistics.h mysqlnd_wireprotocol.c mysqlnd_wireprotocol.h Log: Update CVS - Fix BIT problem for BIT values represented with 5 bytes. Typo. - Make it possible with an ini variable to switch off/on statistics collection. - Compile-out debug checking of uneaten data from the line, when the build is release. According to callgrind this was eating some percentage. http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.1r2=1.2diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.c diff -u php-src/ext/mysqlnd/mysqlnd.c:1.1 php-src/ext/mysqlnd/mysqlnd.c:1.2 --- php-src/ext/mysqlnd/mysqlnd.c:1.1 Wed Jul 25 23:47:32 2007 +++ php-src/ext/mysqlnd/mysqlnd.c Fri Aug 3 16:32:26 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd.c,v 1.1 2007/07/25 23:47:32 jani Exp $ */ +/* $Id: mysqlnd.c,v 1.2 2007/08/03 16:32:26 andrey Exp $ */ #include php.h #include mysqlnd.h @@ -67,31 +67,37 @@ MYSQLND_STATS *mysqlnd_global_stats = NULL; static zend_bool mysqlnd_library_initted = FALSE; - /* {{{ mysqlnd_library_init */ -PHPAPI void mysqlnd_library_init() +static +void mysqlnd_library_init(zend_bool collect_statistics) { if (mysqlnd_library_initted == FALSE) { mysqlnd_library_initted = TRUE; _mysqlnd_init_ps_subsystem(); - mysqlnd_global_stats = calloc(1, sizeof(MYSQLND_STATS)); + if (collect_statistics) { + mysqlnd_global_stats = calloc(1, sizeof(MYSQLND_STATS)); + #ifdef ZTS - mysqlnd_global_stats-LOCK_access = tsrm_mutex_alloc(); + mysqlnd_global_stats-LOCK_access = tsrm_mutex_alloc(); #endif + } } } /* }}} */ /* {{{ mysqlnd_library_end */ -PHPAPI void mysqlnd_library_end() +static +void mysqlnd_library_end() { if (mysqlnd_library_initted == TRUE) { + if (mysqlnd_global_stats) { #ifdef ZTS - tsrm_mutex_free(mysqlnd_global_stats-LOCK_access); + tsrm_mutex_free(mysqlnd_global_stats-LOCK_access); #endif - free(mysqlnd_global_stats); - mysqlnd_global_stats = NULL; + free(mysqlnd_global_stats); + mysqlnd_global_stats = NULL; + } mysqlnd_library_initted = FALSE; } } @@ -1554,26 +1560,6 @@ /* }}} */ -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(mysqlnd) -{ - mysqlnd_library_init(); - return SUCCESS; -} -/* }}} */ - - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(mysqlnd) -{ - mysqlnd_library_end(); - return SUCCESS; -} -/* }}} */ - - /* {{{ mysqlnd_minfo_print_hash */ #if PHP_MAJOR_VERSION = 6 PHPAPI void mysqlnd_minfo_print_hash(zval *values) @@ -1654,10 +1640,53 @@ /* }}} */ +ZEND_DECLARE_MODULE_GLOBALS(mysqlnd) + +/* {{{ PHP_GINIT_FUNCTION + */ +static PHP_GINIT_FUNCTION(mysqlnd) +{ + mysqlnd_globals-collect_statistics = FALSE; +} +/* }}} */ + + +/* {{{ PHP_INI_BEGIN +*/ +PHP_INI_BEGIN() + STD_PHP_INI_BOOLEAN(mysqlnd.collect_statistics, 1, PHP_INI_SYSTEM, OnUpdateBool, collect_statistics, zend_mysqlnd_globals, mysqlnd_globals) +PHP_INI_END() +/* }}} */ + + +/* {{{ PHP_MINIT_FUNCTION + */ +PHP_MINIT_FUNCTION(mysqlnd) +{ + REGISTER_INI_ENTRIES(); + + mysqlnd_library_init(MYSQLND_G(collect_statistics)); + return SUCCESS; +} +/* }}} */ + + +/* {{{ PHP_MSHUTDOWN_FUNCTION + */ +PHP_MSHUTDOWN_FUNCTION(mysqlnd) +{ + mysqlnd_library_end(); + + UNREGISTER_INI_ENTRIES(); + return SUCCESS; +} +/* }}} */ + + /* {{{ mysqlnd_module_entry */ zend_module_entry mysqlnd_module_entry = { - STANDARD_MODULE_HEADER, + STANDARD_MODULE_HEADER, mysqlnd, mysqlnd_functions, PHP_MINIT(mysqlnd), @@ -1666,7 +1695,11 @@ NULL, PHP_MINFO(mysqlnd), MYSQLND_VERSION, - STANDARD_MODULE_PROPERTIES + PHP_MODULE_GLOBALS(mysqlnd), + PHP_GINIT(mysqlnd), + NULL, + NULL, + STANDARD_MODULE_PROPERTIES_EX }; /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.h?r1=1.1r2=1.2diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.h diff -u php-src/ext/mysqlnd/mysqlnd.h:1.1 php-src/ext/mysqlnd/mysqlnd.h:1.2 --- php-src/ext/mysqlnd/mysqlnd.h:1.1 Wed Jul 25 23:47:32 2007 +++ php-src/ext/mysqlnd/mysqlnd.h Fri Aug 3 16:32:26 2007 @@ -18,12 +18,12 @@ +--+ */ -/* $Id: