From 0b576f6f1135479bbc466dbb29da5a352d853161 Mon Sep 17 00:00:00 2001 From: Matteo Beccati Date: Thu, 23 Apr 2009 13:26:10 +0000 Subject: MFH: - Reverted previous fix for bug #46274 and properly fixed it - Fixed bug #48060 # Also added tests for pdo_oci as it's the only other driver currently # using streams: no regression found --- ext/pdo_pgsql/pgsql_statement.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'ext/pdo_pgsql/pgsql_statement.c') diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index d711ecff29..8a7882ffe4 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -619,8 +619,14 @@ static int pgsql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned return 0; } else { *ptr = php_pdo_pgsql_unescape_bytea(*ptr, &tmp_len); - *len = tmp_len; - *caller_frees = 1; + if (!tmp_len) { + /* Empty string, return as empty stream */ + *ptr = (char *)php_stream_memory_open(TEMP_STREAM_READONLY, "", 0); + *len = 0; + } else { + *len = tmp_len; + *caller_frees = 1; + } } break; case PDO_PARAM_NULL: -- cgit v1.2.1