Fix oversight in pts_error_callback()

From: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
To: pgsql-patches(at)postgresql(dot)org
Subject: Fix oversight in pts_error_callback()
Date: 2005-08-09 05:55:38
Message-ID: dd9gld$2e0u$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Since we will invoke callback functions unconditionally in errfinish(), so
pts_error_callback() should not report "invalid type name" without checking
current error status.

Regards,
Qingqing

Index: src/backend/parser/parse_type.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/parser/parse_type.c,v
retrieving revision 1.76
diff -c -r1.76 parse_type.c
*** src/backend/parser/parse_type.c 1 Aug 2005 20:31:10 -0000 1.76
--- src/backend/parser/parse_type.c 9 Aug 2005 05:53:08 -0000
***************
*** 359,373 ****
pts_error_callback(void *arg)
{
const char *str = (const char *) arg;
!
! errcontext("invalid type name \"%s\"", str);

/*
* Currently we just suppress any syntax error position report,
rather
* than transforming to an "internal query" error. It's
unlikely that
* a type name is complex enough to need positioning.
*/
! errposition(0);
}

/*
--- 359,379 ----
pts_error_callback(void *arg)
{
const char *str = (const char *) arg;
! int syntaxerrposition;

/*
* Currently we just suppress any syntax error position report,
rather
* than transforming to an "internal query" error. It's
unlikely that
* a type name is complex enough to need positioning.
*/
! syntaxerrposition = geterrposition();
! if (syntaxerrposition > 0)
! {
! errcontext("invalid type name \"%s\"", str);
! errposition(0);
! }
! else
! errcontext("parse type string \"%s\"", str);
}

/*

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-08-09 14:38:25 Re: Fix oversight in pts_error_callback()
Previous Message yuanjia lee 2005-08-09 03:46:40 Allow WAL information to recover corrupted pg_controldata patch