summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2000-04-15 19:13:08 +0000
committerTom Lane2000-04-15 19:13:08 +0000
commit4ca7d148cb5f46b79b7da15d3330ac7361b85c21 (patch)
treee5b6a33e5c391336102cda7d0782aa5469f22e2e
parentffc9812451c67293ea2ff4cf60ba8c195ca9616b (diff)
elog(NOTICE) during COPY incorrectly reset lineno to 0, causing any
subsequent elogs() in the same COPY operation to display the wrong line number. Fix is to clear lineno only when elog level is such that we will not return to caller.
-rw-r--r--src/backend/utils/error/elog.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index 8296b1d919f..82da3875a30 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.56 2000/04/12 17:15:55 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.57 2000/04/15 19:13:08 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -197,8 +197,9 @@ elog(int lev, const char *fmt,...)
if (lineno)
{
sprintf(bp, "copy: line %d, ", lineno);
- bp = fmt_buf + strlen(fmt_buf);
- lineno = 0;
+ bp += strlen(bp);
+ if (lev == ERROR || lev >= FATAL)
+ lineno = 0;
}
for (cp = fmt; *cp; cp++)