Commit 65faaf30 authored by Bruce Momjian's avatar Bruce Momjian

atttypmod now -1.

parent ec9d5d71
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.32 1998/01/16 23:19:16 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.33 1998/02/07 06:10:30 momjian Exp $
* *
* NOTES * NOTES
* some of the executor utility code such as "ExecTypeFromTL" should be * some of the executor utility code such as "ExecTypeFromTL" should be
...@@ -301,7 +301,7 @@ TupleDescInitEntry(TupleDesc desc, ...@@ -301,7 +301,7 @@ TupleDescInitEntry(TupleDesc desc,
att->attdisbursion = 0; /* dummy value */ att->attdisbursion = 0; /* dummy value */
att->attcacheoff = -1; att->attcacheoff = -1;
att->atttypmod = 0; att->atttypmod = -1;
att->attnum = attributeNumber; att->attnum = attributeNumber;
att->attnelems = attdim; att->attnelems = attdim;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.34 1998/02/06 19:18:06 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.35 1998/02/07 06:10:34 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -627,6 +627,7 @@ DefineAttr(char *name, char *type, int attnum) ...@@ -627,6 +627,7 @@ DefineAttr(char *name, char *type, int attnum)
attrtypes[attnum]->attbyval = (attlen == 1) || (attlen == 2) || (attlen == 4); attrtypes[attnum]->attbyval = (attlen == 1) || (attlen == 2) || (attlen == 4);
} }
attrtypes[attnum]->attcacheoff = -1; attrtypes[attnum]->attcacheoff = -1;
attrtypes[attnum]->atttypmod = -1;
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.44 1998/02/05 19:02:44 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.45 1998/02/07 06:10:39 momjian Exp $
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
* heap_create() - Create an uncataloged heap relation * heap_create() - Create an uncataloged heap relation
...@@ -97,32 +97,32 @@ static void RemoveConstraints(Relation rel); ...@@ -97,32 +97,32 @@ static void RemoveConstraints(Relation rel);
static FormData_pg_attribute a1 = { static FormData_pg_attribute a1 = {
0xffffffff, {"ctid"}, 27l, 0l, sizeof(ItemPointerData), 0xffffffff, {"ctid"}, 27l, 0l, sizeof(ItemPointerData),
SelfItemPointerAttributeNumber, 0, -1, 0, '\0', '\0', 'i', '\0', '\0' SelfItemPointerAttributeNumber, 0, -1, -1, '\0', '\0', 'i', '\0', '\0'
}; };
static FormData_pg_attribute a2 = { static FormData_pg_attribute a2 = {
0xffffffff, {"oid"}, 26l, 0l, sizeof(Oid), 0xffffffff, {"oid"}, 26l, 0l, sizeof(Oid),
ObjectIdAttributeNumber, 0, -1, 0, '\001', '\0', 'i', '\0', '\0' ObjectIdAttributeNumber, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'
}; };
static FormData_pg_attribute a3 = { static FormData_pg_attribute a3 = {
0xffffffff, {"xmin"}, 28l, 0l, sizeof(TransactionId), 0xffffffff, {"xmin"}, 28l, 0l, sizeof(TransactionId),
MinTransactionIdAttributeNumber, 0, -1, 0, '\0', '\0', 'i', '\0', '\0' MinTransactionIdAttributeNumber, 0, -1, -1, '\0', '\0', 'i', '\0', '\0'
}; };
static FormData_pg_attribute a4 = { static FormData_pg_attribute a4 = {
0xffffffff, {"cmin"}, 29l, 0l, sizeof(CommandId), 0xffffffff, {"cmin"}, 29l, 0l, sizeof(CommandId),
MinCommandIdAttributeNumber, 0, -1, 0, '\001', '\0', 'i', '\0', '\0' MinCommandIdAttributeNumber, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'
}; };
static FormData_pg_attribute a5 = { static FormData_pg_attribute a5 = {
0xffffffff, {"xmax"}, 28l, 0l, sizeof(TransactionId), 0xffffffff, {"xmax"}, 28l, 0l, sizeof(TransactionId),
MaxTransactionIdAttributeNumber, 0, -1, 0, '\0', '\0', 'i', '\0', '\0' MaxTransactionIdAttributeNumber, 0, -1, -1, '\0', '\0', 'i', '\0', '\0'
}; };
static FormData_pg_attribute a6 = { static FormData_pg_attribute a6 = {
0xffffffff, {"cmax"}, 29l, 0l, sizeof(CommandId), 0xffffffff, {"cmax"}, 29l, 0l, sizeof(CommandId),
MaxCommandIdAttributeNumber, 0, -1, 0, '\001', '\0', 'i', '\0', '\0' MaxCommandIdAttributeNumber, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'
}; };
static AttributeTupleForm HeapAtt[] = static AttributeTupleForm HeapAtt[] =
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.36 1998/01/16 23:19:27 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.37 1998/02/07 06:10:49 momjian Exp $
* *
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
...@@ -118,12 +118,12 @@ DefaultBuild(Relation heapRelation, Relation indexRelation, ...@@ -118,12 +118,12 @@ DefaultBuild(Relation heapRelation, Relation indexRelation,
* ---------------------------------------------------------------- * ----------------------------------------------------------------
*/ */
static FormData_pg_attribute sysatts[] = { static FormData_pg_attribute sysatts[] = {
{0l, {"ctid"}, 27l, 0l, 6, -1, 0, -1, 0, '\0', '\0', 'i', '\0', '\0'}, {0l, {"ctid"}, 27l, 0l, 6, -1, 0, -1, -1, '\0', '\0', 'i', '\0', '\0'},
{0l, {"oid"}, 26l, 0l, 4, -2, 0, -1, 0, '\001', '\0', 'i', '\0', '\0'}, {0l, {"oid"}, 26l, 0l, 4, -2, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'},
{0l, {"xmin"}, 28l, 0l, 4, -3, 0, -1, 0, '\0', '\0', 'i', '\0', '\0'}, {0l, {"xmin"}, 28l, 0l, 4, -3, 0, -1, -1, '\0', '\0', 'i', '\0', '\0'},
{0l, {"cmin"}, 29l, 0l, 4, -4, 0, -1, 0, '\001', '\0', 'i', '\0', '\0'}, {0l, {"cmin"}, 29l, 0l, 4, -4, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'},
{0l, {"xmax"}, 28l, 0l, 4, -5, 0, -1, 0, '\0', '\0', 'i', '\0', '\0'}, {0l, {"xmax"}, 28l, 0l, 4, -5, 0, -1, -1, '\0', '\0', 'i', '\0', '\0'},
{0l, {"cmax"}, 29l, 0l, 4, -6, 0, -1, 0, '\001', '\0', 'i', '\0', '\0'}, {0l, {"cmax"}, 29l, 0l, 4, -6, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'},
}; };
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
...@@ -437,7 +437,7 @@ ConstructTupleDescriptor(Oid heapoid, ...@@ -437,7 +437,7 @@ ConstructTupleDescriptor(Oid heapoid,
((AttributeTupleForm) to)->attnotnull = false; ((AttributeTupleForm) to)->attnotnull = false;
((AttributeTupleForm) to)->atthasdef = false; ((AttributeTupleForm) to)->atthasdef = false;
((AttributeTupleForm) to)->atttypmod = 0; ((AttributeTupleForm) to)->atttypmod = -1;
/* /*
* if the keytype is defined, we need to change the tuple form's * if the keytype is defined, we need to change the tuple form's
......
...@@ -98,7 +98,7 @@ DefineSequence(CreateSeqStmt *seq) ...@@ -98,7 +98,7 @@ DefineSequence(CreateSeqStmt *seq)
typnam = makeNode(TypeName); typnam = makeNode(TypeName);
typnam->setof = FALSE; typnam->setof = FALSE;
typnam->arrayBounds = NULL; typnam->arrayBounds = NULL;
typnam->typmod = 0; typnam->typmod = -1;
coldef = makeNode(ColumnDef); coldef = makeNode(ColumnDef);
coldef->typename = typnam; coldef->typename = typnam;
coldef->defval = NULL; coldef->defval = NULL;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.26 1998/01/20 05:03:30 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.27 1998/02/07 06:11:21 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -531,6 +531,7 @@ ExecSetTypeInfo(int index, ...@@ -531,6 +531,7 @@ ExecSetTypeInfo(int index,
att->attproc = 0; /* dummy value */ att->attproc = 0; /* dummy value */
att->attnelems = 0; /* dummy value */ att->attnelems = 0; /* dummy value */
att->attcacheoff = -1; att->attcacheoff = -1;
att->atttypmod = -1;
att->attisset = false; att->attisset = false;
att->attalign = attalign; att->attalign = attalign;
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.17 1998/02/06 16:46:29 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.18 1998/02/07 06:11:30 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -101,7 +101,7 @@ transformExpr(ParseState *pstate, Node *expr, int precedence) ...@@ -101,7 +101,7 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
Value *val = &con->val; Value *val = &con->val;
if (con->typename != NULL) if (con->typename != NULL)
result = parser_typecast(val, con->typename, 0); result = parser_typecast(val, con->typename, -1);
else else
result = (Node *) make_const(val); result = (Node *) make_const(val);
break; break;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.25 1998/02/05 17:22:41 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.26 1998/02/07 06:11:38 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -60,7 +60,7 @@ bpcharin(char *s, int dummy, int atttypmod) ...@@ -60,7 +60,7 @@ bpcharin(char *s, int dummy, int atttypmod)
if (s == NULL) if (s == NULL)
return ((char *) NULL); return ((char *) NULL);
if (atttypmod < 1) if (atttypmod == -1)
{ {
/* /*
...@@ -133,7 +133,7 @@ varcharin(char *s, int dummy, int atttypmod) ...@@ -133,7 +133,7 @@ varcharin(char *s, int dummy, int atttypmod)
return ((char *) NULL); return ((char *) NULL);
len = strlen(s) + VARHDRSZ; len = strlen(s) + VARHDRSZ;
if (atttypmod > 0 && len > atttypmod) if (atttypmod != -1 && len > atttypmod)
len = atttypmod; /* clip the string at max length */ len = atttypmod; /* clip the string at max length */
if (len > 4096) if (len > 4096)
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.132 1998/02/06 17:46:31 momjian Exp $ * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.133 1998/02/07 06:11:47 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -689,7 +689,7 @@ tableDesc(PsqlSettings *pset, char *table, FILE *fout) ...@@ -689,7 +689,7 @@ tableDesc(PsqlSettings *pset, char *table, FILE *fout)
fprintf(fout,"%6s |", "var"); fprintf(fout,"%6s |", "var");
else if (strcmp(rtype, "bpchar") == 0 || else if (strcmp(rtype, "bpchar") == 0 ||
strcmp(rtype, "varchar") == 0) strcmp(rtype, "varchar") == 0)
fprintf(fout,"%6i |", atttypmod > 0 ? atttypmod - VARHDRSZ : 0); fprintf(fout,"%6i |", atttypmod != -1 ? atttypmod - VARHDRSZ : 0);
else else
{ {
if (attlen > 0) if (attlen > 0)
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment