1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-14 18:42:34 +03:00

Repair core dump when trying to delete an entry from an already-NULL

datconfig or useconfig field.  Per report from Dustin Sallings.
This commit is contained in:
Tom Lane
2002-12-02 05:20:47 +00:00
parent dfebfc1bc8
commit 2802668159
3 changed files with 46 additions and 20 deletions

View File

@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.113 2002/10/21 19:46:45 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.114 2002/12/02 05:20:47 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -915,8 +915,10 @@ AlterUserSet(AlterUserSetStmt *stmt)
repl_repl[Anum_pg_shadow_useconfig - 1] = 'r';
if (strcmp(stmt->variable, "all") == 0 && valuestr == NULL)
{
/* RESET ALL */
repl_null[Anum_pg_shadow_useconfig - 1] = 'n';
}
else
{
Datum datum;
@ -935,7 +937,10 @@ AlterUserSet(AlterUserSetStmt *stmt)
else
array = GUCArrayDelete(array, stmt->variable);
repl_val[Anum_pg_shadow_useconfig - 1] = PointerGetDatum(array);
if (array)
repl_val[Anum_pg_shadow_useconfig - 1] = PointerGetDatum(array);
else
repl_null[Anum_pg_shadow_useconfig - 1] = 'n';
}
newtuple = heap_modifytuple(oldtuple, rel, repl_val, repl_null, repl_repl);