mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
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:
commit
202a099aee
34
ext/pgsql/tests/06copy_2.phpt
Normal file
34
ext/pgsql/tests/06copy_2.phpt
Normal 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user