From: Danny Heijl Date: Tue, 11 Jul 2000 17:47:16 +0000 (+0000) Subject: - Work-around for ESQL/C bug with BLOBs and NULL values (Danny). X-Git-Tag: PRE_FILE_COMPILE_API_CHANGE~302 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ec6861733bd94d094544a75094386b62b8cef97a;p=php - Work-around for ESQL/C bug with BLOBs and NULL values (Danny). --- diff --git a/ext/informix/ifx.ec b/ext/informix/ifx.ec index 789f62344a..5664a0e55f 100644 --- a/ext/informix/ifx.ec +++ b/ext/informix/ifx.ec @@ -2168,8 +2168,12 @@ $endif; ++locind; EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :*locator_b = DATA; - - if (locator_b->loc_indicator == -1) { // additional check for NULL + /* work around for ESQL/C bug with NULL values and BLOBS */ + if ((locator_b->loc_status < 0) && (locator_b->loc_bufsize == 0)){ + locator_b->loc_indicator == -1; + } + /* normal check for NULL values */ + if (locator_b->loc_indicator == -1) { if((IFXG(textasvarchar)==0 && fieldtype==SQLTEXT) || (IFXG(byteasvarchar)==0 && fieldtype==SQLBYTES)) { bid_b=Ifx_Result->res_id[locind]; @@ -2187,7 +2191,7 @@ $endif; add_assoc_string(return_value, fieldname, nullstr, DUP); break; } - } + } if (locator_b->loc_status < 0) { /* blob too large */ php_error(E_WARNING,"no memory (%d bytes) for blob", @@ -2529,6 +2533,11 @@ $endif; EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :*locator_b = DATA; + /* work around for ESQL/C bug with NULL values and BLOBS */ + if ((locator_b->loc_status < 0) && (locator_b->loc_bufsize == 0)){ + locator_b->loc_indicator == -1; + } + /* normal check for NULL values */ if (locator_b->loc_indicator == -1) { if ( (fieldtype==SQLTEXT) || (fieldtype==SQLBYTES)