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

Commit07908c9

Browse files
committed
Ensure that the Datum generated from a whole-row Var contains valid
type ID information even when it's a record type. This is needed tohandle whole-row Vars referencing subquery outputs. Per example fromRichard Huxton.
1 parent32fcfcd commit07908c9

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
*
1818
* IDENTIFICATION
19-
* $PostgreSQL: pgsql/src/backend/access/common/heaptuple.c,v 1.100 2005/10/15 02:49:08 momjian Exp $
19+
* $PostgreSQL: pgsql/src/backend/access/common/heaptuple.c,v 1.101 2005/10/19 18:18:32 tgl Exp $
2020
*
2121
*-------------------------------------------------------------------------
2222
*/
@@ -27,6 +27,7 @@
2727
#include"access/tuptoaster.h"
2828
#include"catalog/pg_type.h"
2929
#include"executor/tuptable.h"
30+
#include"utils/typcache.h"
3031

3132

3233
/* ----------------------------------------------------------------
@@ -603,11 +604,18 @@ heap_getsysattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
603604
*
604605
* We have to make a copy of the tuple so we can safely insert the
605606
* Datum overhead fields, which are not set in on-disk tuples.
607+
*
608+
* It's possible that the passed tupleDesc is a record type that
609+
* hasn't been "blessed" yet, so cover that case.
606610
*/
607611
caseInvalidAttrNumber:
608612
{
609613
HeapTupleHeaderdtup;
610614

615+
if (tupleDesc->tdtypeid==RECORDOID&&
616+
tupleDesc->tdtypmod<0)
617+
assign_record_type_typmod(tupleDesc);
618+
611619
dtup= (HeapTupleHeader)palloc(tup->t_len);
612620
memcpy((char*)dtup, (char*)tup->t_data,tup->t_len);
613621

‎src/backend/executor/execQual.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.181 2005/10/15 02:49:16 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.182 2005/10/19 18:18:33 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -3180,7 +3180,7 @@ ExecInitExpr(Expr *node, PlanState *parent)
31803180
{
31813181
/* generic record, use runtime type assignment */
31823182
rstate->tupdesc=ExecTypeFromExprList(rowexpr->args);
3183-
rstate->tupdesc=BlessTupleDesc(rstate->tupdesc);
3183+
BlessTupleDesc(rstate->tupdesc);
31843184
}
31853185
else
31863186
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp