Skip to content

Commit 65faaf3

Browse files
committed
atttypmod now -1.
1 parent ec9d5d7 commit 65faaf3

File tree

10 files changed

+247
-245
lines changed

10 files changed

+247
-245
lines changed

src/backend/access/common/tupdesc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.32 1998/01/16 23:19:16 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.33 1998/02/07 06:10:30 momjian Exp $
1111
*
1212
* NOTES
1313
* some of the executor utility code such as "ExecTypeFromTL" should be
@@ -301,7 +301,7 @@ TupleDescInitEntry(TupleDesc desc,
301301

302302
att->attdisbursion = 0; /* dummy value */
303303
att->attcacheoff = -1;
304-
att->atttypmod = 0;
304+
att->atttypmod = -1;
305305

306306
att->attnum = attributeNumber;
307307
att->attnelems = attdim;

src/backend/bootstrap/bootstrap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.34 1998/02/06 19:18:06 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.35 1998/02/07 06:10:34 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -627,6 +627,7 @@ DefineAttr(char *name, char *type, int attnum)
627627
attrtypes[attnum]->attbyval = (attlen == 1) || (attlen == 2) || (attlen == 4);
628628
}
629629
attrtypes[attnum]->attcacheoff = -1;
630+
attrtypes[attnum]->atttypmod = -1;
630631
}
631632

632633

src/backend/catalog/heap.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.44 1998/02/05 19:02:44 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.45 1998/02/07 06:10:39 momjian Exp $
1111
*
1212
* INTERFACE ROUTINES
1313
* heap_create() - Create an uncataloged heap relation
@@ -97,32 +97,32 @@ static void RemoveConstraints(Relation rel);
9797

9898
static FormData_pg_attribute a1 = {
9999
0xffffffff, {"ctid"}, 27l, 0l, sizeof(ItemPointerData),
100-
SelfItemPointerAttributeNumber, 0, -1, 0, '\0', '\0', 'i', '\0', '\0'
100+
SelfItemPointerAttributeNumber, 0, -1, -1, '\0', '\0', 'i', '\0', '\0'
101101
};
102102

103103
static FormData_pg_attribute a2 = {
104104
0xffffffff, {"oid"}, 26l, 0l, sizeof(Oid),
105-
ObjectIdAttributeNumber, 0, -1, 0, '\001', '\0', 'i', '\0', '\0'
105+
ObjectIdAttributeNumber, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'
106106
};
107107

108108
static FormData_pg_attribute a3 = {
109109
0xffffffff, {"xmin"}, 28l, 0l, sizeof(TransactionId),
110-
MinTransactionIdAttributeNumber, 0, -1, 0, '\0', '\0', 'i', '\0', '\0'
110+
MinTransactionIdAttributeNumber, 0, -1, -1, '\0', '\0', 'i', '\0', '\0'
111111
};
112112

113113
static FormData_pg_attribute a4 = {
114114
0xffffffff, {"cmin"}, 29l, 0l, sizeof(CommandId),
115-
MinCommandIdAttributeNumber, 0, -1, 0, '\001', '\0', 'i', '\0', '\0'
115+
MinCommandIdAttributeNumber, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'
116116
};
117117

118118
static FormData_pg_attribute a5 = {
119119
0xffffffff, {"xmax"}, 28l, 0l, sizeof(TransactionId),
120-
MaxTransactionIdAttributeNumber, 0, -1, 0, '\0', '\0', 'i', '\0', '\0'
120+
MaxTransactionIdAttributeNumber, 0, -1, -1, '\0', '\0', 'i', '\0', '\0'
121121
};
122122

123123
static FormData_pg_attribute a6 = {
124124
0xffffffff, {"cmax"}, 29l, 0l, sizeof(CommandId),
125-
MaxCommandIdAttributeNumber, 0, -1, 0, '\001', '\0', 'i', '\0', '\0'
125+
MaxCommandIdAttributeNumber, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'
126126
};
127127

128128
static AttributeTupleForm HeapAtt[] =

