diff options
author | Derick Rethans <github@derickrethans.nl> | 2012-11-13 10:10:28 +0000 |
---|---|---|
committer | Derick Rethans <github@derickrethans.nl> | 2012-11-13 10:10:28 +0000 |
commit | d9aea7cd4d82fd9203d92241aa1e76aae754d94a (patch) | |
tree | 1ceb29b5cdc0abab3293aedaea58727e17fe2837 /ext/pdo_pgsql/pgsql_statement.c | |
parent | db0f62349092aa462401a6a1a236c12d56d264b6 (diff) | |
parent | 6b9df7a4542c47fa6ab615461913ccdf7cdd4e10 (diff) | |
download | php-git-d9aea7cd4d82fd9203d92241aa1e76aae754d94a.tar.gz |
Merge branch 'PHP-5.4' of git.php.net:/php-src into PHP-5.4
Diffstat (limited to 'ext/pdo_pgsql/pgsql_statement.c')
-rw-r--r-- | ext/pdo_pgsql/pgsql_statement.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index c35ee33c7f..1dc0d58e97 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -362,8 +362,20 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data * } break; } + } else { +#endif + if (param->is_param) { + /* We need to manually convert to a pg native boolean value */ + if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_BOOL && + ((param->param_type & PDO_PARAM_INPUT_OUTPUT) != PDO_PARAM_INPUT_OUTPUT)) { + SEPARATE_ZVAL(¶m->parameter); + param->param_type = PDO_PARAM_STR; + ZVAL_STRINGL(param->parameter, Z_BVAL_P(param->parameter) ? "t" : "f", 1, 1); + } + } +#if HAVE_PQPREPARE } -#endif +#endif return 1; } |