@@ -4141,67 +4141,8 @@ comparetup_index_hash(const SortTuple *a, const SortTuple *b,
41414141static void
41424142copytup_index (Tuplesortstate * state , SortTuple * stup , void * tup )
41434143{
4144- IndexTuple tuple = (IndexTuple ) tup ;
4145- unsigned int tuplen = IndexTupleSize (tuple );
4146- IndexTuple newtuple ;
4147- Datum original ;
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- else if (!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- int i ;
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
42074148static void
0 commit comments