1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-01 21:31:19 +03:00

Fix snprintf with strings, and nextval('"Aa"');

This commit is contained in:
Bruce Momjian
1999-03-16 04:26:01 +00:00
parent 434762b559
commit 89b762e509
7 changed files with 6454 additions and 6451 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.40 1999/03/15 16:48:34 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.41 1999/03/16 04:25:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -580,7 +580,15 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
elog(ERROR, "Only constant sequence names are acceptable for function '%s'", funcname);
seqrel = textout((text *) DatumGetPointer(seq->constvalue));
if (RelnameFindRelid(seqrel) == InvalidOid)
/* Do we have nextval('"Aa"')? */
if (strlen(seqrel) >= 2 &&
seqrel[0] == '\"' && seqrel[strlen(seqrel)-1] == '\"')
{
/* strip off quotes, keep case */
seqrel = pstrdup(seqrel+1);
seqrel[strlen(seqrel)-1] = '\0';
}
else
{
pfree(seqrel);
seqname = lower((text *) DatumGetPointer(seq->constvalue));