mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
Update textin() and textout() to new fmgr style. This is just phase
one of updating the whole text datatype, but there are so dang many calls of these two routines that it seems worth a separate commit.
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.62 2000/06/28 03:31:28 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.63 2000/07/05 23:11:11 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -121,7 +121,8 @@ write_password_file(Relation rel)
|
||||
CRYPT_PWD_FILE_SEPSTR
|
||||
"%s\n",
|
||||
nameout(DatumGetName(datum_n)),
|
||||
null_p ? "" : textout((text *) datum_p),
|
||||
null_p ? "" :
|
||||
DatumGetCString(DirectFunctionCall1(textout, datum_p)),
|
||||
null_v ? "\\N" :
|
||||
DatumGetCString(DirectFunctionCall1(nabstimeout, datum_v))
|
||||
);
|
||||
@ -257,7 +258,8 @@ CreateUser(CreateUserStmt *stmt)
|
||||
new_record[Anum_pg_shadow_usecatupd - 1] = (Datum) (stmt->createuser);
|
||||
|
||||
if (stmt->password)
|
||||
new_record[Anum_pg_shadow_passwd - 1] = PointerGetDatum(textin(stmt->password));
|
||||
new_record[Anum_pg_shadow_passwd - 1] =
|
||||
DirectFunctionCall1(textin, CStringGetDatum(stmt->password));
|
||||
if (stmt->validUntil)
|
||||
new_record[Anum_pg_shadow_valuntil - 1] =
|
||||
DirectFunctionCall1(nabstimein, CStringGetDatum(stmt->validUntil));
|
||||
@ -424,13 +426,15 @@ AlterUser(AlterUserStmt *stmt)
|
||||
/* password */
|
||||
if (stmt->password)
|
||||
{
|
||||
new_record[Anum_pg_shadow_passwd - 1] = PointerGetDatum(textin(stmt->password));
|
||||
new_record[Anum_pg_shadow_passwd - 1] =
|
||||
DirectFunctionCall1(textin, CStringGetDatum(stmt->password));
|
||||
new_record_nulls[Anum_pg_shadow_passwd - 1] = ' ';
|
||||
}
|
||||
else
|
||||
{
|
||||
/* leave as is */
|
||||
new_record[Anum_pg_shadow_passwd - 1] = heap_getattr(tuple, Anum_pg_shadow_passwd, pg_shadow_dsc, &null);
|
||||
new_record[Anum_pg_shadow_passwd - 1] =
|
||||
heap_getattr(tuple, Anum_pg_shadow_passwd, pg_shadow_dsc, &null);
|
||||
new_record_nulls[Anum_pg_shadow_passwd - 1] = null ? 'n' : ' ';
|
||||
}
|
||||
|
||||
@ -444,7 +448,8 @@ AlterUser(AlterUserStmt *stmt)
|
||||
else
|
||||
{
|
||||
/* leave as is */
|
||||
new_record[Anum_pg_shadow_valuntil - 1] = heap_getattr(tuple, Anum_pg_shadow_valuntil, pg_shadow_dsc, &null);
|
||||
new_record[Anum_pg_shadow_valuntil - 1] =
|
||||
heap_getattr(tuple, Anum_pg_shadow_valuntil, pg_shadow_dsc, &null);
|
||||
new_record_nulls[Anum_pg_shadow_valuntil - 1] = null ? 'n' : ' ';
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user