|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-09-25 07:24 UTC] tony2001@php.net
[2006-10-03 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 04:00:02 2025 UTC |
Description: ------------ RAW columns are sometimes returned as binary and sometimes as hex. When this happens seems to be dependent on the driver version, but I don't know of a reliably way to detect this in application code. The 9.2 client returns hex. The 10.2 instant client returns binary. Reproduce code: --------------- echo "PHP " . PHP_VERSION . "\n"; $db = oci_connect($user, $pass, $tns); echo oci_server_version($db) . "\n"; $st = oci_parse($db, "SELECT x FROM raw_test ORDER BY x"); oci_execute($st); echo "type: " . oci_field_type($st, 1) . "\n"; echo "type_raw: " . oci_field_type_raw($st, 1) . "\n"; echo "size: " . oci_field_size($st, 1) . "\n"; oci_fetch_all($st, $x, 0, -1, OCI_FETCHSTATEMENT_BY_ROW | OCI_NUM); foreach ($x as $i) var_dump($i[0]); ob_start(); phpinfo(); $x = strip_tags(ob_get_contents()); ob_end_clean(); $x = explode("\n", $x); foreach ($x as $i) if (substr($i, 0, 7) == "Oracle ") echo "$i\n"; Expected result: ---------------- Create a test table: CREATE TABLE raw_test (x RAW(4) NOT NULL); INSERT INTO raw_test VALUES('54455354'); INSERT INTO raw_test VALUES('424C4148'); INSERT INTO raw_test VALUES('61626364'); Actual result: -------------- First machine: PHP 5.1.2 Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production With the Partitioning, OLAP and Data Mining options type: RAW type_raw: 23 size: 4 string(8) "424C4148" string(8) "54455354" string(8) "61626364" Oracle Version 9.2 Second machine: PHP 5.1.6 Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production With the Partitioning, OLAP and Data Mining options type: RAW type_raw: 23 size: 4 string(4) "BLAH" string(4) "TEST" string(4) "abcd" Oracle Instant Client Version 10.2