Download src/php/php-src/ext/pgsql/tests/14pg_update_9.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pgsql/tests/14pg_update_9.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/pgsql/tests/14pg_update_9.phpt
-
curl -L -o 14pg_update_9.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pgsql/tests/14pg_update_9.phpt
1.23 kB
| --TEST-- | |
| PostgreSQL pg_update() (9.0+) | |
| --EXTENSIONS-- | |
| pgsql | |
| --SKIPIF-- | |
| include("inc/skipif.inc"); | |
| skip_bytea_not_hex(); | |
| --FILE-- | |
| error_reporting(E_ALL); | |
| include 'inc/config.inc'; | |
| $table_name = "table_14pg_update_9"; | |
| $db = pg_connect($conn_str); | |
| pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)"); | |
| pg_query($db, "INSERT INTO {$table_name} VALUES(1, 'ABC', null)"); | |
| pg_query($db, "INSERT INTO {$table_name} VALUES(1, 'ABC', null)"); | |
| pg_query($db, "SET standard_conforming_strings = 0"); | |
| $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"; | |
| echo pg_update($db, $table_name, $fields, $ids, PGSQL_DML_STRING|PGSQL_DML_ESCAPE)."\n"; | |
| echo "Ok\n"; | |
| --CLEAN-- | |
| include('inc/config.inc'); | |
| $table_name = "table_14pg_update_9"; | |
| $db = pg_connect($conn_str); | |
| pg_query($db, "DROP TABLE IF EXISTS {$table_name}"); | |
| --EXPECT-- | |
| UPDATE "table_14pg_update_9" SET "num"=1234,"str"=E'ABC',"bin"=E'\\x58595a' WHERE "num"=1234; | |
| UPDATE "table_14pg_update_9" SET "num"='1234',"str"='ABC',"bin"='XYZ' WHERE "num"='1234'; | |
| Ok | |