File tree Expand file tree Collapse file tree 1 file changed +61
-0
lines changed Expand file tree Collapse file tree 1 file changed +61
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ IBM-DB2: Boolean data type test.
3
+ --SKIPIF--
4
+ <?php
5
+
6
+ require_once ('skipif.inc ' );
7
+
8
+ // This test requires IBM i 7.5 or a version of LUW that supports boolean
9
+ require_once ('connection.inc ' );
10
+ $ conn = db2_connect ($ database , $ user , $ password );
11
+ if (!$ conn ) {
12
+ die ("skip can't connect to DB: " . db2_conn_errormsg ());
13
+ }
14
+
15
+ $ info = db2_server_info ($ conn );
16
+ if ($ info ->DBMS_NAME == "AS " ) { // IBM i
17
+ // DBMS_VER is VVRRM string
18
+ $ major = $ info [1 ];
19
+ $ minor = $ info [3 ];
20
+ $ mod = $ info [4 ];
21
+ if (!version_compare ("$ major. $ minor. $ mod " , "7.5.0 " , ">= " )) {
22
+ die ("skip IBM i version too old " );
23
+ }
24
+ }
25
+ // XXX: LUW, z
26
+
27
+ ?>
28
+ --FILE--
29
+ <?php
30
+
31
+ require_once ('connection.inc ' );
32
+ $ conn = db2_connect ($ database , $ user , $ password );
33
+
34
+ if (!$ conn ) {
35
+ echo "Error connecting to database " . db2_conn_errormsg () ."\n" ;
36
+ exit ;
37
+ }
38
+
39
+ $ s = db2_exec ("values (true, false) " );
40
+ $ r = db2_fetch_array ($ s );
41
+ var_dump ($ r );
42
+
43
+ $ s = db2_exec ("values (true, false) " );
44
+ db2_fetch_row ($ s );
45
+ var_dump (db2_result ($ s , 0 ));
46
+ var_dump (db2_result ($ s , 1 ));
47
+ echo db2_field_type ($ s , 1 ) . "\n" ;
48
+
49
+ db2_close ($ conn );
50
+
51
+ ?>
52
+ --EXPECT--
53
+ array(2) {
54
+ [0]=>
55
+ bool(true)
56
+ [1]=>
57
+ bool(false)
58
+ }
59
+ bool(true)
60
+ bool(false)
61
+ boolean
You can’t perform that action at this time.
0 commit comments