2006-04-12 19:22:12 +00:00
|
|
|
--TEST--
|
|
|
|
bind LONG field
|
|
|
|
--SKIPIF--
|
|
|
|
<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
|
|
|
require dirname(__FILE__)."/connect.inc";
|
|
|
|
|
2006-05-30 21:54:17 +00:00
|
|
|
$stmt = oci_parse($c, "create table phptestlng( id number(10), filetxt long)");
|
2006-04-12 19:22:12 +00:00
|
|
|
oci_execute($stmt);
|
|
|
|
|
2006-05-30 21:54:17 +00:00
|
|
|
$stmt = oci_parse ($c, "insert into phptestlng (id, filetxt) values (:id, :filetxt)");
|
2006-04-12 19:22:12 +00:00
|
|
|
$i=1;
|
2006-05-30 21:54:17 +00:00
|
|
|
$filetxt = file_get_contents( dirname(__FILE__)."/test.txt");
|
2006-04-12 19:22:12 +00:00
|
|
|
|
|
|
|
oci_bind_by_name( $stmt, ":id", $i, -1);
|
2006-05-30 21:54:17 +00:00
|
|
|
oci_bind_by_name( $stmt, ":filetxt", $filetxt, -1, SQLT_LNG);
|
2006-04-12 19:22:12 +00:00
|
|
|
oci_execute($stmt, OCI_DEFAULT);
|
|
|
|
oci_commit($c);
|
|
|
|
|
2006-05-30 21:54:17 +00:00
|
|
|
$stmt = oci_parse($c, "SELECT filetxt FROM phptestlng");
|
2006-04-12 19:22:12 +00:00
|
|
|
oci_execute($stmt);
|
|
|
|
|
|
|
|
$row = oci_fetch_row($stmt);
|
2006-11-10 16:56:19 +00:00
|
|
|
var_dump(md5((binary)$row[0]));
|
2006-04-12 19:22:12 +00:00
|
|
|
var_dump(strlen($row[0]));
|
|
|
|
|
|
|
|
$stmt = oci_parse($c, "drop table phptestlng");
|
|
|
|
oci_execute($stmt);
|
|
|
|
|
|
|
|
echo "Done\n";
|
|
|
|
|
|
|
|
?>
|
|
|
|
--EXPECT--
|
2006-05-30 21:54:17 +00:00
|
|
|
string(32) "da852396d08c9ef9fbdf914db1d6d5bb"
|
|
|
|
int(276)
|
2006-04-12 19:22:12 +00:00
|
|
|
Done
|
2006-07-10 20:48:04 +00:00
|
|
|
--UEXPECTF--
|
|
|
|
unicode(32) "da852396d08c9ef9fbdf914db1d6d5bb"
|
|
|
|
int(276)
|
|
|
|
Done
|