Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b0d71b

Browse files
author
Michael Meskes
committed
Fixed test for array boundary.
Instead of continuing if the next character is not an array boundary get_data() used to continue only on finding a boundary so it was not able to read any element after the first.
1 parent 0f6d011 commit 6b0d71b

File tree

1 file changed

+3
-1
lines changed
  • src/interfaces/ecpg/ecpglib

1 file changed

+3
-1
lines changed

src/interfaces/ecpg/ecpglib/data.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
422422
ecpg_raise(lineno, ECPG_CONVERT_BOOL,
423423
ECPG_SQLSTATE_DATATYPE_MISMATCH,
424424
NULL);
425+
pval++;
425426
break;
426427
}
427428
else if (pval[0] == 't' && pval[1] == '\0')
@@ -434,6 +435,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
434435
ecpg_raise(lineno, ECPG_CONVERT_BOOL,
435436
ECPG_SQLSTATE_DATATYPE_MISMATCH,
436437
NULL);
438+
pval++;
437439
break;
438440
}
439441
else if (pval[0] == '\0' && PQgetisnull(results, act_tuple, act_field))
@@ -777,7 +779,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
777779
++pval;
778780
}
779781
}
780-
} while (*pval != '\0' && array_boundary(isarray, *pval));
782+
} while (*pval != '\0' && !array_boundary(isarray, *pval));
781783

782784
return (true);
783785
}

0 commit comments

Comments
 (0)