From fab0baa27447e8e2e8eca3571d8b9fdf376659a0 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sun, 25 Sep 2005 00:47:00 +0000 Subject: [PATCH] refs #34630. Real lob support for oracle will appear after the PHP 5.1 release. --- ext/pdo_oci/oci_statement.c | 18 +++++++++++++++++- ext/pdo_oci/tests/bug_33707.phpt | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ext/pdo_oci/oci_statement.c b/ext/pdo_oci/oci_statement.c index 10a4d2f325..d4aa38395f 100755 --- a/ext/pdo_oci/oci_statement.c +++ b/ext/pdo_oci/oci_statement.c @@ -242,10 +242,26 @@ static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *pa /* figure out what we're doing */ switch (PDO_PARAM_TYPE(param->param_type)) { - case PDO_PARAM_LOB: case PDO_PARAM_STMT: return 0; + case PDO_PARAM_LOB: + /* fake lobs for now */ + if (Z_TYPE_P(param->parameter) == IS_RESOURCE) { + php_stream *stm; + php_stream_from_zval_no_verify(stm, ¶m->parameter); + if (stm) { + SEPARATE_ZVAL_IF_NOT_REF(¶m->parameter); + Z_TYPE_P(param->parameter) = IS_STRING; + Z_STRLEN_P(param->parameter) = php_stream_copy_to_mem(stm, + &Z_STRVAL_P(param->parameter), PHP_STREAM_COPY_ALL, 0); + } else { + pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource"); + return 0; + } + } + /* fall through */ + case PDO_PARAM_STR: default: P->oci_type = SQLT_CHR; diff --git a/ext/pdo_oci/tests/bug_33707.phpt b/ext/pdo_oci/tests/bug_33707.phpt index 6583115778..17ea37f74f 100644 --- a/ext/pdo_oci/tests/bug_33707.phpt +++ b/ext/pdo_oci/tests/bug_33707.phpt @@ -25,6 +25,6 @@ array(3) { [1]=> int(942) [2]=> - string(113) "OCIStmtExecute: ORA-00942: table or view does not exist + string(%d) "OCIStmtExecute: ORA-00942: table or view does not exist (%s:%d)" } -- 2.40.0