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

Commit7261172

Browse files
committed
Remove obsolete heap_formtuple/modifytuple/deformtuple functions.
These variants used the old-style 'n'/' ' NULL indicators. The new-stylefunctions have been available since version 8.1. That should be long enoughthat if there is still any old external code using these functions, theycan just switch to the new functions without worrying about backwardscompatibilityPeter Geoghegan
1 parenta3fd7af commit7261172

File tree

2 files changed

+0
-122
lines changed

2 files changed

+0
-122
lines changed

‎src/backend/access/common/heaptuple.c

Lines changed: 0 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -776,39 +776,6 @@ heap_form_tuple(TupleDesc tupleDescriptor,
776776
returntuple;
777777
}
778778

779-
/*
780-
*heap_formtuple
781-
*
782-
*construct a tuple from the given values[] and nulls[] arrays
783-
*
784-
*Null attributes are indicated by a 'n' in the appropriate byte
785-
*of nulls[]. Non-null attributes are indicated by a ' ' (space).
786-
*
787-
* OLD API with char 'n'/' ' convention for indicating nulls.
788-
* This is deprecated and should not be used in new code, but we keep it
789-
* around for use by old add-on modules.
790-
*/
791-
HeapTuple
792-
heap_formtuple(TupleDesctupleDescriptor,
793-
Datum*values,
794-
char*nulls)
795-
{
796-
HeapTupletuple;/* return tuple */
797-
intnumberOfAttributes=tupleDescriptor->natts;
798-
bool*boolNulls= (bool*)palloc(numberOfAttributes*sizeof(bool));
799-
inti;
800-
801-
for (i=0;i<numberOfAttributes;i++)
802-
boolNulls[i]= (nulls[i]=='n');
803-
804-
tuple=heap_form_tuple(tupleDescriptor,values,boolNulls);
805-
806-
pfree(boolNulls);
807-
808-
returntuple;
809-
}
810-
811-
812779
/*
813780
* heap_modify_tuple
814781
*form a new tuple from an old tuple and a set of replacement values.
@@ -879,44 +846,6 @@ heap_modify_tuple(HeapTuple tuple,
879846
returnnewTuple;
880847
}
881848

882-
/*
883-
*heap_modifytuple
884-
*
885-
*forms a new tuple from an old tuple and a set of replacement values.
886-
*returns a new palloc'ed tuple.
887-
*
888-
* OLD API with char 'n'/' ' convention for indicating nulls, and
889-
* char 'r'/' ' convention for indicating whether to replace columns.
890-
* This is deprecated and should not be used in new code, but we keep it
891-
* around for use by old add-on modules.
892-
*/
893-
HeapTuple
894-
heap_modifytuple(HeapTupletuple,
895-
TupleDesctupleDesc,
896-
Datum*replValues,
897-
char*replNulls,
898-
char*replActions)
899-
{
900-
HeapTupleresult;
901-
intnumberOfAttributes=tupleDesc->natts;
902-
bool*boolNulls= (bool*)palloc(numberOfAttributes*sizeof(bool));
903-
bool*boolActions= (bool*)palloc(numberOfAttributes*sizeof(bool));
904-
intattnum;
905-
906-
for (attnum=0;attnum<numberOfAttributes;attnum++)
907-
{
908-
boolNulls[attnum]= (replNulls[attnum]=='n');
909-
boolActions[attnum]= (replActions[attnum]=='r');
910-
}
911-
912-
result=heap_modify_tuple(tuple,tupleDesc,replValues,boolNulls,boolActions);
913-
914-
pfree(boolNulls);
915-
pfree(boolActions);
916-
917-
returnresult;
918-
}
919-
920849
/*
921850
* heap_deform_tuple
922851
*Given a tuple, extract data into values/isnull arrays; this is
@@ -1024,46 +953,6 @@ heap_deform_tuple(HeapTuple tuple, TupleDesc tupleDesc,
1024953
}
1025954
}
1026955

1027-
/*
1028-
*heap_deformtuple
1029-
*
1030-
*Given a tuple, extract data into values/nulls arrays; this is
1031-
*the inverse of heap_formtuple.
1032-
*
1033-
*Storage for the values/nulls arrays is provided by the caller;
1034-
*it should be sized according to tupleDesc->natts not
1035-
*HeapTupleHeaderGetNatts(tuple->t_data).
1036-
*
1037-
*Note that for pass-by-reference datatypes, the pointer placed
1038-
*in the Datum will point into the given tuple.
1039-
*
1040-
*When all or most of a tuple's fields need to be extracted,
1041-
*this routine will be significantly quicker than a loop around
1042-
*heap_getattr; the loop will become O(N^2) as soon as any
1043-
*noncacheable attribute offsets are involved.
1044-
*
1045-
* OLD API with char 'n'/' ' convention for indicating nulls.
1046-
* This is deprecated and should not be used in new code, but we keep it
1047-
* around for use by old add-on modules.
1048-
*/
1049-
void
1050-
heap_deformtuple(HeapTupletuple,
1051-
TupleDesctupleDesc,
1052-
Datum*values,
1053-
char*nulls)
1054-
{
1055-
intnatts=tupleDesc->natts;
1056-
bool*boolNulls= (bool*)palloc(natts*sizeof(bool));
1057-
intattnum;
1058-
1059-
heap_deform_tuple(tuple,tupleDesc,values,boolNulls);
1060-
1061-
for (attnum=0;attnum<natts;attnum++)
1062-
nulls[attnum]= (boolNulls[attnum] ?'n' :' ');
1063-
1064-
pfree(boolNulls);
1065-
}
1066-
1067956
/*
1068957
* slot_deform_tuple
1069958
*Given a TupleTableSlot, extract data from the slot's physical tuple

‎src/include/access/htup_details.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -782,17 +782,6 @@ extern HeapTuple heap_modify_tuple(HeapTuple tuple,
782782
bool*doReplace);
783783
externvoidheap_deform_tuple(HeapTupletuple,TupleDesctupleDesc,
784784
Datum*values,bool*isnull);
785-
786-
/* these three are deprecated versions of the three above: */
787-
externHeapTupleheap_formtuple(TupleDesctupleDescriptor,
788-
Datum*values,char*nulls);
789-
externHeapTupleheap_modifytuple(HeapTupletuple,
790-
TupleDesctupleDesc,
791-
Datum*replValues,
792-
char*replNulls,
793-
char*replActions);
794-
externvoidheap_deformtuple(HeapTupletuple,TupleDesctupleDesc,
795-
Datum*values,char*nulls);
796785
externvoidheap_freetuple(HeapTuplehtup);
797786
externMinimalTupleheap_form_minimal_tuple(TupleDesctupleDescriptor,
798787
Datum*values,bool*isnull);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp