Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitedd3668

Browse files
committed
Atttypmod cleanup.
1 parentce88b9b commitedd3668

File tree

8 files changed

+33
-32
lines changed

8 files changed

+33
-32
lines changed

‎src/backend/commands/copy.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
*
88
* IDENTIFICATION
9-
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.41 1998/02/10 16:02:51 momjian Exp $
9+
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.42 1998/02/13 19:45:38 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -48,8 +48,7 @@ static OidGetOutputFunction(Oid type);
4848
staticOidGetTypeElement(Oidtype);
4949
staticOidGetInputFunction(Oidtype);
5050
staticOidIsTypeByVal(Oidtype);
51-
staticvoid
52-
GetIndexRelations(Oidmain_relation_oid,
51+
staticvoidGetIndexRelations(Oidmain_relation_oid,
5352
int*n_indices,
5453
Relation**index_rels);
5554

‎src/backend/parser/parse_node.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/parser/parse_node.c,v 1.12 1998/02/10 16:03:39 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.13 1998/02/13 19:45:43 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -79,7 +79,7 @@ make_operand(char *opname,
7979
Assert(nodeTag(result)==T_Const);
8080
val= (Datum)textout((structvarlena*)
8181
con->constvalue);
82-
infunc=typeidRetinfunc(true_typeId);
82+
infunc=typeidInfunc(true_typeId);
8383
con=makeNode(Const);
8484
con->consttype=true_typeId;
8585
con->constlen=typeLen(true_type);
@@ -185,10 +185,10 @@ make_op(char *opname, Node *ltree, Node *rtree)
185185
CONVERTABLE_TYPE(rtypeId)&&nodeTag(rtree)==T_Const&&
186186
!((Const*)rtree)->constiscast)
187187
{
188-
outfunc=typeidRetoutfunc(rtypeId);
189-
infunc=typeidRetinfunc(ltypeId);
188+
outfunc=typeidOutfunc(rtypeId);
189+
infunc=typeidInfunc(ltypeId);
190190
outstr= (char*)fmgr(outfunc, ((Const*)rtree)->constvalue);
191-
((Const*)rtree)->constvalue= (Datum)fmgr(infunc,outstr);
191+
((Const*)rtree)->constvalue= (Datum)fmgr(infunc,outstr,-1);
192192
pfree(outstr);
193193
((Const*)rtree)->consttype=rtypeId=ltypeId;
194194
newtype=typeidType(rtypeId);
@@ -200,10 +200,10 @@ make_op(char *opname, Node *ltree, Node *rtree)
200200
CONVERTABLE_TYPE(ltypeId)&&nodeTag(ltree)==T_Const&&
201201
!((Const*)ltree)->constiscast)
202202
{
203-
outfunc=typeidRetoutfunc(ltypeId);
204-
infunc=typeidRetinfunc(rtypeId);
203+
outfunc=typeidOutfunc(ltypeId);
204+
infunc=typeidInfunc(rtypeId);
205205
outstr= (char*)fmgr(outfunc, ((Const*)ltree)->constvalue);
206-
((Const*)ltree)->constvalue= (Datum)fmgr(infunc,outstr);
206+
((Const*)ltree)->constvalue= (Datum)fmgr(infunc,outstr,-1);
207207
pfree(outstr);
208208
((Const*)ltree)->consttype=ltypeId=rtypeId;
209209
newtype=typeidType(ltypeId);

‎src/backend/parser/parse_target.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_target.c,v 1.9 1998/02/10 16:03:41 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.10 1998/02/13 19:45:44 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -394,7 +394,7 @@ make_targetlist_expr(ParseState *pstate,
394394
lnext(expr)=
395395
makeConst(attrtype,
396396
attrlen,
397-
(Datum)fmgr(typeidRetinfunc(attrtype),
397+
(Datum)fmgr(typeidInfunc(attrtype),
398398
val,typeidTypElem(attrtype),-1),
399399
false,
400400
true/* Maybe correct-- 80% chance */ ,

‎src/backend/parser/parse_type.c

Lines changed: 5 additions & 5 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_type.c,v 1.5 1998/02/10 16:03:42 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_type.c,v 1.6 1998/02/13 19:45:45 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -148,7 +148,7 @@ stringTypeString(Type tp, char *string, int16 atttypmod)
148148

149149
/* Given a type id, returns the out-conversion function of the type */
150150
Oid
151-
typeidRetoutfunc(Oidtype_id)
151+
typeidOutfunc(Oidtype_id)
152152
{
153153
HeapTupletypeTuple;
154154
TypeTupleFormtype;
@@ -158,7 +158,7 @@ typeidRetoutfunc(Oid type_id)
158158
ObjectIdGetDatum(type_id),
159159
0,0,0);
160160
if (!HeapTupleIsValid(typeTuple))
161-
elog(ERROR,"typeidRetoutfunc: Invalid type - oid = %u",type_id);
161+
elog(ERROR,"typeidOutfunc: Invalid type - oid = %u",type_id);
162162

163163
type= (TypeTupleForm)GETSTRUCT(typeTuple);
164164
outfunc=type->typoutput;
@@ -241,7 +241,7 @@ GetArrayElementType(Oid typearray)
241241

242242
/* Given a type id, returns the in-conversion function of the type */
243243
Oid
244-
typeidRetinfunc(Oidtype_id)
244+
typeidInfunc(Oidtype_id)
245245
{
246246
HeapTupletypeTuple;
247247
TypeTupleFormtype;
@@ -251,7 +251,7 @@ typeidRetinfunc(Oid type_id)
251251
ObjectIdGetDatum(type_id),
252252
0,0,0);
253253
if (!HeapTupleIsValid(typeTuple))
254-
elog(ERROR,"typeidRetinfunc: Invalid type - oid = %u",type_id);
254+
elog(ERROR,"typeidInfunc: Invalid type - oid = %u",type_id);
255255

256256
type= (TypeTupleForm)GETSTRUCT(typeTuple);
257257
infunc=type->typinput;

‎src/backend/utils/adt/arrayfuncs.c

Lines changed: 8 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/utils/adt/arrayfuncs.c,v 1.24 1998/01/15 19:45:01 pgsql Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.25 1998/02/13 19:45:53 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -43,11 +43,10 @@
4343

4444
/*-=-=--=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-*/
4545
staticint_ArrayCount(char*str,intdim[],inttypdelim);
46-
staticchar*
47-
_ReadArrayStr(char*arrayStr,intnitems,intndim,intdim[],
46+
staticchar*_ReadArrayStr(char*arrayStr,intnitems,intndim,intdim[],
4847
FmgrInfo*inputproc,Oidtypelem,chartypdelim,
4948
inttyplen,booltypbyval,chartypalign,
50-
int*nbytes);
49+
int*nbytes,int16typmod);
5150

5251
#ifdefLOARRAY
5352
staticchar*
@@ -93,7 +92,8 @@ static char *array_seek(char *ptr, int eltsize, int nitems);
9392
*/
9493
char*
9594
array_in(char*string,/* input array in external form */
96-
Oidelement_type)/* type OID of an array element */
95+
Oidelement_type,/* type OID of an array element */
96+
int16typmod)
9797
{
9898
inttyplen;
9999
booltypbyval,
@@ -208,7 +208,7 @@ array_in(char *string,/* input array in external form */
208208
/* array not a large object */
209209
dataPtr=
210210
(char*)_ReadArrayStr(p,nitems,ndim,dim,&inputproc,typelem,
211-
typdelim,typlen,typbyval,typalign,
211+
typmod,typdelim,typlen,typbyval,typalign,
212212
&nbytes);
213213
nbytes+=ARR_OVERHEAD(ndim);
214214
retval= (ArrayType*)palloc(nbytes);
@@ -369,6 +369,7 @@ _ReadArrayStr(char *arrayStr,
369369
FmgrInfo*inputproc,/* function used for the
370370
* conversion */
371371
Oidtypelem,
372+
int16typmod,
372373
chartypdelim,
373374
inttyplen,
374375
booltypbyval,
@@ -460,7 +461,7 @@ _ReadArrayStr(char *arrayStr,
460461
*q='\0';
461462
if (i >=nitems)
462463
elog(ERROR,"array_in: illformed array constant");
463-
values[i]= (*fmgr_faddr(inputproc)) (p,typelem);
464+
values[i]= (*fmgr_faddr(inputproc)) (p,typelem,typmod);
464465
p=++q;
465466
if (!eoArray)
466467

‎src/include/catalog/pg_attribute.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: pg_attribute.h,v 1.27 1998/02/10 16:04:03 momjian Exp $
10+
* $Id: pg_attribute.h,v 1.28 1998/02/13 19:46:09 momjian Exp $
1111
*
1212
* NOTES
1313
* the genbki.sh script reads this file and generates .bki
@@ -88,7 +88,8 @@ CATALOG(pg_attribute) BOOTSTRAP
8888
int2atttypmod;
8989
/*
9090
* atttypmod records type-specific modifications supplied at table
91-
* creation time.
91+
* creation time, and passes it to input and output functions as the
92+
* third argument.
9293
*/
9394

9495
boolattbyval;

‎src/include/parser/parse_type.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: parse_type.h,v 1.4 1998/02/10 16:04:32 momjian Exp $
9+
* $Id: parse_type.h,v 1.5 1998/02/13 19:46:18 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -27,11 +27,11 @@ extern bool typeByVal(Type t);
2727
externchar*typeTypeName(Typet);
2828
externchartypeTypeFlag(Typet);
2929
externchar*stringTypeString(Typetp,char*string,int16atttypmod);
30-
externOidtypeidRetoutfunc(Oidtype_id);
30+
externOidtypeidOutfunc(Oidtype_id);
3131
externOidtypeidTypeRelid(Oidtype_id);
3232
externOidtypeTypeRelid(Typetyp);
3333
externOidtypeidTypElem(Oidtype_id);
3434
externOidGetArrayElementType(Oidtypearray);
35-
externOidtypeidRetinfunc(Oidtype_id);
35+
externOidtypeidInfunc(Oidtype_id);
3636

3737
#endif/* PARSE_TYPE_H */

‎src/include/utils/array.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* Copyright (c) 1994, Regents of the University of California
1212
*
13-
* $Id: array.h,v 1.9 1998/01/24 22:50:31 momjian Exp $
13+
* $Id: array.h,v 1.10 1998/02/13 19:46:22 momjian Exp $
1414
*
1515
* NOTES
1616
* XXX the data array should be LONGALIGN'd -- notice that the array
@@ -114,7 +114,7 @@ typedef struct
114114
/*
115115
* prototypes for functions defined in arrayfuncs.c
116116
*/
117-
externchar*array_in(char*string,Oidelement_type);
117+
externchar*array_in(char*string,Oidelement_type,int16typmod);
118118
externchar*array_out(ArrayType*v,Oidelement_type);
119119
externchar*array_dims(ArrayType*v,bool*isNull);
120120
externDatumarray_ref(ArrayType*array,intn,intindx[],intreftype,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp