php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #52699
Patch rein-pdo-bindValue revision 2010-08-25 14:53 UTC by rein at basefarm dot no

Patch rein-pdo-bindValue for PDO related Bug #52699

Patch version 2010-08-25 14:53 UTC

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

Developer: rein@basefarm.no

Index: ext/pdo/pdo_stmt.c
===================================================================
RCS file: php/ext/pdo/pdo_stmt.c,v
retrieving revision 1.1.1.13
retrieving revision 1.2
diff -u -u -r1.1.1.13 -r1.2
--- ext/pdo/pdo_stmt.c	16 Aug 2010 17:56:42 -0000	1.1.1.13
+++ ext/pdo/pdo_stmt.c	25 Aug 2010 14:22:03 -0000	1.2
@@ -1624,18 +1624,20 @@
 static PHP_METHOD(PDOStatement, bindValue)
 {
 	struct pdo_bound_param_data param = {0};
+	long param_type = PDO_PARAM_STR;
 	PHP_STMT_GET_OBJ;
 
 	param.paramno = -1;
-	param.param_type = PDO_PARAM_STR;
 	
 	if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
-			"lz/|l", &param.paramno, &param.parameter, &param.param_type)) {
+			"lz/|l", &param.paramno, &param.parameter, &param_type)) {
 		if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/|l", &param.name,
-				&param.namelen, &param.parameter, &param.param_type)) {
+				&param.namelen, &param.parameter, &param_type)) {
 			RETURN_FALSE;
 		}
 	}
+
+	param.param_type = param_type;
 	
 	if (param.paramno > 0) {
 		--param.paramno; /* make it zero-based internally */
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 24 21:01:55 2014 UTC