1--TEST--
2PDO_OCI: Attribute: Setting session client info
3--EXTENSIONS--
4pdo
5pdo_oci
6--SKIPIF--
7<?php
8require(__DIR__.'/../../pdo/tests/pdo_test.inc');
9PDOTest::skip();
10?>
11--FILE--
12<?php
13
14require(__DIR__ . '/../../pdo/tests/pdo_test.inc');
15
16$query = 'select client_info from v$session where sid = sys_context(\'USERENV\', \'SID\')';
17
18$dbh = PDOTest::factory();
19
20$stmt = $dbh->query($query);
21$row = $stmt->fetch();
22echo 'CLIENT_INFO NOT SET: ';
23var_dump($row['client_info']);
24
25var_dump($dbh->setAttribute(PDO::OCI_ATTR_CLIENT_INFO, "some client info"));
26
27$stmt = $dbh->query($query);
28$row = $stmt->fetch();
29echo 'CLIENT_INFO SET: ';
30var_dump($row['client_info']);
31
32var_dump($dbh->setAttribute(PDO::OCI_ATTR_CLIENT_INFO, "something else!"));
33
34$stmt = $dbh->query($query);
35$row = $stmt->fetch();
36echo 'CLIENT_INFO RESET: ';
37var_dump($row['client_info']);
38
39var_dump($dbh->setAttribute(PDO::OCI_ATTR_CLIENT_INFO, null));
40
41$stmt = $dbh->query($query);
42$row = $stmt->fetch();
43echo 'CLIENT_INFO NULLED: ';
44var_dump($row['client_info']);
45
46echo "Done\n";
47
48?>
49--EXPECT--
50CLIENT_INFO NOT SET: NULL
51bool(true)
52CLIENT_INFO SET: string(16) "some client info"
53bool(true)
54CLIENT_INFO RESET: string(15) "something else!"
55bool(true)
56CLIENT_INFO NULLED: NULL
57Done
58