[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysqlnd mysqlnd.h mysqlnd_debug.c mysqlnd_result.c
andrey Thu May 28 11:47:48 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/mysqlndmysqlnd.h mysqlnd_debug.c mysqlnd_result.c Log: MFH: Fix a bug with mysqlnd_fetch_field(_direct()). With mysqlnd the optimised function was called, which however, doesn't respect that during store the raw data is not unpacked, to be lazy. The data is unpacked to zvals later, during every row fetch. However, this way max_length won't be calculated correctly. So, if a mysqlnd_fetch_field(_direct) call comes we need to unpack everything and then calculate max_length...and that is expensive, defies our lazy unpacking optimisation. http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.h?r1=1.3.2.22r2=1.3.2.23diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.h diff -u php-src/ext/mysqlnd/mysqlnd.h:1.3.2.22 php-src/ext/mysqlnd/mysqlnd.h:1.3.2.23 --- php-src/ext/mysqlnd/mysqlnd.h:1.3.2.22 Mon Feb 16 17:26:43 2009 +++ php-src/ext/mysqlnd/mysqlnd.h Thu May 28 11:47:48 2009 @@ -18,12 +18,12 @@ +--+ */ -/* $Id: mysqlnd.h,v 1.3.2.22 2009/02/16 17:26:43 johannes Exp $ */ +/* $Id: mysqlnd.h,v 1.3.2.23 2009/05/28 11:47:48 andrey Exp $ */ #ifndef MYSQLND_H #define MYSQLND_H -#define MYSQLND_VERSION mysqlnd 5.0.5-dev - 081106 - $Revision: 1.3.2.22 $ +#define MYSQLND_VERSION mysqlnd 5.0.5-dev - 081106 - $Revision: 1.3.2.23 $ #define MYSQLND_VERSION_ID 50005 /* This forces inlining of some accessor functions */ @@ -158,8 +158,8 @@ #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_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) +#define mysqlnd_fetch_field_direct(result,fnr) (result)-m.fetch_field_direct((result), (fnr) TSRMLS_CC) +#define mysqlnd_fetch_fields(result) (result)-m.fetch_fields((result) TSRMLS_CC) /* mysqlnd metadata */ #define mysqlnd_get_client_info() MYSQLND_VERSION http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_debug.c?r1=1.1.2.15r2=1.1.2.16diff_format=u Index: php-src/ext/mysqlnd/mysqlnd_debug.c diff -u php-src/ext/mysqlnd/mysqlnd_debug.c:1.1.2.15 php-src/ext/mysqlnd/mysqlnd_debug.c:1.1.2.16 --- php-src/ext/mysqlnd/mysqlnd_debug.c:1.1.2.15Mon Mar 30 16:52:33 2009 +++ php-src/ext/mysqlnd/mysqlnd_debug.c Thu May 28 11:47:48 2009 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd_debug.c,v 1.1.2.15 2009/03/30 16:52:33 felipe Exp $ */ +/* $Id: mysqlnd_debug.c,v 1.1.2.16 2009/05/28 11:47:48 andrey Exp $ */ #include php.h #include mysqlnd.h @@ -815,7 +815,7 @@ if (persistent == FALSE) { DBG_INF_FMT(after : %lu, zend_memory_usage(persistent TSRMLS_CC)); } - MYSQLND_INC_GLOBAL_STATISTIC(persistent? STAT_MEM_EREALLOC_COUNT:STAT_MEM_REALLOC_COUNT); + MYSQLND_INC_GLOBAL_STATISTIC(persistent? STAT_MEM_REALLOC_COUNT:STAT_MEM_EREALLOC_COUNT); if (MYSQLND_G(collect_memory_statistics)) { enum mysqlnd_collected_stats s1 = persistent? STAT_MEM_REALLOC_COUNT:STAT_MEM_EREALLOC_COUNT; enum mysqlnd_collected_stats s2 = persistent? STAT_MEM_REALLOC_AMMOUNT:STAT_MEM_EREALLOC_AMMOUNT; http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_result.c?r1=1.4.2.26r2=1.4.2.27diff_format=u Index: php-src/ext/mysqlnd/mysqlnd_result.c diff -u php-src/ext/mysqlnd/mysqlnd_result.c:1.4.2.26 php-src/ext/mysqlnd/mysqlnd_result.c:1.4.2.27 --- php-src/ext/mysqlnd/mysqlnd_result.c:1.4.2.26 Mon Mar 30 16:52:33 2009 +++ php-src/ext/mysqlnd/mysqlnd_result.cThu May 28 11:47:48 2009 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd_result.c,v 1.4.2.26 2009/03/30 16:52:33 felipe Exp $ */ +/* $Id: mysqlnd_result.c,v 1.4.2.27 2009/05/28 11:47:48 andrey Exp $ */ #include php.h #include mysqlnd.h #include mysqlnd_wireprotocol.h @@ -1736,6 +1736,16 @@ { DBG_ENTER(mysqlnd_res::fetch_field); if (result-meta) { + /* + We optimize the result set, so we don't convert all the data from raw buffer format to + zval arrays during store. In the case someone doesn't read all the lines this will + save time. However, when a metadata call is done, we need to calculate max_length. + We don't have control whether max_length will be used, unfortunately. Otherwise we + could have been able to skip
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysqlnd mysqlnd.h mysqlnd_debug.c
johannesWed Apr 23 16:56:51 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/mysqlndmysqlnd.h mysqlnd_debug.c Log: - MFH: Fix Windows build http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.h?r1=1.3.2.12r2=1.3.2.13diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.h diff -u php-src/ext/mysqlnd/mysqlnd.h:1.3.2.12 php-src/ext/mysqlnd/mysqlnd.h:1.3.2.13 --- php-src/ext/mysqlnd/mysqlnd.h:1.3.2.12 Wed Apr 16 12:57:38 2008 +++ php-src/ext/mysqlnd/mysqlnd.h Wed Apr 23 16:56:51 2008 @@ -18,12 +18,12 @@ +--+ */ -/* $Id: mysqlnd.h,v 1.3.2.12 2008/04/16 12:57:38 andrey Exp $ */ +/* $Id: mysqlnd.h,v 1.3.2.13 2008/04/23 16:56:51 johannes Exp $ */ #ifndef MYSQLND_H #define MYSQLND_H -#define MYSQLND_VERSION mysqlnd 5.0.3-dev - 080129 - $Revision: 1.3.2.12 $ +#define MYSQLND_VERSION mysqlnd 5.0.3-dev - 080129 - $Revision: 1.3.2.13 $ #define MYSQLND_VERSION_ID 50002 /* This forces inlining of some accessor functions */ @@ -93,7 +93,7 @@ #define mysqlnd_change_user(conn, user, passwd, db) (conn)-m-change_user((conn), (user), (passwd), (db) TSRMLS_CC) #define mysqlnd_debug(x) _mysqlnd_debug((x) TSRMLS_CC) -void _mysqlnd_debug(const char *mode TSRMLS_DC); +PHPAPI void _mysqlnd_debug(const char *mode TSRMLS_DC); /* Query */ #define mysqlnd_fetch_into(result, flags, ret_val, ext) (result)-m.fetch_into((result), (flags), (ret_val), (ext) TSRMLS_CC ZEND_FILE_LINE_CC) http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_debug.c?r1=1.1.2.8r2=1.1.2.9diff_format=u Index: php-src/ext/mysqlnd/mysqlnd_debug.c diff -u php-src/ext/mysqlnd/mysqlnd_debug.c:1.1.2.8 php-src/ext/mysqlnd/mysqlnd_debug.c:1.1.2.9 --- php-src/ext/mysqlnd/mysqlnd_debug.c:1.1.2.8 Wed Feb 20 15:18:17 2008 +++ php-src/ext/mysqlnd/mysqlnd_debug.c Wed Apr 23 16:56:51 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd_debug.c,v 1.1.2.8 2008/02/20 15:18:17 andrey Exp $ */ +/* $Id: mysqlnd_debug.c,v 1.1.2.9 2008/04/23 16:56:51 johannes Exp $ */ #include php.h #include mysqlnd.h @@ -637,7 +637,7 @@ /* {{{ _mysqlnd_debug */ -void _mysqlnd_debug(const char *mode TSRMLS_DC) +PHPAPI void _mysqlnd_debug(const char *mode TSRMLS_DC) { #ifdef PHP_DEBUG MYSQLND_DEBUG *dbg = MYSQLND_G(dbg); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysqlnd mysqlnd.h mysqlnd_debug.c php_mysqlnd.c
andrey Thu Feb 14 15:20:49 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/mysqlndmysqlnd.h mysqlnd_debug.c php_mysqlnd.c Log: Another fix http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.h?r1=1.3.2.10r2=1.3.2.11diff_format=u Index: php-src/ext/mysqlnd/mysqlnd.h diff -u php-src/ext/mysqlnd/mysqlnd.h:1.3.2.10 php-src/ext/mysqlnd/mysqlnd.h:1.3.2.11 --- php-src/ext/mysqlnd/mysqlnd.h:1.3.2.10 Thu Feb 14 12:49:30 2008 +++ php-src/ext/mysqlnd/mysqlnd.h Thu Feb 14 15:20:49 2008 @@ -18,12 +18,12 @@ +--+ */ -/* $Id: mysqlnd.h,v 1.3.2.10 2008/02/14 12:49:30 andrey Exp $ */ +/* $Id: mysqlnd.h,v 1.3.2.11 2008/02/14 15:20:49 andrey Exp $ */ #ifndef MYSQLND_H #define MYSQLND_H -#define MYSQLND_VERSION mysqlnd 5.0.3-dev - 080129 - $Revision: 1.3.2.10 $ +#define MYSQLND_VERSION mysqlnd 5.0.3-dev - 080129 - $Revision: 1.3.2.11 $ #define MYSQLND_VERSION_ID 50002 /* This forces inlining of some accessor functions */ @@ -346,7 +346,7 @@ MYSQLND_DEBUG *dbg; /* The DBG object */ longnet_cmd_buffer_size; longnet_read_buffer_size; -#ifdef ZTS +#ifdef MYSQLND_THREADED THREAD_Tthread_id; #endif ZEND_END_MODULE_GLOBALS(mysqlnd) http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_debug.c?r1=1.1.2.6r2=1.1.2.7diff_format=u Index: php-src/ext/mysqlnd/mysqlnd_debug.c diff -u php-src/ext/mysqlnd/mysqlnd_debug.c:1.1.2.6 php-src/ext/mysqlnd/mysqlnd_debug.c:1.1.2.7 --- php-src/ext/mysqlnd/mysqlnd_debug.c:1.1.2.6 Thu Feb 14 12:49:30 2008 +++ php-src/ext/mysqlnd/mysqlnd_debug.c Thu Feb 14 15:20:49 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: mysqlnd_debug.c,v 1.1.2.6 2008/02/14 12:49:30 andrey Exp $ */ +/* $Id: mysqlnd_debug.c,v 1.1.2.7 2008/02/14 15:20:49 andrey Exp $ */ #include php.h #include mysqlnd.h @@ -95,7 +95,7 @@ line_buffer[6], level_buffer[7]; MYSQLND_ZTS(self); -#ifdef ZTS +#ifdef MYSQLND_THREADED if (MYSQLND_G(thread_id) != tsrm_thread_id()) { return PASS; /* don't trace background threads */ } @@ -201,7 +201,7 @@ line_buffer[6], level_buffer[7]; MYSQLND_ZTS(self); -#ifdef ZTS +#ifdef MYSQLND_THREADED if (MYSQLND_G(thread_id) != tsrm_thread_id()) { return PASS; /* don't trace background threads */ } @@ -307,7 +307,7 @@ if ((self-flags MYSQLND_DEBUG_DUMP_TRACE) == 0 || self-file_name == NULL) { return FALSE; } -#ifdef ZTS +#ifdef MYSQLND_THREADED if (MYSQLND_G(thread_id) != tsrm_thread_id()) { return FALSE; /* don't trace background threads */ } @@ -354,7 +354,7 @@ if ((self-flags MYSQLND_DEBUG_DUMP_TRACE) == 0 || self-file_name == NULL) { return PASS; } -#ifdef ZTS +#ifdef MYSQLND_THREADED if (MYSQLND_G(thread_id) != tsrm_thread_id()) { return PASS; /* don't trace background threads */ } @@ -667,7 +667,7 @@ { void *ret; DBG_ENTER(mysqlnd_emalloc_name); -#ifdef ZTS +#ifdef MYSQLND_THREADED if (MYSQLND_G(thread_id) != tsrm_thread_id()) { DBG_RETURN(_mysqlnd_pemalloc(size, 1 TSRMLS_CC ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)); } @@ -720,7 +720,7 @@ { void *ret; DBG_ENTER(mysqlnd_ecalloc_name); -#ifdef ZTS +#ifdef MYSQLND_THREADED if (MYSQLND_G(thread_id) != tsrm_thread_id()) { DBG_RETURN(_mysqlnd_pecalloc(nmemb, size, 1 TSRMLS_CC ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)); } @@ -773,7 +773,7 @@ { void *ret; DBG_ENTER(mysqlnd_erealloc_name); -#ifdef ZTS +#ifdef MYSQLND_THREADED if (MYSQLND_G(thread_id) != tsrm_thread_id()) { DBG_RETURN(_mysqlnd_perealloc(ptr, new_size, 1 TSRMLS_CC ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)); } @@ -827,7 +827,7 @@ void _mysqlnd_efree(void *ptr MYSQLND_MEM_D) { DBG_ENTER(mysqlnd_efree_name); -#ifdef ZTS +#ifdef MYSQLND_THREADED if (MYSQLND_G(thread_id) != tsrm_thread_id()) { DBG_RETURN(_mysqlnd_pefree(ptr, 1 TSRMLS_CC ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)); } http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/php_mysqlnd.c?r1=1.1.2.2r2=1.1.2.3diff_format=u Index: php-src/ext/mysqlnd/php_mysqlnd.c diff -u php-src/ext/mysqlnd/php_mysqlnd.c:1.1.2.2 php-src/ext/mysqlnd/php_mysqlnd.c:1.1.2.3 --- php-src/ext/mysqlnd/php_mysqlnd.c:1.1.2.2 Thu Feb 14 12:49:30 2008 +++ php-src/ext/mysqlnd/php_mysqlnd.c Thu Feb 14 15:20:49 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_mysqlnd.c,v 1.1.2.2 2008/02/14 12:49:30 andrey Exp $ */ +/* $Id: php_mysqlnd.c,v 1.1.2.3 2008/02/14