diff options
author | David Soria Parra <dsp@php.net> | 2012-10-30 15:43:32 +0100 |
---|---|---|
committer | David Soria Parra <dsp@php.net> | 2012-10-30 15:43:32 +0100 |
commit | 440bbcd9e3c5392194774a77baf18b8ab3ccfb32 (patch) | |
tree | d0985aa158d34115b551b46d9a1204c940c4f9f4 /ext/pdo_pgsql/pgsql_statement.c | |
parent | 3342e7276c4d0ff0a8546c2f16eb706d6aadf185 (diff) | |
parent | b3cd64afef4d7c35d8551d34858f98a6286db975 (diff) | |
download | php-git-440bbcd9e3c5392194774a77baf18b8ab3ccfb32.tar.gz |
Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
NEWS for bug #62593
Bug #62593 Updated to account for INOUT parameters
Bug #62593 Updated test to verify bindParam doesn't change original value
Bug #62593 Updated to always treat zval by value
Bug #62593 Added test for change
Bug #62593 Updated pdo_pgsql driver to convert boolean values to pg native format in emulation mode
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; } |