xref: /php-src/ext/pgsql/tests/80_bug39971.phpt (revision c15988aa)
1--TEST--
2Bug #39971 (8.0+) (pg_insert/pg_update do not allow now() to be used for timestamp fields)
3--EXTENSIONS--
4pgsql
5--SKIPIF--
6<?php
7require_once('inc/skipif.inc');
8?>
9--FILE--
10<?php
11
12require_once('inc/config.inc');
13$table_name = 'table_80_bug39971';
14
15$dbh = pg_connect($conn_str);
16
17pg_query($dbh, "CREATE TABLE {$table_name} (id SERIAL, tm timestamp NOT NULL)");
18
19$values = array('tm' => 'now()');
20pg_insert($dbh, $table_name, $values);
21
22$ids = array('id' => 1);
23pg_update($dbh, $table_name, $values, $ids);
24
25pg_close($dbh);
26?>
27===DONE===
28--CLEAN--
29<?php
30require_once('inc/config.inc');
31$table_name = 'table_80_bug39971';
32
33$dbh = pg_connect($conn_str);
34pg_query($dbh, "DROP TABLE IF EXISTS {$table_name}");
35?>
36--EXPECT--
37===DONE===
38