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

Commit7d962ea

Browse files
committed
Remove unused code from tuplesort.
copytup_index() is unused, as tuplesort_putindextuplevalues() doesn'tuse COPYTUP(). Replace function body with an elog(ERROR), as alreadydone e.g. for copytup_datum().Author: Andres FreundDiscussion:https://postgr.es/m/20191013144153.ooxrfglvnaocsrx2@alap3.anarazel.de
1 parent4a25299 commit7d962ea

File tree

1 file changed

+2
-61
lines changed

1 file changed

+2
-61
lines changed

‎src/backend/utils/sort/tuplesort.c

Lines changed: 2 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -4141,67 +4141,8 @@ comparetup_index_hash(const SortTuple *a, const SortTuple *b,
41414141
staticvoid
41424142
copytup_index(Tuplesortstate*state,SortTuple*stup,void*tup)
41434143
{
4144-
IndexTupletuple= (IndexTuple)tup;
4145-
unsignedinttuplen=IndexTupleSize(tuple);
4146-
IndexTuplenewtuple;
4147-
Datumoriginal;
4148-
4149-
/* copy the tuple into sort storage */
4150-
newtuple= (IndexTuple)MemoryContextAlloc(state->tuplecontext,tuplen);
4151-
memcpy(newtuple,tuple,tuplen);
4152-
USEMEM(state,GetMemoryChunkSpace(newtuple));
4153-
stup->tuple= (void*)newtuple;
4154-
/* set up first-column key value */
4155-
original=index_getattr(newtuple,
4156-
1,
4157-
RelationGetDescr(state->indexRel),
4158-
&stup->isnull1);
4159-
4160-
if (!state->sortKeys->abbrev_converter||stup->isnull1)
4161-
{
4162-
/*
4163-
* Store ordinary Datum representation, or NULL value. If there is a
4164-
* converter it won't expect NULL values, and cost model is not
4165-
* required to account for NULL, so in that case we avoid calling
4166-
* converter and just set datum1 to zeroed representation (to be
4167-
* consistent, and to support cheap inequality tests for NULL
4168-
* abbreviated keys).
4169-
*/
4170-
stup->datum1=original;
4171-
}
4172-
elseif (!consider_abort_common(state))
4173-
{
4174-
/* Store abbreviated key representation */
4175-
stup->datum1=state->sortKeys->abbrev_converter(original,
4176-
state->sortKeys);
4177-
}
4178-
else
4179-
{
4180-
/* Abort abbreviation */
4181-
inti;
4182-
4183-
stup->datum1=original;
4184-
4185-
/*
4186-
* Set state to be consistent with never trying abbreviation.
4187-
*
4188-
* Alter datum1 representation in already-copied tuples, so as to
4189-
* ensure a consistent representation (current tuple was just
4190-
* handled). It does not matter if some dumped tuples are already
4191-
* sorted on tape, since serialized tuples lack abbreviated keys
4192-
* (TSS_BUILDRUNS state prevents control reaching here in any case).
4193-
*/
4194-
for (i=0;i<state->memtupcount;i++)
4195-
{
4196-
SortTuple*mtup=&state->memtuples[i];
4197-
4198-
tuple= (IndexTuple)mtup->tuple;
4199-
mtup->datum1=index_getattr(tuple,
4200-
1,
4201-
RelationGetDescr(state->indexRel),
4202-
&mtup->isnull1);
4203-
}
4204-
}
4144+
/* Not currently needed */
4145+
elog(ERROR,"copytup_index() should not be called");
42054146
}
42064147

42074148
staticvoid

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp