mirror of
https://github.com/postgres/postgres.git
synced 2025-05-08 07:21:33 +03:00
Fix up crashing symptoms for new serial type by making sure constraint
and index name fields are pstrdup'd (copied) rather than reused.
This commit is contained in:
parent
a873da484f
commit
651e31bb80
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.81 1998/08/25 15:08:12 thomas Exp $
|
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.82 1998/08/26 04:20:27 thomas Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -518,7 +518,7 @@ transformCreateStmt(ParseState *pstate, CreateStmt *stmt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
sequence = makeNode(CreateSeqStmt);
|
sequence = makeNode(CreateSeqStmt);
|
||||||
sequence->seqname = constraint->name;
|
sequence->seqname = pstrdup(constraint->name);
|
||||||
sequence->options = NIL;
|
sequence->options = NIL;
|
||||||
|
|
||||||
elog(NOTICE, "CREATE TABLE will create implicit sequence %s for SERIAL column %s.%s",
|
elog(NOTICE, "CREATE TABLE will create implicit sequence %s for SERIAL column %s.%s",
|
||||||
@ -528,6 +528,7 @@ transformCreateStmt(ParseState *pstate, CreateStmt *stmt)
|
|||||||
|
|
||||||
constraint = makeNode(Constraint);
|
constraint = makeNode(Constraint);
|
||||||
constraint->contype = CONSTR_UNIQUE;
|
constraint->contype = CONSTR_UNIQUE;
|
||||||
|
constraint->name = makeTableName(stmt->relname, column->colname, "key", NULL);
|
||||||
|
|
||||||
column->constraints = lappend(column->constraints, constraint);
|
column->constraints = lappend(column->constraints, constraint);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user