cvs: php-src /ext/pdo_pgsql pgsql_statement.c
| From: | Wez Furlong | Date: | Fri, 08 Jul 2005 17:01:20 +0000 |
| Subject: | cvs: php-src /ext/pdo_pgsql pgsql_statement.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-32817@lists.php.net to get a copy of this message | ||
wez Fri Jul 8 13:01:20 2005 EDT
Modified files:
/php-src/ext/pdo_pgsql pgsql_statement.c
Log:
rewrite original names to our preferred format
http://cvs.php.net/diff.php/php-src/ext/pdo_pgsql/pgsql_statement.c?r1=1.26&r2=1.27&ty=u
Index: php-src/ext/pdo_pgsql/pgsql_statement.c
diff -u php-src/ext/pdo_pgsql/pgsql_statement.c:1.26 php-src/ext/pdo_pgsql/pgsql_statement.c:1.27
--- php-src/ext/pdo_pgsql/pgsql_statement.c:1.26 Fri Jul 8 12:20:13 2005
+++ php-src/ext/pdo_pgsql/pgsql_statement.c Fri Jul 8 13:01:20 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql_statement.c,v 1.26 2005/07/08 16:20:13 iliaa Exp $ */
+/* $Id: pgsql_statement.c,v 1.27 2005/07/08 17:01:20 wez Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -164,7 +164,19 @@
case PDO_PARAM_EVT_ALLOC:
/* decode name from $1, $2 into 0, 1 etc. */
if (param->name) {
- param->paramno = atoi(param->name + 1);
+ if (param->name[0] == '$') {
+ param->paramno = atoi(param->name + 1);
+ } else {
+ /* resolve parameter name to rewritten name */
+ char *nameptr;
+ if (SUCCESS == zend_hash_find(stmt->bound_param_map,
+ param->name, param->namelen + 1, (void**)&nameptr)) {
+ param->paramno = atoi(nameptr + 1) - 1;
+ } else {
+ pdo_pgsql_error_stmt(stmt, PGRES_FATAL_ERROR, "HY093");
+ return 0;
+ }
+ }
}
break;
@@ -191,7 +203,6 @@
S->param_lengths[param->paramno] = Z_STRLEN_P(param->parameter);
S->param_formats[param->paramno] = 1;
}
-
break;
}
}