php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #51670
Patch fix-nextRowset.getColumnMeta-segfault revision 2010-04-27 03:35 UTC by ww dot galen at gmail dot com

Patch fix-nextRowset.getColumnMeta-segfault for PDO related Bug #51670

Patch version 2010-04-27 03:35 UTC

Return to Bug #51670 | Download this patch
Patch Revisions:

Developer: ww.galen@gmail.com

--- pdo_stmt.c.orig	2010-04-26 20:28:34.000000000 -0700
+++ pdo_stmt.c.new	2010-04-26 20:32:55.000000000 -0700
@@ -513,14 +513,14 @@
 		if (!stmt->executed) {
 			/* this is the first execute */
 
-			if (stmt->dbh->alloc_own_columns && !stmt->columns) {
-				/* for "big boy" drivers, we need to allocate memory to fetch
-				 * the results into, so lets do that now */
-				ret = pdo_stmt_describe_columns(stmt TSRMLS_CC);
-			}
-
 			stmt->executed = 1;
 		}
+		// if nextRowset was called, we need to redescribe 
+		if (stmt->dbh->alloc_own_columns && !stmt->columns) {
+			/* for "big boy" drivers, we need to allocate memory to fetch
+			 * the results into, so lets do that now */
+			ret = pdo_stmt_describe_columns(stmt TSRMLS_CC);
+		}
 
 		if (ret && !dispatch_param_event(stmt, PDO_PARAM_EVT_EXEC_POST TSRMLS_CC)) {
 			RETURN_FALSE;
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 18:01:58 2014 UTC