Annotation of embedaddon/php/ext/oci8/tests/bug44008.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #44008 (Incorrect usage of OCI-Lob->close crashes PHP)
! 3: --SKIPIF--
! 4: <?php
! 5: $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
! 6: require(dirname(__FILE__).'/skipif.inc');
! 7: ?>
! 8: --FILE--
! 9: <?php
! 10:
! 11: require dirname(__FILE__).'/connect.inc';
! 12:
! 13: // Initialization
! 14:
! 15: $stmtarray = array(
! 16: "create or replace procedure bug44008_proc (p in out clob)
! 17: as begin p := 'A';
! 18: end;"
! 19: );
! 20:
! 21: oci8_test_sql_execute($c, $stmtarray);
! 22:
! 23: // Run Test
! 24:
! 25: $s = oci_parse($c, 'begin bug44008_proc(:data); end;');
! 26: $textLob = oci_new_descriptor($c, OCI_D_LOB);
! 27: oci_bind_by_name($s, ":data", $textLob, -1, OCI_B_CLOB);
! 28: oci_execute($s, OCI_DEFAULT);
! 29: $r = $textLob->load();
! 30: echo "$r\n";
! 31:
! 32: // Incorrectly closing the lob doesn't cause a crash.
! 33: // OCI-LOB->close() is documented for use only with OCI-Lob->writeTemporary()
! 34: $textLob->close();
! 35:
! 36: // Cleanup
! 37:
! 38: $stmtarray = array(
! 39: "drop procedure bug44008_proc"
! 40: );
! 41:
! 42: oci8_test_sql_execute($c, $stmtarray);
! 43:
! 44: echo "Done\n";
! 45:
! 46: ?>
! 47: --EXPECT--
! 48: A
! 49: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>