summaryrefslogtreecommitdiff
path: root/tests/bind_long_raw.phpt
diff options
context:
space:
mode:
authorChristopher Jones <sixd@php.net>2010-08-07 00:28:09 +0000
committerChristopher Jones <sixd@php.net>2010-08-07 00:28:09 +0000
commit05be95c0bee8c215d813ea71e000fa0b76abaf86 (patch)
treee1f53f5490f30a7c83e79ad929797559deb359e2 /tests/bind_long_raw.phpt
downloadphp-git-d8f0b8a4656376a9bc7c2dff58d15f30751ca22f.tar.gz
Tagging the 1.4.3 releaseoci8-1.4.3
Diffstat (limited to 'tests/bind_long_raw.phpt')
-rw-r--r--tests/bind_long_raw.phpt38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/bind_long_raw.phpt b/tests/bind_long_raw.phpt
new file mode 100644
index 0000000000..2a9962eace
--- /dev/null
+++ b/tests/bind_long_raw.phpt
@@ -0,0 +1,38 @@
+--TEST--
+bind LONG RAW field
+--SKIPIF--
+<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
+--FILE--
+<?php
+
+require dirname(__FILE__)."/connect.inc";
+
+$stmt = oci_parse($c, "create table phptestlngraw( id number(10), fileimage long raw)");
+oci_execute($stmt);
+
+$stmt = oci_parse ($c, "insert into phptestlngraw (id, fileimage) values (:id, :fileimage)");
+$i=1;
+$fileimage = file_get_contents( dirname(__FILE__)."/test.gif");
+
+oci_bind_by_name( $stmt, ":id", $i, -1);
+oci_bind_by_name( $stmt, ":fileimage", $fileimage, -1, SQLT_LBI);
+oci_execute($stmt, OCI_DEFAULT);
+oci_commit($c);
+
+$stmt = oci_parse($c, "SELECT fileimage FROM phptestlngraw");
+oci_execute($stmt);
+
+$row = oci_fetch_row($stmt);
+var_dump(md5($row[0]));
+var_dump(strlen($row[0]));
+
+$stmt = oci_parse($c, "drop table phptestlngraw");
+oci_execute($stmt);
+
+echo "Done\n";
+
+?>
+--EXPECT--
+string(32) "614fcbba1effb7caa27ef0ef25c27fcf"
+int(2523)
+Done