File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #77047 pg_insert has a broken regex for the 'TIME WITHOUT TIMEZONE' data type
3
+ --SKIPIF--
4
+ <?php
5
+ include ("skipif.inc " );
6
+ ?>
7
+ --FILE--
8
+ <?php
9
+ error_reporting (E_ALL );
10
+
11
+ include 'config.inc ' ;
12
+
13
+ $ db = pg_connect ($ conn_str );
14
+
15
+ pg_query ($ db , "DROP TABLE IF EXISTS bug77047 " );
16
+ pg_query ($ db , "CREATE TABLE bug77047 (
17
+ t TIME WITHOUT TIME ZONE
18
+ ) " );
19
+
20
+ pg_insert ($ db , "bug77047 " , array ("t " => "13:31 " ));
21
+ pg_insert ($ db , "bug77047 " , array ("t " => "13:31:13 " ));
22
+ pg_insert ($ db , "bug77047 " , array ("t " => "1:2:3 " ));
23
+ pg_insert ($ db , "bug77047 " , array ("t " => "xyz " ));
24
+ pg_insert ($ db , "bug77047 " , array ("t " => NULL ));
25
+ pg_insert ($ db , "bug77047 " , array ("t " => "" ));
26
+
27
+ $ res = pg_query ($ db , "SELECT t FROM bug77047 " );
28
+ while (false !== ($ row = pg_fetch_row ($ res ))) {
29
+ var_dump (array_pop ($ row ));
30
+ }
31
+
32
+ ?>
33
+ --EXPECTF--
34
+ Notice: pg_insert(): Expects NULL or string for PostgreSQL time field (t) in %s on line %d
35
+ string(8) "13:31:00"
36
+ string(8) "13:31:13"
37
+ string(8) "01:02:03"
38
+ NULL
39
+ NULL
40
+
You can’t perform that action at this time.
0 commit comments