aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2005-10-14 01:50:23 +0000
committerBruce Momjian <bruce@momjian.us>2005-10-14 01:50:23 +0000
commit7df6dfdda70f6264e6d4122f5c9b71c9b2676edb (patch)
tree88cbb4951ff281d302f9b96d205b44ba33bd7bc9
parent00de66a3b4bd6ab9c42b2c9491519184d3613e54 (diff)
downloadpostgresql-7df6dfdda70f6264e6d4122f5c9b71c9b2676edb.tar.gz
postgresql-7df6dfdda70f6264e6d4122f5c9b71c9b2676edb.zip
[ Backpatch to 8.0.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.y6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y
index 4b9b84e839f..4765ec13c98 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.303.4.4 2005/08/24 10:35:12 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.303.4.5 2005/10/14 01:50:23 momjian Exp $ */
/* Copyright comment */
%{
@@ -5142,8 +5142,8 @@ variable: opt_pointer ECPGColLabel 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)