cvs: php4 /ext/informix ifx.ec
| From: | Danny Heijl | Date: | Tue, 11 Jul 2000 17:47:15 +0000 |
| Subject: | cvs: php4 /ext/informix ifx.ec | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-724@lists.php.net to get a copy of this message | ||
danny Tue Jul 11 10:47:15 2000 EDT
Modified files:
/php4/ext/informix ifx.ec
Log:
- Work-around for ESQL/C bug with BLOBs and NULL values (Danny).
Index: php4/ext/informix/ifx.ec
diff -u php4/ext/informix/ifx.ec:1.40 php4/ext/informix/ifx.ec:1.41
--- php4/ext/informix/ifx.ec:1.40 Mon Jul 10 12:08:26 2000
+++ php4/ext/informix/ifx.ec Tue Jul 11 10:47:15 2000
@@ -2168,8 +2168,12 @@
++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 @@
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 @@
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)