From 02a2dc3e0c6baaae51a1870724b8350f1637c9e4 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Thu, 31 Jan 2008 22:02:09 +0000 Subject: [PATCH] New test for old, suspended bug --- ext/oci8/tests/bug37220.phpt | 68 ++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 ext/oci8/tests/bug37220.phpt diff --git a/ext/oci8/tests/bug37220.phpt b/ext/oci8/tests/bug37220.phpt new file mode 100644 index 0000000000..6743165b70 --- /dev/null +++ b/ext/oci8/tests/bug37220.phpt @@ -0,0 +1,68 @@ +--TEST-- +Bug #37220 (LOB Type mismatch when using windows & oci8.dll) +--SKIPIF-- + +--FILE-- +'))" +); + +foreach ($stmtarray as $stmt) { + $s = oci_parse($c, $stmt); + @oci_execute($s); +} + +// Now let's update the row where myId = 1234 and change the tag +// 'THETAG' to 'MYTAG' (mycolumn is an XMLTYPE datatype and +// bug37220_tab a normal Oracle table) + +$query = "UPDATE bug37220_tab + SET bug37220_tab.mycolumn = updateXML(bug37220_tab.mycolumn,'/THETAG',xmltype.createXML(:data)) + WHERE existsNode(bug37220_tab.mycolumn,'/THETAG[@myID=\"1234\"]') = 1"; +$stmt = oci_parse ($c, $query); +$clob = oci_new_descriptor($c, OCI_D_LOB); +oci_bind_by_name($stmt, ':data', $clob, -1, OCI_B_CLOB); +$clob->writetemporary("", OCI_TEMP_CLOB); +$success = oci_execute($stmt, OCI_COMMIT_ON_SUCCESS); +oci_free_statement($stmt); +$clob->close(); + +// Query back the change + +$query = "select * from bug37220_tab"; +$stmt = oci_parse ($c, $query); + +oci_execute($stmt); + +while ($row = oci_fetch_array($stmt, OCI_ASSOC+OCI_RETURN_NULLS)) { + foreach ($row as $item) { + echo $item."\n"; + } + echo "\n"; +} + +// Cleanup + +$stmtarray = array( + "drop table bug37220_tab" +); + +foreach ($stmtarray as $stmt) { + $s = oci_parse($c, $stmt); + oci_execute($s); +} + +echo "Done\n"; + +?> +--EXPECT-- + + +Done -- 2.40.0