summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Beccati <mbeccati@php.net>2013-06-01 23:15:48 +0200
committerMatteo Beccati <mbeccati@php.net>2013-06-01 23:15:48 +0200
commit79803bebdea2827d66c0f96fd3dbaf4a2747ff27 (patch)
tree0184358ef01821b5cde751c548558105874e66af
parent598e2690b81a145589f6dfe06f77d9e3b66a7853 (diff)
downloadphp-git-79803bebdea2827d66c0f96fd3dbaf4a2747ff27.tar.gz
Fixed bug #62857 (bytea test failures)
Postgres 9.1+ test fixes. Tests were failing due to the default standard_conforming_strings GUC being changed to on. Also the pg_escape_bytea test was encoding the data before estabilishing a connection, thus falling back to the old escaping type which isn't properly handled by the backend when using a default configuration. I haven't updated the NEWS file as it's just test fixes.
-rw-r--r--ext/pgsql/tests/10pg_convert_85.phpt1
-rw-r--r--ext/pgsql/tests/12pg_insert_85.phpt2
-rw-r--r--ext/pgsql/tests/14pg_update_85.phpt2
-rw-r--r--ext/pgsql/tests/18pg_escape_bytea.phpt3
4 files changed, 7 insertions, 1 deletions
diff --git a/ext/pgsql/tests/10pg_convert_85.phpt b/ext/pgsql/tests/10pg_convert_85.phpt
index 4f1c92bf1a..8b1cc8f538 100644
--- a/ext/pgsql/tests/10pg_convert_85.phpt
+++ b/ext/pgsql/tests/10pg_convert_85.phpt
@@ -12,6 +12,7 @@ error_reporting(E_ALL);
include 'config.inc';
$db = pg_connect($conn_str);
+pg_query($db, "SET standard_conforming_strings = 0");
$fields = array('num'=>'1234', 'str'=>'AAA', 'bin'=>'BBB');
$converted = pg_convert($db, $table_name, $fields);
diff --git a/ext/pgsql/tests/12pg_insert_85.phpt b/ext/pgsql/tests/12pg_insert_85.phpt
index a85dea0363..5fbbe4b7af 100644
--- a/ext/pgsql/tests/12pg_insert_85.phpt
+++ b/ext/pgsql/tests/12pg_insert_85.phpt
@@ -12,6 +12,8 @@ error_reporting(E_ALL);
include 'config.inc';
$db = pg_connect($conn_str);
+pg_query($db, "SET standard_conforming_strings = 0");
+
$fields = array('num'=>'1234', 'str'=>'AAA', 'bin'=>'BBB');
pg_insert($db, $table_name, $fields) or print "Error in test 1\n";
diff --git a/ext/pgsql/tests/14pg_update_85.phpt b/ext/pgsql/tests/14pg_update_85.phpt
index f1c77eac1d..06ca8c3de9 100644
--- a/ext/pgsql/tests/14pg_update_85.phpt
+++ b/ext/pgsql/tests/14pg_update_85.phpt
@@ -12,6 +12,8 @@ error_reporting(E_ALL);
include 'config.inc';
$db = pg_connect($conn_str);
+pg_query($db, "SET standard_conforming_strings = 0");
+
$fields = array('num'=>'1234', 'str'=>'ABC', 'bin'=>'XYZ');
$ids = array('num'=>'1234');
diff --git a/ext/pgsql/tests/18pg_escape_bytea.phpt b/ext/pgsql/tests/18pg_escape_bytea.phpt
index 43f98c4467..5f52a17d97 100644
--- a/ext/pgsql/tests/18pg_escape_bytea.phpt
+++ b/ext/pgsql/tests/18pg_escape_bytea.phpt
@@ -8,10 +8,11 @@ PostgreSQL pg_escape_bytea() functions
include('config.inc');
+$db = pg_connect($conn_str);
+
$image = file_get_contents(dirname(__FILE__) . '/php.gif');
$esc_image = pg_escape_bytea($image);
-$db = pg_connect($conn_str);
pg_query($db, 'INSERT INTO '.$table_name.' (num, bin) VALUES (9876, \''.$esc_image.'\');');
$result = pg_query($db, 'SELECT * FROM '.$table_name.' WHERE num = 9876');
$rows = pg_fetch_all($result);