Merge branch 'PHP-8.0' into PHP-8.1

* PHP-8.0:
  Add test for pg_put_line() and pg_end_copy()
This commit is contained in:
Matteo Beccati 2021-10-05 18:13:20 +02:00
commit 202a099aee

View File

@ -0,0 +1,34 @@
--TEST--
PostgreSQL copy functions, part 2
--EXTENSIONS--
pgsql
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
<?php
include('config.inc');
$db = pg_connect($conn_str);
pg_query($db, 'CREATE TABLE test_copy (x int)');
pg_query($db, 'COPY test_copy FROM STDIN');
pg_put_line($db, "1\n");
pg_put_line($db, "\\N\n");
pg_put_line($db, "\\.\n");
pg_end_copy($db);
var_dump(pg_fetch_all_columns(pg_query($db, 'SELECT * FROM test_copy ORDER BY 1')));
pg_query($db, 'DROP TABLE test_copy');
?>
--EXPECT--
array(2) {
[0]=>
string(1) "1"
[1]=>
NULL
}