From 426fb96cc966a7c0997ba8872fefc7e29c27113b Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 26 Nov 2005 21:20:52 +0000 Subject: [PATCH] Doh, need to canonicalize parameter names (by prefixing with :) before attempting to remap them to positional args. --- ext/pdo/pdo_stmt.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 4f7c74eaeba..62caef2e5fe 100755 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -306,10 +306,6 @@ static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_s } } - 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 @@ static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_s 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) {