diff options
author | Xinchen Hui <laruence@gmail.com> | 2015-02-03 22:09:37 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2015-02-03 22:09:37 +0800 |
commit | 64caa97e023bc017f85a7063ec4ea950587740d2 (patch) | |
tree | c18ba4055f528630fcd05524dd001e9fa9007888 | |
parent | 2c842dfce076037873ec223a1709011aefbd653e (diff) | |
download | php-git-64caa97e023bc017f85a7063ec4ea950587740d2.tar.gz |
Fixed test fails
-rw-r--r-- | ext/pgsql/pgsql.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 7b755fd9c8..2064e934a0 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -4330,7 +4330,9 @@ PHP_FUNCTION(pg_escape_string) return; } link = FETCH_DEFAULT_LINK(); - CHECK_DEFAULT_LINK(link); + if (!link) { + RETURN_FALSE; + } break; default: @@ -4378,9 +4380,10 @@ PHP_FUNCTION(pg_escape_bytea) return; } link = FETCH_DEFAULT_LINK(); - CHECK_DEFAULT_LINK(link); + if (!link) { + RETURN_FALSE; + } break; - default: if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &pgsql_link, &from, &from_len) == FAILURE) { return; @@ -4395,7 +4398,7 @@ PHP_FUNCTION(pg_escape_bytea) RETURN_FALSE; } to = (char *)PQescapeByteaConn(pgsql, (unsigned char *)from, (size_t)from_len, &to_len); - } else + } else #endif to = (char *)PQescapeBytea((unsigned char*)from, from_len, &to_len); |