mirror of
https://github.com/php/php-src.git
synced 2025-08-20 01:14:28 +02:00
- Fix the case of NULL BYTE and TEXT columns. (Danny).
ESQL/C (sometimes ?) does not set the indicator variable, but the locator->loc_indicator instead.
This commit is contained in:
parent
ac8e3b67d0
commit
42693bb820
1 changed files with 33 additions and 2 deletions
|
@ -2162,12 +2162,33 @@ $ifdef HAVE_IFX_IUS;
|
||||||
$endif;
|
$endif;
|
||||||
|
|
||||||
case SQLBYTES :
|
case SQLBYTES :
|
||||||
case SQLTEXT : /* NULL has already been dealt with */
|
case SQLTEXT :
|
||||||
bid_b=Ifx_Result->res_id[locind];
|
bid_b=Ifx_Result->res_id[locind];
|
||||||
locator_b=php3_intifx_get_blobloc(bid_b,&EG(regular_list));
|
locator_b=php3_intifx_get_blobloc(bid_b,&EG(regular_list));
|
||||||
++locind;
|
++locind;
|
||||||
|
|
||||||
EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :*locator_b = DATA;
|
EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :*locator_b = DATA;
|
||||||
|
|
||||||
|
if (locator_b->loc_indicator == -1) { // additional check for NULL
|
||||||
|
if((IFXG(textasvarchar)==0 && fieldtype==SQLTEXT)
|
||||||
|
|| (IFXG(byteasvarchar)==0 && fieldtype==SQLBYTES)) {
|
||||||
|
bid_b=Ifx_Result->res_id[locind];
|
||||||
|
bid=php3_intifx_copy_blob(bid_b, &EG(regular_list));
|
||||||
|
php3_intifx_update_blob(bid,nullstr,strlen(nullstr),&EG(regular_list));
|
||||||
|
add_assoc_long(return_value,fieldname,bid);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
(fieldtype==SQLTEXT) || (fieldtype==SQLBYTES)
|
||||||
|
$ifdef HAVE_IFX_IUS;
|
||||||
|
|| (fieldtype==SQLUDTFIXED)
|
||||||
|
$endif;
|
||||||
|
) {
|
||||||
|
add_assoc_string(return_value, fieldname, nullstr, DUP);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (locator_b->loc_status < 0) { /* blob too large */
|
if (locator_b->loc_status < 0) { /* blob too large */
|
||||||
php_error(E_WARNING,"no memory (%d bytes) for blob",
|
php_error(E_WARNING,"no memory (%d bytes) for blob",
|
||||||
locator_b->loc_bufsize);
|
locator_b->loc_bufsize);
|
||||||
|
@ -2499,7 +2520,6 @@ $endif;
|
||||||
char_data = NULL;
|
char_data = NULL;
|
||||||
break;
|
break;
|
||||||
case SQLTEXT :
|
case SQLTEXT :
|
||||||
/* NULL has already been dealt with */
|
|
||||||
/* treated always as a long VARCHAR here */
|
/* treated always as a long VARCHAR here */
|
||||||
/* if blobinbfile, too bad */
|
/* if blobinbfile, too bad */
|
||||||
bid_b=Ifx_Result->res_id[locind];
|
bid_b=Ifx_Result->res_id[locind];
|
||||||
|
@ -2509,6 +2529,17 @@ $endif;
|
||||||
|
|
||||||
EXEC SQL GET DESCRIPTOR :descrpid VALUE :i
|
EXEC SQL GET DESCRIPTOR :descrpid VALUE :i
|
||||||
:*locator_b = DATA;
|
:*locator_b = DATA;
|
||||||
|
if (locator_b->loc_indicator == -1) {
|
||||||
|
if (
|
||||||
|
(fieldtype==SQLTEXT) || (fieldtype==SQLBYTES)
|
||||||
|
$ifdef HAVE_IFX_IUS;
|
||||||
|
|| (fieldtype==SQLUDTFIXED)
|
||||||
|
$endif;
|
||||||
|
) {
|
||||||
|
php_printf("<td>%s</td>", nullstr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (locator_b->loc_status < 0) { /* blob too large */
|
if (locator_b->loc_status < 0) { /* blob too large */
|
||||||
php_error(E_WARNING,"no memory (%d bytes) for blob",
|
php_error(E_WARNING,"no memory (%d bytes) for blob",
|
||||||
locator_b->loc_bufsize);
|
locator_b->loc_bufsize);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue