From 64caa97e023bc017f85a7063ec4ea950587740d2 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Tue, 3 Feb 2015 22:09:37 +0800 Subject: [PATCH] Fixed test fails --- ext/pgsql/pgsql.c | 11 +++++++---- 1 file 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); -- 2.49.0