xref: /PHP-7.1/ext/pgsql/tests/80_bug42783.phpt (revision 7af945e2)
1--TEST--
2Bug #42783 (pg_insert() does not support an empty value array)
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6?>
7--FILE--
8<?php
9
10require_once('config.inc');
11
12$dbh = @pg_connect($conn_str);
13if (!$dbh) {
14	die ("Could not connect to the server");
15}
16
17pg_query("CREATE TABLE php_test (id SERIAL PRIMARY KEY, time TIMESTAMP NOT NULL DEFAULT now())");
18
19pg_insert($dbh, 'php_test', array());
20
21var_dump(pg_fetch_assoc(pg_query("SELECT * FROM php_test")));
22
23pg_query($dbh, "DROP TABLE php_test");
24pg_close($dbh);
25?>
26===DONE===
27--EXPECTF--
28array(2) {
29  ["id"]=>
30  string(%d) "%d"
31  ["time"]=>
32  string(%d) "%s"
33}
34===DONE===
35