bug35973.phpt 953 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. --TEST--
  2. Bug #35973 (Error ORA-24806 occurs when trying to fetch a NCLOB field)
  3. --EXTENSIONS--
  4. oci8
  5. --SKIPIF--
  6. <?php
  7. $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
  8. require(__DIR__.'/skipif.inc');
  9. ?>
  10. --FILE--
  11. <?php
  12. require __DIR__.'/connect.inc';
  13. $s1 = oci_parse($c, "drop table test_nclob");
  14. @oci_execute($s1);
  15. $s2 = oci_parse($c, "create table test_nclob (nc NCLOB)");
  16. oci_execute($s2);
  17. $s3 = oci_parse($c, "insert into test_nclob (nc) values ('12345data')");
  18. oci_execute($s3);
  19. $s3 = oci_parse($c, "select * from test_nclob");
  20. oci_execute($s3);
  21. var_dump($data = oci_fetch_assoc($s3));
  22. $d = $data['NC'];
  23. var_dump($d->read(5));
  24. var_dump($d->read(4));
  25. $s1 = oci_parse($c, "drop table test_nclob");
  26. @oci_execute($s1);
  27. echo "Done\n";
  28. ?>
  29. --EXPECTF--
  30. array(1) {
  31. ["NC"]=>
  32. object(OCILob)#%d (1) {
  33. ["descriptor"]=>
  34. resource(%d) of type (oci8 descriptor)
  35. }
  36. }
  37. string(%d) "%s5"
  38. string(%d) "%sa"
  39. Done