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

Commit542c83f

Browse files
author
Vladimir Ershov
committed
switch from error context
1 parent695a5d0 commit542c83f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎src/scheduler_spi_utils.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ spi_response_t *execute_spi_sql_with_args(MemoryContext ctx, const char *sql, in
498498
ResourceOwneroldowner=CurrentResourceOwner;
499499
spi_response_t*rv=NULL;
500500
MemoryContextold=CurrentMemoryContext;
501+
MemoryContextpe;
501502

502503
if(!ctx)ctx=SchedulerWorkerContext;
503504

@@ -523,7 +524,9 @@ spi_response_t *execute_spi_sql_with_args(MemoryContext ctx, const char *sql, in
523524
}
524525
PG_CATCH();
525526
{
527+
pe=MemoryContextSwitchTo(ctx);
526528
edata=CopyErrorData();
529+
MemoryContextSwitchTo(pe);
527530
if(edata->message)
528531
{
529532
rv=__error_spi_resp(ctx,ret,edata->message);
@@ -600,6 +603,7 @@ spi_response_t *execute_spi_params_prepared(MemoryContext ctx, const char *sql,
600603
ResourceOwneroldowner=CurrentResourceOwner;
601604
spi_response_t*rv;
602605
MemoryContextold=CurrentMemoryContext;
606+
MemoryContextpe;
603607

604608
if(!ctx)ctx=SchedulerWorkerContext;
605609

@@ -637,7 +641,9 @@ spi_response_t *execute_spi_params_prepared(MemoryContext ctx, const char *sql,
637641
}
638642
PG_CATCH();
639643
{
644+
pe=MemoryContextSwitchTo(ctx);
640645
edata=CopyErrorData();
646+
MemoryContextSwitchTo(pe);
641647
if(edata->message)
642648
{
643649
rv=__error_spi_resp(ctx,ret,edata->message);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp