diff options
author | Bruce Momjian <bruce@momjian.us> | 2005-10-14 01:50:58 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2005-10-14 01:50:58 +0000 |
commit | e257f28db012b0c5d2056fc0456f5c1e80e989b6 (patch) | |
tree | 3244c04c96a1c77df3d09a9d53c880d44ceeabef | |
parent | 5c05d165afe108e70a63d65a31964072f4396c23 (diff) |
[ Backpatch to 7.4.X.]
Also I fixed a bug in a bug fix I committed a few weeks ago. he check
for a varchar pointer was incomplete.
Michael Meskes
-rw-r--r-- | src/interfaces/ecpg/preproc/preproc.y | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index 80b166221b0..d42dbc2709f 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.263.2.20 2005/08/24 10:35:54 meskes Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.263.2.21 2005/10/14 01:50:58 momjian Exp $ */ /* Copyright comment */ %{ @@ -5121,8 +5121,8 @@ variable: opt_pointer ECPGColLabelCommon opt_array_bounds opt_initializer *dim = '\0'; else sprintf(dim, "[%s]", dimension); - /* if (strcmp(length, "0") == 0)*/ - if (atoi(length) <= 0) + /* cannot check for atoi <= 0 because a defined constant will yield 0 here as well */ + if (atoi(length) < 0 || strcmp(length, "0") == 0) mmerror(PARSE_ERROR, ET_ERROR, "pointer to varchar are not implemented"); if (strcmp(dimension, "0") == 0) |