diff options
author | Will Fitch <willfitch@php.net> | 2012-09-20 12:32:53 -0400 |
---|---|---|
committer | David Soria Parra <dsp@php.net> | 2012-10-30 14:32:09 +0100 |
commit | 7ea4f73ad4510088936dc3679e603e2e8569398c (patch) | |
tree | 52a5cdeeeb97746b4e682ad00f8b59015c9e5455 /ext/pdo_pgsql | |
parent | 2f1c4064f8fd971166df3099729e74e0ecb5d6bc (diff) | |
download | php-git-7ea4f73ad4510088936dc3679e603e2e8569398c.tar.gz |
Bug #62593 Updated pdo_pgsql driver to convert boolean values to pg native format in emulation mode
Diffstat (limited to 'ext/pdo_pgsql')
-rw-r--r-- | ext/pdo_pgsql/pgsql_statement.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index c35ee33c7f..e5c7032632 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -362,8 +362,19 @@ 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) { + SEPARATE_ZVAL_IF_NOT_REF(¶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; } |