[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/mysqlnd/ mysqlnd_ps.c

2010-03-17 Thread Andrey Hristov
andrey   Wed, 17 Mar 2010 11:40:37 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=296315

Log:
fix valgrind warning introduced with the latest patch. The memory
should be calloc-ed, not malloced, because the code that uses the
stmt storage needs that.

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c   2010-03-17 
11:39:59 UTC (rev 296314)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c   2010-03-17 
11:40:37 UTC (rev 296315)
@@ -2143,7 +2143,7 @@
 MYSQLND_STMT * _mysqlnd_stmt_init(MYSQLND * const conn TSRMLS_DC)
 {
size_t alloc_size = sizeof(MYSQLND_STMT) + mysqlnd_plugin_count() * 
sizeof(void *);
-   MYSQLND_STMT * ret = mnd_pemalloc(alloc_size, conn-persistent);
+   MYSQLND_STMT * ret = mnd_pecalloc(1, alloc_size, conn-persistent);
MYSQLND_STMT_DATA * stmt = ret-data = mnd_pecalloc(1, 
sizeof(MYSQLND_STMT_DATA), conn-persistent);

DBG_ENTER(_mysqlnd_stmt_init);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /SVNROOT/ global_avail

2010-03-17 Thread Derick Rethans
derick   Wed, 17 Mar 2010 11:43:21 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=296316

Log:
- Give kalle php-gtk karma on request by Elizabeth.

Changed paths:
U   SVNROOT/global_avail

Modified: SVNROOT/global_avail
===
--- SVNROOT/global_avail2010-03-17 11:40:37 UTC (rev 296315)
+++ SVNROOT/global_avail2010-03-17 11:43:21 UTC (rev 296316)
@@ -108,7 +108,7 @@

 # The PHP-GTK Group has access to the PHP-GTK code and documentation.

-avail|mgdm,fmk,mfischer,alan_k,amaza,descript,cweiske,jani,pablo,sfox,jsjohnst,jp,anant,scottmattocks,auroraeosrose,bmajdak,akshat,derick,felipe|gtk/php-gtk,gtk/php-gtk-doc
+avail|kalle,mgdm,fmk,mfischer,alan_k,amaza,descript,cweiske,jani,pablo,sfox,jsjohnst,jp,anant,scottmattocks,auroraeosrose,bmajdak,akshat,derick,felipe|gtk/php-gtk,gtk/php-gtk-doc

 # The PHP-GTK Documentation Group has access to the PHP-GTK
 # documentation.

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/mysqlnd/ mysqlnd_ps.c

2010-03-17 Thread Andrey Hristov
andrey   Wed, 17 Mar 2010 18:00:47 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=296331

Log:
Fix a bug that a statement that is reset doesn't clean
the wire properly (as it is done when the statement is closed).
If there is more that one result sets returned from the PS
(like a call to SP that returns at least one RSet next to the
status rset) then the line was blocked. PS Multi-Res is not supported
in any libmysql from a GA-ed MySQL.

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c   2010-03-17 
17:33:15 UTC (rev 296330)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c   2010-03-17 
18:00:47 UTC (rev 296331)
@@ -1120,16 +1120,18 @@
  We have to call the appropriate use_result() or 
store_result() and
  clean.
*/
-   if (stmt-state == MYSQLND_STMT_WAITING_USE_OR_STORE) {
-   DBG_INF(fetching result set header);
-   stmt-default_rset_handler(s TSRMLS_CC);
-   stmt-state = MYSQLND_STMT_USER_FETCHING;
-   }
+   do {
+   if (stmt-state == MYSQLND_STMT_WAITING_USE_OR_STORE) {
+   DBG_INF(fetching result set header);
+   stmt-default_rset_handler(s TSRMLS_CC);
+   stmt-state = MYSQLND_STMT_USER_FETCHING;
+   }

-   if (stmt-result) {
-   DBG_INF(skipping result);
-   stmt-result-m.skip_result(stmt-result TSRMLS_CC);
-   }
+   if (stmt-result) {
+   DBG_INF(skipping result);
+   stmt-result-m.skip_result(stmt-result 
TSRMLS_CC);
+   }
+   } while (mysqlnd_stmt_more_results(s)  
mysqlnd_stmt_next_result(s) == PASS);

/*
  Don't free now, let the result be usable. When the stmt will 
again be

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/mysqlnd/ mysqlnd_debug.c

2010-03-17 Thread Andrey Hristov
andrey   Wed, 17 Mar 2010 18:08:25 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=296332

Log:
Fix for complaint from the Zend MM, efree of a NULL pointer.

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c2010-03-17 
18:00:47 UTC (rev 296331)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c2010-03-17 
18:08:25 UTC (rev 296332)
@@ -828,7 +828,9 @@
DBG_INF_FMT(before: %lu, zend_memory_usage(persistent 
TSRMLS_CC));
}

-   pefree(ptr, persistent);
+   if (ptr) {
+   pefree(ptr, persistent);
+   }

if (persistent == FALSE) {
DBG_INF_FMT(after : %lu, zend_memory_usage(persistent 
TSRMLS_CC));

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php