php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #51259
Patch pdo-mysql-4.0-proposed-fix revision 2010-03-10 11:51 UTC by aron dot ujvari at microsec dot hu

Patch pdo-mysql-4.0-proposed-fix for PDO related Bug #51259

Patch version 2010-03-10 11:51 UTC

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

Developer: aron.ujvari@microsec.hu

diff -Nur php-5.3.2.orig/ext/pdo_mysql/mysql_statement.c php-5.3.2/ext/pdo_mysql/mysql_statement.c
--- php-5.3.2.orig/ext/pdo_mysql/mysql_statement.c	2010-02-04 21:28:55.000000000 +0100
+++ php-5.3.2/ext/pdo_mysql/mysql_statement.c	2010-03-10 11:37:27.589706803 +0100
@@ -49,7 +49,9 @@
 	pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
 
 	PDO_DBG_ENTER("pdo_mysql_stmt_dtor");
+#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	PDO_DBG_INF_FMT("stmt=%p", S->stmt);
+#endif /* HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND */
 	if (S->result) {
 		/* free the resource */
 		mysql_free_result(S->result);
@@ -64,7 +66,6 @@
 		pdo_mysql_stmt_close(S->stmt);
 		S->stmt = NULL;
 	}
-#endif /* HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND */
 
 #ifndef PDO_USE_MYSQLND
 	if (S->params) {
@@ -79,6 +80,8 @@
 
 #endif /* PDO_USE_MYSQLND */
 
+#endif /* HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND */
+
 #ifdef HAVE_MYSQL_STMT_PREPARE
 	if (S->bound_result) 
 	{
@@ -123,11 +126,13 @@
 static void pdo_mysql_stmt_set_row_count(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
 {
 	long row_count;
+#ifdef HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	pdo_mysql_stmt *S = stmt->driver_data;
 	row_count = (long) mysql_stmt_affected_rows(S->stmt);
 	if (row_count != (long)-1) {
 		stmt->row_count = row_count;
 	}
+#endif /* HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND */
 }
 /* }}} */
 
@@ -292,7 +297,9 @@
 	pdo_mysql_db_handle *H = S->H;
 	my_ulonglong row_count;
 	PDO_DBG_ENTER("pdo_mysql_stmt_execute");
+#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	PDO_DBG_INF_FMT("stmt=%p", S->stmt);
+#endif
 
 #if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	if (S->stmt) {
@@ -465,10 +472,10 @@
 static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param,
 		enum pdo_param_event event_type TSRMLS_DC) /* {{{ */
 {
+#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 #ifndef PDO_USE_MYSQLND
 	PDO_MYSQL_PARAM_BIND *b;
 #endif
-#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;	
 
 	PDO_DBG_ENTER("pdo_mysql_stmt_param_hook");
@@ -675,7 +682,9 @@
 	int i;
 
 	PDO_DBG_ENTER("pdo_mysql_stmt_describe");
+#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	PDO_DBG_INF_FMT("stmt=%p", S->stmt);
+#endif
 	if (!S->result) {
 		PDO_DBG_RETURN(0);
 	}
@@ -724,7 +733,9 @@
 	pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
 
 	PDO_DBG_ENTER("pdo_mysql_stmt_get_col");
+#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	PDO_DBG_INF_FMT("stmt=%p", S->stmt);
+#endif
 	if (!S->result) {
 		PDO_DBG_RETURN(0);
 	}
@@ -828,7 +839,9 @@
 	char *str;
 	
 	PDO_DBG_ENTER("pdo_mysql_stmt_col_meta");
+#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	PDO_DBG_INF_FMT("stmt=%p", S->stmt);
+#endif
 	if (!S->result) {
 		PDO_DBG_RETURN(FAILURE);
 	}
@@ -895,7 +908,9 @@
 	pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
 
 	PDO_DBG_ENTER("pdo_mysql_stmt_cursor_closer");
+#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	PDO_DBG_INF_FMT("stmt=%p", S->stmt);
+#endif
 	if (S->result) {
 		mysql_free_result(S->result);
 		S->result = NULL;
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue May 18 08:01:27 2021 UTC