src/backend/catalog/index.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.36 1998/01/16 23:19:27 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.37 1998/02/07 06:10:49 momjian Exp $
1111
*
1212
*
1313
* INTERFACE ROUTINES
@@ -118,12 +118,12 @@ DefaultBuild(Relation heapRelation, Relation indexRelation,
118118
* ----------------------------------------------------------------
119119
*/
120120
static FormData_pg_attribute sysatts[] = {
121-
{0l, {"ctid"}, 27l, 0l, 6, -1, 0, -1, 0, '\0', '\0', 'i', '\0', '\0'},
122-
{0l, {"oid"}, 26l, 0l, 4, -2, 0, -1, 0, '\001', '\0', 'i', '\0', '\0'},
123-
{0l, {"xmin"}, 28l, 0l, 4, -3, 0, -1, 0, '\0', '\0', 'i', '\0', '\0'},
124-
{0l, {"cmin"}, 29l, 0l, 4, -4, 0, -1, 0, '\001', '\0', 'i', '\0', '\0'},
125-
{0l, {"xmax"}, 28l, 0l, 4, -5, 0, -1, 0, '\0', '\0', 'i', '\0', '\0'},
126-
{0l, {"cmax"}, 29l, 0l, 4, -6, 0, -1, 0, '\001', '\0', 'i', '\0', '\0'},
121+
{0l, {"ctid"}, 27l, 0l, 6, -1, 0, -1, -1, '\0', '\0', 'i', '\0', '\0'},
122+
{0l, {"oid"}, 26l, 0l, 4, -2, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'},
123+
{0l, {"xmin"}, 28l, 0l, 4, -3, 0, -1, -1, '\0', '\0', 'i', '\0', '\0'},
124+
{0l, {"cmin"}, 29l, 0l, 4, -4, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'},
125+
{0l, {"xmax"}, 28l, 0l, 4, -5, 0, -1, -1, '\0', '\0', 'i', '\0', '\0'},
126+
{0l, {"cmax"}, 29l, 0l, 4, -6, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'},
127127
};
128128

129129
/* ----------------------------------------------------------------
@@ -437,7 +437,7 @@ ConstructTupleDescriptor(Oid heapoid,
437437

438438
((AttributeTupleForm) to)->attnotnull = false;
439439
((AttributeTupleForm) to)->atthasdef = false;
440-
((AttributeTupleForm) to)->atttypmod = 0;
440+
((AttributeTupleForm) to)->atttypmod = -1;
441441

442442
/*
443443
* if the keytype is defined, we need to change the tuple form's

src/backend/commands/sequence.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ DefineSequence(CreateSeqStmt *seq)
9898
typnam = makeNode(TypeName);
9999
typnam->setof = FALSE;
100100
typnam->arrayBounds = NULL;
101-
typnam->typmod = 0;
101+
typnam->typmod = -1;
102102
coldef = makeNode(ColumnDef);
103103
coldef->typename = typnam;
104104
coldef->defval = NULL;

src/backend/executor/execUtils.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.26 1998/01/20 05:03:30 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.27 1998/02/07 06:11:21 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -531,6 +531,7 @@ ExecSetTypeInfo(int index,
531531
att->attproc = 0; /* dummy value */
532532
att->attnelems = 0; /* dummy value */
533533
att->attcacheoff = -1;
534+
att->atttypmod = -1;
534535
att->attisset = false;
535536
att->attalign = attalign;
536537
}

src/backend/parser/parse_expr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.17 1998/02/06 16:46:29 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.18 1998/02/07 06:11:30 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -101,7 +101,7 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
101101
Value *val = &con->val;
102102

103103
if (con->typename != NULL)
104-
result = parser_typecast(val, con->typename, 0);
104+
result = parser_typecast(val, con->typename, -1);
105105
else
106106
result = (Node *) make_const(val);
107107
break;

src/backend/utils/adt/varchar.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.25 1998/02/05 17:22:41 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.26 1998/02/07 06:11:38 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -60,7 +60,7 @@ bpcharin(char *s, int dummy, int atttypmod)
6060
if (s == NULL)
6161
return ((char *) NULL);
6262

63-
if (atttypmod < 1)
63+
if (atttypmod == -1)
6464
{
6565

6666
/*
@@ -133,7 +133,7 @@ varcharin(char *s, int dummy, int atttypmod)
133133
return ((char *) NULL);
134134

135135
len = strlen(s) + VARHDRSZ;
136-
if (atttypmod > 0 && len > atttypmod)
136+
if (atttypmod != -1 && len > atttypmod)
137137
len = atttypmod; /* clip the string at max length */
138138

139139
if (len > 4096)

src/bin/psql/psql.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.132 1998/02/06 17:46:31 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.133 1998/02/07 06:11:47 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -689,7 +689,7 @@ tableDesc(PsqlSettings *pset, char *table, FILE *fout)
689689
fprintf(fout,"%6s |", "var");
690690
else if (strcmp(rtype, "bpchar") == 0 ||
691691
strcmp(rtype, "varchar") == 0)
692-
fprintf(fout,"%6i |", atttypmod > 0 ? atttypmod - VARHDRSZ : 0);
692+
fprintf(fout,"%6i |", atttypmod != -1 ? atttypmod - VARHDRSZ : 0);
693693
else
694694
{
695695
if (attlen > 0)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy