pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #14985: ExecCopySlotTuple not set "type id" and "type mod" when from minial tuple"
3+ messages / 3 participants
[nested] [flat]

* BUG #14985: ExecCopySlotTuple not set "type id" and "type mod" when from minial tuple"
@ 2017-12-20 10:05 PG Bug reporting form <noreply@postgresql.org>
  2017-12-20 15:33 ` Re: BUG #14985: ExecCopySlotTuple not set "type id" and "type mod" when from minial tuple" Andres Freund <andres@anarazel.de>
  2017-12-20 15:37 ` Re: BUG #14985: ExecCopySlotTuple not set "type id" and "type mod" when from minial tuple" Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 3+ messages in thread

From: PG Bug reporting form @ 2017-12-20 10:05 UTC (permalink / raw)
  To: pgsql-bugs; +Cc: bucoo@sohu.com

The following bug has been logged on the website:

Bug reference:      14985
Logged by:          bucoo hsiao
Email address:      bucoo@sohu.com
PostgreSQL version: 10.1
Operating system:   all
Description:        

HeapTuple
ExecCopySlotTuple(TupleTableSlot *slot)
{
	/*
	 * sanity checks
	 */
	Assert(slot != NULL);
	Assert(!slot->tts_isempty);

	/*
	 * If we have a physical tuple (either format) then just copy it.
	 */
	if (TTS_HAS_PHYSICAL_TUPLE(slot))
		return heap_copytuple(slot->tts_tuple);
	if (slot->tts_mintuple)
		return heap_tuple_from_minimal_tuple(slot->tts_mintuple);
/* should be:
        if (slot->tts_mintuple)
        {
                HeapTuple result =
heap_tuple_from_minimal_tuple(slot->tts_mintuple);
                HeapTupleHeaderSetTypeId(result->t_data,
slot->tts_tupleDescriptor->tdtypeid);
                HeapTupleHeaderSetTypMod(result->t_data,
slot->tts_tupleDescriptor->tdtypmod);
                return result;
        }
*/
	...
}



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #14985: ExecCopySlotTuple not set "type id" and "type mod" when from minial tuple"
  2017-12-20 10:05 BUG #14985: ExecCopySlotTuple not set "type id" and "type mod" when from minial tuple" PG Bug reporting form <noreply@postgresql.org>
@ 2017-12-20 15:33 ` Andres Freund <andres@anarazel.de>
  1 sibling, 0 replies; 3+ messages in thread

From: Andres Freund @ 2017-12-20 15:33 UTC (permalink / raw)
  To: bucoo@sohu.com; pgsql-bugs

Hi,

On 2017-12-20 10:05:40 +0000, PG Bug reporting form wrote:
> The following bug has been logged on the website:
> 
> Bug reference:      14985
> Logged by:          bucoo hsiao
> Email address:      bucoo@sohu.com
> PostgreSQL version: 10.1
> Operating system:   all
> Description:        

This also isn't a proper bug report. If you've API questions you
shouldn't open bug reports, instead ask on the general mailing list or
such.


> HeapTuple
> ExecCopySlotTuple(TupleTableSlot *slot)
> {
> 	/*
> 	 * sanity checks
> 	 */
> 	Assert(slot != NULL);
> 	Assert(!slot->tts_isempty);
> 
> 	/*
> 	 * If we have a physical tuple (either format) then just copy it.
> 	 */
> 	if (TTS_HAS_PHYSICAL_TUPLE(slot))
> 		return heap_copytuple(slot->tts_tuple);
> 	if (slot->tts_mintuple)
> 		return heap_tuple_from_minimal_tuple(slot->tts_mintuple);
> /* should be:
>         if (slot->tts_mintuple)
>         {
>                 HeapTuple result =
> heap_tuple_from_minimal_tuple(slot->tts_mintuple);
>                 HeapTupleHeaderSetTypeId(result->t_data,
> slot->tts_tupleDescriptor->tdtypeid);
>                 HeapTupleHeaderSetTypMod(result->t_data,
> slot->tts_tupleDescriptor->tdtypmod);
>                 return result;
>         }
> */
> 	...
> }
> 

No, it shouldn't. It seems you're looking for ExecFetchSlotTupleDatum().

Greetings,

Andres Freund




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #14985: ExecCopySlotTuple not set "type id" and "type mod" when from minial tuple"
  2017-12-20 10:05 BUG #14985: ExecCopySlotTuple not set "type id" and "type mod" when from minial tuple" PG Bug reporting form <noreply@postgresql.org>
@ 2017-12-20 15:37 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2017-12-20 15:37 UTC (permalink / raw)
  To: bucoo@sohu.com, pgsql-bugs@postgresql.org, PG Bug reporting form <noreply@postgresql.org>

=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> The following bug has been logged on the website:

The bug reporting form is not a good way to discuss proposed code changes,
especially when you haven't shown any reason to think there is a bug.
Please instead start a thread on pgsql-hackers explaining why this would
be a good change to make.  (Offhand I'd think it would be a waste of
code, because anything going through the minimal-tuple code path is
just about guaranteed to be an anonymous record type anyway.)

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2017-12-20 15:37 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-12-20 10:05 BUG #14985: ExecCopySlotTuple not set "type id" and "type mod" when from minial tuple" PG Bug reporting form <noreply@postgresql.org>
2017-12-20 15:33 ` Andres Freund <andres@anarazel.de>
2017-12-20 15:37 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox