wez Sat Nov 26 16:20:54 2005 EDT
Modified files: (Branch: PHP_5_1)
/php-src/ext/pdo pdo_stmt.c
Log:
Doh, need to canonicalize parameter names (by prefixing with :) before
attempting to remap them to positional args.
http://cvs.php.net/diff.php/php-src/ext/pdo/pdo_stmt.c?r1=1.118.2.20&r2=1.118.2.21&ty=u
Index: php-src/ext/pdo/pdo_stmt.c
diff -u php-src/ext/pdo/pdo_stmt.c:1.118.2.20
php-src/ext/pdo/pdo_stmt.c:1.118.2.21
--- php-src/ext/pdo/pdo_stmt.c:1.118.2.20 Thu Nov 24 22:23:17 2005
+++ php-src/ext/pdo/pdo_stmt.c Sat Nov 26 16:20:52 2005
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_stmt.c,v 1.118.2.20 2005/11/25 03:23:17 wez Exp $ */
+/* $Id: pdo_stmt.c,v 1.118.2.21 2005/11/26 21:20:52 wez Exp $ */
/* The PDO Statement Handle Class */
@@ -306,10 +306,6 @@
}
}
- if (is_param && !rewrite_name_to_position(stmt, param TSRMLS_CC)) {
- return 0;
- }
-
if (param->name) {
if (is_param && param->name[0] != ':') {
char *temp = emalloc(++param->namelen + 1);
@@ -320,6 +316,14 @@
param->name = estrndup(param->name, param->namelen);
}
}
+
+ if (is_param && !rewrite_name_to_position(stmt, param TSRMLS_CC)) {
+ if (param->name) {
+ efree(param->name);
+ param->name = NULL;
+ }
+ return 0;
+ }
/* tell the driver we just created a parameter */
if (stmt->methods->param_hook) {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php