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:
@ -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
|
||||
|
Reference in New Issue
Block a user