Skip to content

Commit 79803be

Browse files
committed
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.
1 parent 598e269 commit 79803be

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

ext/pgsql/tests/10pg_convert_85.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ error_reporting(E_ALL);
1212
include 'config.inc';
1313

1414
$db = pg_connect($conn_str);
15+
pg_query($db, "SET standard_conforming_strings = 0");
1516

1617
$fields = array('num'=>'1234', 'str'=>'AAA', 'bin'=>'BBB');
1718
$converted = pg_convert($db, $table_name, $fields);

ext/pgsql/tests/12pg_insert_85.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ error_reporting(E_ALL);
1212
include 'config.inc';
1313

1414
$db = pg_connect($conn_str);
15+
pg_query($db, "SET standard_conforming_strings = 0");
16+
1517
$fields = array('num'=>'1234', 'str'=>'AAA', 'bin'=>'BBB');
1618

1719
pg_insert($db, $table_name, $fields) or print "Error in test 1\n";

ext/pgsql/tests/14pg_update_85.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ error_reporting(E_ALL);
1212
include 'config.inc';
1313

1414
$db = pg_connect($conn_str);
15+
pg_query($db, "SET standard_conforming_strings = 0");
16+
1517
$fields = array('num'=>'1234', 'str'=>'ABC', 'bin'=>'XYZ');
1618
$ids = array('num'=>'1234');
1719

ext/pgsql/tests/18pg_escape_bytea.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ PostgreSQL pg_escape_bytea() functions
88

99
include('config.inc');
1010

11+
$db = pg_connect($conn_str);
12+
1113
$image = file_get_contents(dirname(__FILE__) . '/php.gif');
1214
$esc_image = pg_escape_bytea($image);
1315

14-
$db = pg_connect($conn_str);
1516
pg_query($db, 'INSERT INTO '.$table_name.' (num, bin) VALUES (9876, \''.$esc_image.'\');');
1617
$result = pg_query($db, 'SELECT * FROM '.$table_name.' WHERE num = 9876');
1718
$rows = pg_fetch_all($result);

0 commit comments

Comments
 (0)