]> granicus.if.org Git - php/commitdiff
Fixed bug #62857 (bytea test failures)
authorMatteo Beccati <mbeccati@php.net>
Sat, 1 Jun 2013 21:15:48 +0000 (23:15 +0200)
committerMatteo Beccati <mbeccati@php.net>
Sat, 1 Jun 2013 21:15:48 +0000 (23:15 +0200)
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.

ext/pgsql/tests/10pg_convert_85.phpt
ext/pgsql/tests/12pg_insert_85.phpt
ext/pgsql/tests/14pg_update_85.phpt
ext/pgsql/tests/18pg_escape_bytea.phpt

index 4f1c92bf1ad91b88639dce71ba70ab6681142ce0..8b1cc8f53883ff137501aed2aad9a7bfc202931d 100644 (file)
@@ -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);
index a85dea0363d27eac10a9e91fdc4791872a23104d..5fbbe4b7afc4bee430016e362a844085e5d1a8a0 100644 (file)
@@ -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";
index f1c77eac1deb6dc7608c62ddeeb01f08e6c7e92c..06ca8c3de98b9b948f1fe22b0ee937354b975a7c 100644 (file)
@@ -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');
 
index 43f98c446725cd2242c6dcdf7d6a6d7dd466e4c5..5f52a17d9734a8df6942991f478c510bb1fcf91a 100644 (file)
@@ -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);