summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2005-09-10 20:58:19 +0000
committerWez Furlong <wez@php.net>2005-09-10 20:58:19 +0000
commite9c81e4983d93ab0006c12e256a1f040c6b0e9ae (patch)
treeaeae1a4f4dc3a5a9632af2624018e601d3a4a81e
parent9c252b4b0765006de6f1023f2c4ae8c6d29c99ad (diff)
downloadphp-git-e9c81e4983d93ab0006c12e256a1f040c6b0e9ae.tar.gz
actually register PDO_PARAM_BOOL as a constant (doh!).
When emulating bound parameters, pass booleans via the driver's quoter method, so that is has an opportunity to tweak it. Refs #33876: PDO misquotes/miscasts bool(false)
-rwxr-xr-xext/pdo/pdo.c1
-rw-r--r--ext/pdo/pdo_sql_parser.re4
2 files changed, 3 insertions, 2 deletions
diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c
index c12cef1ad6..e5c2796cab 100755
--- a/ext/pdo/pdo.c
+++ b/ext/pdo/pdo.c
@@ -295,6 +295,7 @@ PHP_MINIT_FUNCTION(pdo)
le_ppdo = zend_register_list_destructors_ex(NULL, php_pdo_pdbh_dtor,
"PDO persistent database", module_number);
+ REGISTER_LONG_CONSTANT("PDO_PARAM_BOOL", (long)PDO_PARAM_BOOL, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PDO_PARAM_NULL", (long)PDO_PARAM_NULL, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PDO_PARAM_INT", (long)PDO_PARAM_INT, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PDO_PARAM_STR", (long)PDO_PARAM_STR, CONST_CS|CONST_PERSISTENT);
diff --git a/ext/pdo/pdo_sql_parser.re b/ext/pdo/pdo_sql_parser.re
index ce982096fb..eeae984573 100644
--- a/ext/pdo/pdo_sql_parser.re
+++ b/ext/pdo/pdo_sql_parser.re
@@ -210,8 +210,6 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
plc->freeq = 0;
break;
- case IS_BOOL:
- convert_to_long(param->parameter);
case IS_LONG:
case IS_DOUBLE:
convert_to_string(param->parameter);
@@ -220,6 +218,8 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
plc->freeq = 0;
break;
+ case IS_BOOL:
+ convert_to_long(param->parameter);
default:
convert_to_string(param->parameter);
if (!stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter),