1--TEST-- 2PDO_OCI: Attribute: Setting session client identifier 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_identifier 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_IDENTIFIER NOT SET: '; 23var_dump($row['client_identifier']); 24 25var_dump($dbh->setAttribute(PDO::OCI_ATTR_CLIENT_IDENTIFIER, "some client identifier")); 26 27$stmt = $dbh->query($query); 28$row = $stmt->fetch(); 29echo 'CLIENT_IDENTIFIER SET: '; 30var_dump($row['client_identifier']); 31 32var_dump($dbh->setAttribute(PDO::OCI_ATTR_CLIENT_IDENTIFIER, "something else!")); 33 34$stmt = $dbh->query($query); 35$row = $stmt->fetch(); 36echo 'CLIENT_IDENTIFIER RESET: '; 37var_dump($row['client_identifier']); 38 39var_dump($dbh->setAttribute(PDO::OCI_ATTR_CLIENT_IDENTIFIER, null)); 40 41$stmt = $dbh->query($query); 42$row = $stmt->fetch(); 43echo 'CLIENT_IDENTIFIER NULLED: '; 44var_dump($row['client_identifier']); 45 46echo "Done\n"; 47 48?> 49--EXPECT-- 50CLIENT_IDENTIFIER NOT SET: NULL 51bool(true) 52CLIENT_IDENTIFIER SET: string(22) "some client identifier" 53bool(true) 54CLIENT_IDENTIFIER RESET: string(15) "something else!" 55bool(true) 56CLIENT_IDENTIFIER NULLED: NULL 57Done 58