com php-src: Fixed test fails: ext/pgsql/pgsql.c
| From: | Xinchen Hui | Date: | Tue, 03 Feb 2015 14:09:37 +0000 |
| Subject: | com php-src: Fixed test fails: ext/pgsql/pgsql.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-84604@lists.php.net to get a copy of this message | ||
Commit: 64caa97e023bc017f85a7063ec4ea950587740d2
Author: Xinchen Hui <laruence@gmail.com> Tue, 3 Feb 2015 22:09:37 +0800
Parents: 2c842dfce076037873ec223a1709011aefbd653e
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=64caa97e023bc017f85a7063ec4ea950587740d2
Log:
Fixed test fails
Changed paths:
M ext/pgsql/pgsql.c
Diff:
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 7b755fd..2064e93 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);