Don't use SMP in copy.
This commit is contained in:
@ -2587,8 +2587,21 @@ static CopyState BeginCopy(bool is_from, Relation rel, Node* raw_query, const ch
|
||||
Assert(query->commandType == CMD_SELECT);
|
||||
Assert(query->utilityStmt == NULL);
|
||||
|
||||
/* plan the query */
|
||||
plan = planner(query, 0, NULL);
|
||||
bool old_smp_enabled = u_sess->opt_cxt.smp_enabled;
|
||||
u_sess->opt_cxt.smp_enabled = false;
|
||||
|
||||
PG_TRY();
|
||||
{
|
||||
/* plan the query */
|
||||
plan = planner(query, 0, NULL);
|
||||
}
|
||||
PG_CATCH();
|
||||
{
|
||||
u_sess->opt_cxt.smp_enabled = old_smp_enabled;
|
||||
PG_RE_THROW();
|
||||
}
|
||||
PG_END_TRY();
|
||||
u_sess->opt_cxt.smp_enabled = old_smp_enabled;
|
||||
|
||||
/*
|
||||
* Use a snapshot with an updated command ID to ensure this query sees
|
||||
|
@ -148,4 +148,8 @@ select * from test3 order by 1;
|
||||
2
|
||||
(2 rows)
|
||||
|
||||
set query_dop=1004;
|
||||
copy (select * from test3 order by 1 limit 1) to stdout header csv;
|
||||
c
|
||||
1
|
||||
drop table test3;
|
||||
|
@ -93,4 +93,7 @@ select 0\; copy test3 from stdin\; copy test3 from stdin\; select 1; -- 1
|
||||
2
|
||||
\.
|
||||
select * from test3 order by 1;
|
||||
|
||||
set query_dop=1004;
|
||||
copy (select * from test3 order by 1 limit 1) to stdout header csv;
|
||||
drop table test3;
|
||||
|
Reference in New Issue
Block a user