diff options
author | Derick Rethans <github@derickrethans.nl> | 2012-11-13 10:10:41 +0000 |
---|---|---|
committer | Derick Rethans <github@derickrethans.nl> | 2012-11-13 10:10:41 +0000 |
commit | 1e081a825e7957286ce8df3cd7d48a9dd2a1787c (patch) | |
tree | 0947696b89521fbc4c2eecc140c7251902c4d46b /ext/pdo_pgsql/pgsql_statement.c | |
parent | 1784279be07f1ea18baff67646d9d75896cae36f (diff) | |
parent | bb60122c2fe49985b35026ecc48ff6cf550fbac1 (diff) | |
download | php-git-1e081a825e7957286ce8df3cd7d48a9dd2a1787c.tar.gz |
Merge branch 'PHP-5.3' of git.php.net:/php-src into PHP-5.3
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; } |