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

Commita039148

Browse files
committed
tlist_matches_tupdesc() needs to defend itself against dropped columns.
1 parentc63a545 commita039148

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/backend/executor/execScan.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
*
1414
* IDENTIFICATION
15-
* $Header: /cvsroot/pgsql/src/backend/executor/execScan.c,v 1.27 2003/08/08 21:41:40 momjian Exp $
15+
* $Header: /cvsroot/pgsql/src/backend/executor/execScan.c,v 1.28 2003/09/25 19:41:49 tgl Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -196,9 +196,7 @@ tlist_matches_tupdesc(List *tlist, Index varno, TupleDesc tupdesc)
196196

197197
for (attrno=1;attrno <=numattrs;attrno++)
198198
{
199-
#ifdefUSE_ASSERT_CHECKING/* only used in Assert() */
200199
Form_pg_attributeatt_tup=tupdesc->attrs[attrno-1];
201-
#endif
202200
Var*var;
203201

204202
if (tlist==NIL)
@@ -207,11 +205,13 @@ tlist_matches_tupdesc(List *tlist, Index varno, TupleDesc tupdesc)
207205
if (!var|| !IsA(var,Var))
208206
return false;/* tlist item not a Var */
209207
Assert(var->varno==varno);
208+
Assert(var->varlevelsup==0);
210209
if (var->varattno!=attrno)
211210
return false;/* out of order */
211+
if (att_tup->attisdropped)
212+
return false;/* table contains dropped columns */
212213
Assert(var->vartype==att_tup->atttypid);
213214
Assert(var->vartypmod==att_tup->atttypmod);
214-
Assert(var->varlevelsup==0);
215215

216216
tlist=lnext(tlist);
217217
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp