|
31 | 31 | * ENHANCEMENTS, OR MODIFICATIONS. |
32 | 32 | * |
33 | 33 | * IDENTIFICATION |
34 | | - * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.76 2003/08/08 21:42:59 momjian Exp $ |
| 34 | + * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.77 2003/09/04 15:10:10 tgl Exp $ |
35 | 35 | * |
36 | 36 | **********************************************************************/ |
37 | 37 |
|
@@ -694,6 +694,7 @@ pltcl_trigger_handler(PG_FUNCTION_ARGS) |
694 | 694 | pfree(stroid); |
695 | 695 |
|
696 | 696 | /* A list of attribute names for argument TG_relatts */ |
| 697 | +/* note: we deliberately include dropped atts here */ |
697 | 698 | Tcl_DStringAppendElement(&tcl_trigtup,""); |
698 | 699 | for (i=0;i<tupdesc->natts;i++) |
699 | 700 | Tcl_DStringAppendElement(&tcl_trigtup, |
@@ -863,9 +864,8 @@ pltcl_trigger_handler(PG_FUNCTION_ARGS) |
863 | 864 | modvalues[i]= (Datum)NULL; |
864 | 865 | } |
865 | 866 |
|
866 | | -modnulls=palloc(tupdesc->natts+1); |
| 867 | +modnulls=palloc(tupdesc->natts); |
867 | 868 | memset(modnulls,'n',tupdesc->natts); |
868 | | -modnulls[tupdesc->natts]='\0'; |
869 | 869 |
|
870 | 870 | /************************************************************ |
871 | 871 | * Care for possible elog(ERROR)'s below |
@@ -2312,6 +2312,10 @@ pltcl_set_tuple_values(Tcl_Interp *interp, CONST84 char *arrayname, |
2312 | 2312 |
|
2313 | 2313 | for (i=0;i<tupdesc->natts;i++) |
2314 | 2314 | { |
| 2315 | +/* ignore dropped attributes */ |
| 2316 | +if (tupdesc->attrs[i]->attisdropped) |
| 2317 | +continue; |
| 2318 | + |
2315 | 2319 | /************************************************************ |
2316 | 2320 | * Get the attribute name |
2317 | 2321 | ************************************************************/ |
@@ -2382,6 +2386,10 @@ pltcl_build_tuple_argument(HeapTuple tuple, TupleDesc tupdesc, |
2382 | 2386 |
|
2383 | 2387 | for (i=0;i<tupdesc->natts;i++) |
2384 | 2388 | { |
| 2389 | +/* ignore dropped attributes */ |
| 2390 | +if (tupdesc->attrs[i]->attisdropped) |
| 2391 | +continue; |
| 2392 | + |
2385 | 2393 | /************************************************************ |
2386 | 2394 | * Get the attribute name |
2387 | 2395 | ************************************************************/ |
|