1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Avoid an Assert failure if OuterUserId hasn't been set yet during

AbortTransaction.  This can happen if a backend's InitPostgres transaction
fails (eg, because the given username is invalid).  Per Alvaro.
This commit is contained in:
Tom Lane
2005-08-17 22:14:34 +00:00
parent 63f850cd4d
commit f8d0a82bf9
3 changed files with 23 additions and 7 deletions

View File

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.212 2005/08/08 19:17:22 tgl Exp $
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.213 2005/08/17 22:14:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -1877,8 +1877,8 @@ AbortTransaction(void)
/*
* Reset user id which might have been changed transiently. We cannot
* use s->currentUser, but must get the session outer-level userid from
* miscinit.c.
* use s->currentUser, since it may not be set yet; instead rely on
* internal state of miscinit.c.
*
* (Note: it is not necessary to restore session authorization here
* because that can only be changed via GUC, and GUC will take care of
@ -1886,7 +1886,7 @@ AbortTransaction(void)
* DEFINER function could send control here with the wrong current
* userid.)
*/
SetUserId(GetOuterUserId());
AtAbort_UserId();
/*
* do abort processing