summaryrefslogtreecommitdiff
path: root/ext/pgsql/tests
diff options
context:
space:
mode:
authorChristopher Kings-Lynne <chriskl@php.net>2005-03-25 06:26:31 +0000
committerChristopher Kings-Lynne <chriskl@php.net>2005-03-25 06:26:31 +0000
commit030ebaaa458f534871fe62a20fcea7e8ee1d5a57 (patch)
tree335b349faeb4013067f3f12ccd6c98b6d9ac2ae8 /ext/pgsql/tests
parent8817f64457abbe28d03b37503dd03c83535430c5 (diff)
downloadphp-git-030ebaaa458f534871fe62a20fcea7e8ee1d5a57.tar.gz
(PHP pg_unescape_bytea) Use libpq version of PQunescapeBytea if it exists.
# The version in libpq is newer and faster than the one in PHP, but it is # necessary for me to add a string copy for freeing purposes. This copy # is only needed in Windows AFAIK, how can I detect that?
Diffstat (limited to 'ext/pgsql/tests')
-rw-r--r--ext/pgsql/tests/08escape.phpt15
-rw-r--r--ext/pgsql/tests/25async_query_params.phpt2
2 files changed, 8 insertions, 9 deletions
diff --git a/ext/pgsql/tests/08escape.phpt b/ext/pgsql/tests/08escape.phpt
index c5a3877e37..cf23b50e3a 100644
--- a/ext/pgsql/tests/08escape.phpt
+++ b/ext/pgsql/tests/08escape.phpt
@@ -51,14 +51,12 @@ $sql = "SELECT bin::bytea FROM ".$table_name." WHERE num = -9999";
$result = pg_query($db, $sql);
$row = pg_fetch_array($result, 0, PGSQL_ASSOC);
-// Compare
-// Need to wait PostgreSQL 7.3.x for PQunescapeBytea()
-// if ($data === pg_unescape_bytea($row['bin'])) {
-// echo "pg_escape_bytea() actually works with databse\n";
-// }
-// else {
-// echo "pg_escape_bytea() is broken\n";
-// }
+if ($data === pg_unescape_bytea($row['bin'])) {
+ echo "pg_escape_bytea() actually works with database\n";
+}
+else {
+ echo "pg_escape_bytea() is broken\n";
+}
?>
--EXPECT--
@@ -67,3 +65,4 @@ string(9) "ABC\ABC\'"
string(12) "ABC\\ABC\\''"
string(10) "ABC\\ABC\'"
pg_escape_bytea() is Ok
+pg_escape_bytea() actually works with database
diff --git a/ext/pgsql/tests/25async_query_params.phpt b/ext/pgsql/tests/25async_query_params.phpt
index 3244532094..6e7dafe34b 100644
--- a/ext/pgsql/tests/25async_query_params.phpt
+++ b/ext/pgsql/tests/25async_query_params.phpt
@@ -62,7 +62,7 @@ if ($version['protocol'] >= 3) {
pg_last_oid($result);
pg_free_result($result);
}
-pg_close($db)
+pg_close($db);
echo "OK";
?>