aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorItagaki Takahiro <itagaki.takahiro@gmail.com>2011-02-01 15:21:32 +0900
committerItagaki Takahiro <itagaki.takahiro@gmail.com>2011-02-01 15:21:32 +0900
commit0c707aa4583a5584f4c3f4ad1697bb206ed0d65a (patch)
tree6bcf18b701e62751bbde1f89f7af286b95c5c60f /src
parent03282bfa8973f3a77ca3e7c14847a5a11d07d6a2 (diff)
downloadpostgresql-0c707aa4583a5584f4c3f4ad1697bb206ed0d65a.tar.gz
postgresql-0c707aa4583a5584f4c3f4ad1697bb206ed0d65a.zip
Fix wrong error reports in 'number of array dimensions exceeds the
maximum allowed' messages, that have reported one-less dimensions. Alexey Klyukin
Diffstat (limited to 'src')
-rw-r--r--src/backend/executor/execQual.c4
-rw-r--r--src/backend/utils/adt/arrayfuncs.c4
-rw-r--r--src/pl/plpgsql/src/pl_exec.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c
index 8bc086fc404..5e38c20ca68 100644
--- a/src/backend/executor/execQual.c
+++ b/src/backend/executor/execQual.c
@@ -296,7 +296,7 @@ ExecEvalArrayRef(ArrayRefExprState *astate,
ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
errmsg("number of array dimensions (%d) exceeds the maximum allowed (%d)",
- i, MAXDIM)));
+ i + 1, MAXDIM)));
upper.indx[i++] = DatumGetInt32(ExecEvalExpr(eltstate,
econtext,
@@ -324,7 +324,7 @@ ExecEvalArrayRef(ArrayRefExprState *astate,
ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
errmsg("number of array dimensions (%d) exceeds the maximum allowed (%d)",
- i, MAXDIM)));
+ j + 1, MAXDIM)));
lower.indx[j++] = DatumGetInt32(ExecEvalExpr(eltstate,
econtext,
diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c
index d5391e8b983..931c6953cb3 100644
--- a/src/backend/utils/adt/arrayfuncs.c
+++ b/src/backend/utils/adt/arrayfuncs.c
@@ -202,7 +202,7 @@ array_in(PG_FUNCTION_ARGS)
ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
errmsg("number of array dimensions (%d) exceeds the maximum allowed (%d)",
- ndim, MAXDIM)));
+ ndim + 1, MAXDIM)));
for (q = p; isdigit((unsigned char) *q) || (*q == '-') || (*q == '+'); q++);
if (q == p) /* no digits? */
@@ -481,7 +481,7 @@ ArrayCount(const char *str, int *dim, char typdelim)
ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
errmsg("number of array dimensions (%d) exceeds the maximum allowed (%d)",
- nest_level, MAXDIM)));
+ nest_level + 1, MAXDIM)));
temp[nest_level] = 0;
nest_level++;
if (ndim < nest_level)
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c
index 3e40945e35d..b685841d971 100644
--- a/src/pl/plpgsql/src/pl_exec.c
+++ b/src/pl/plpgsql/src/pl_exec.c
@@ -3786,7 +3786,7 @@ exec_assign_value(PLpgSQL_execstate *estate,
ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
errmsg("number of array dimensions (%d) exceeds the maximum allowed (%d)",
- nsubscripts, MAXDIM)));
+ nsubscripts + 1, MAXDIM)));
subscripts[nsubscripts++] = arrayelem->subscript;
target = estate->datums[arrayelem->arrayparentno];
} while (target->dtype == PLPGSQL_DTYPE_ARRAYELEM);