2009-12-25 20:56:00 +00:00
|
|
|
--TEST--
|
2013-08-11 09:33:33 +00:00
|
|
|
PostgreSQL pg_update() (9.0+)
|
2009-12-25 20:56:00 +00:00
|
|
|
--SKIPIF--
|
|
|
|
<?php
|
|
|
|
include("skipif.inc");
|
2013-06-19 09:46:11 +00:00
|
|
|
skip_bytea_not_hex();
|
2009-12-25 20:56:00 +00:00
|
|
|
?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
error_reporting(E_ALL);
|
|
|
|
|
|
|
|
include 'config.inc';
|
|
|
|
|
|
|
|
$db = pg_connect($conn_str);
|
2013-06-01 21:15:48 +00:00
|
|
|
pg_query($db, "SET standard_conforming_strings = 0");
|
|
|
|
|
2009-12-25 20:56:00 +00:00
|
|
|
$fields = array('num'=>'1234', 'str'=>'ABC', 'bin'=>'XYZ');
|
|
|
|
$ids = array('num'=>'1234');
|
|
|
|
|
|
|
|
pg_update($db, $table_name, $fields, $ids) or print "Error in test 1\n";
|
|
|
|
echo pg_update($db, $table_name, $fields, $ids, PGSQL_DML_STRING)."\n";
|
2014-02-16 03:22:52 +00:00
|
|
|
echo pg_update($db, $table_name, $fields, $ids, PGSQL_DML_STRING|PGSQL_DML_ESCAPE)."\n";
|
2009-12-25 20:56:00 +00:00
|
|
|
|
|
|
|
echo "Ok\n";
|
|
|
|
?>
|
|
|
|
--EXPECT--
|
2013-08-05 09:23:15 +00:00
|
|
|
UPDATE "php_pgsql_test" SET "num"=1234,"str"=E'ABC',"bin"=E'\\x58595a' WHERE "num"=1234;
|
2014-02-16 03:22:52 +00:00
|
|
|
UPDATE "php_pgsql_test" SET "num"='1234',"str"='ABC',"bin"='XYZ' WHERE "num"='1234';
|
2013-08-05 09:23:15 +00:00
|
|
|
Ok
|