Skip to content

Commit fb50e0b

Browse files
committed
Workaround for empty/all whitespace string on trim
1 parent 0e1f023 commit fb50e0b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ibm_db2.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6265,6 +6265,11 @@ static void _php_db2_bind_fetch_helper(INTERNAL_FUNCTION_PARAMETERS, int op)
62656265
i5trim++;
62666266
break;
62676267
}
6268+
// CB 20221227: fix from Luca for all-space/empty strings
6269+
// ugly, but works
6270+
if (i5trim < 0) {
6271+
i5trim = 0;
6272+
}
62686273
if ( op & DB2_FETCH_ASSOC ) {
62696274
add_assoc_stringl(return_value, (char *)stmt_res->column_info[i].name,
62706275
(char *)row_data->str_val, i5trim);

0 commit comments

Comments
 (0)