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