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

Commit7f1bcfb

Browse files
committed
Sync pltcl_build_tuple_result's error handling with pltcl_trigger_handler.
Meant to do this in26abb50, but forgot.
1 parent26abb50 commit7f1bcfb

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

‎src/pl/tcl/pltcl.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3057,11 +3057,29 @@ pltcl_build_tuple_result(Tcl_Interp *interp, Tcl_Obj **kvObjv, int kvObjc,
30573057
char*fieldName=utf_e2u(Tcl_GetString(kvObjv[i]));
30583058
intattn=SPI_fnumber(call_state->ret_tupdesc,fieldName);
30593059

3060-
if (attn <=0||call_state->ret_tupdesc->attrs[attn-1]->attisdropped)
3060+
/*
3061+
* As in pltcl_trigger_handler, silently ignore ".tupno" if it's in
3062+
* the list but doesn't match any column name.
3063+
*/
3064+
if (attn==SPI_ERROR_NOATTRIBUTE)
3065+
{
3066+
if (strcmp(fieldName,".tupno")==0)
3067+
continue;
30613068
ereport(ERROR,
30623069
(errcode(ERRCODE_UNDEFINED_COLUMN),
30633070
errmsg("column name/value list contains nonexistent column name \"%s\"",
30643071
fieldName)));
3072+
}
3073+
3074+
if (attn <=0)
3075+
ereport(ERROR,
3076+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
3077+
errmsg("cannot set system attribute \"%s\"",
3078+
fieldName)));
3079+
3080+
/* Ignore dropped attributes */
3081+
if (call_state->ret_tupdesc->attrs[attn-1]->attisdropped)
3082+
continue;
30653083

30663084
values[attn-1]=utf_e2u(Tcl_GetString(kvObjv[i+1]));
30673085
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp