xref: /PHP-8.4/ext/pgsql/tests/06_bug73498.phpt (revision c15988aa)
1--TEST--
2Bug 73498 Incorrect DELIMITER syntax for pg_copy_to()
3--EXTENSIONS--
4pgsql
5--SKIPIF--
6<?php include("inc/skipif.inc"); ?>
7--FILE--
8<?php
9
10include('inc/config.inc');
11$table_name = "table_06_bug73498";
12$view_name = "view_06_bug73498";
13
14$db = pg_connect($conn_str);
15pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)");
16pg_query($db, "CREATE VIEW {$view_name} as SELECT * FROM {$table_name}");
17pg_query($db, "INSERT INTO {$table_name} DEFAULT VALUES");
18
19$rows = pg_copy_to($db, "(SELECT * FROM {$view_name})");
20
21var_dump(gettype($rows));
22var_dump(count($rows) > 0);
23
24?>
25--CLEAN--
26<?php
27include('inc/config.inc');
28$table_name = "table_06_bug73498";
29$view_name = "view_06_bug73498";
30
31$db = pg_connect($conn_str);
32pg_query($db, "DROP VIEW IF EXISTS {$view_name}");
33pg_query($db, "DROP TABLE IF EXISTS {$table_name}");
34?>
35--EXPECT--
36string(5) "array"
37bool(true)
38