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

Commit03155dc

Browse files
committed
It seems that SPI_prepare() doesn't work well in some cases.
Pawel Pierscionek [pawel@astercity.net] reported about thefollowing case 1([SQL] drop table in pgsql).Michael Contzen [mcontzen@dohle.com] reported about thefollowing case 2(PL/PGSQL bug using aggregates).You can find it from pgsql-hackers archive.1. PL/pgSQL can't execute UTILITY commands. SPI_prepare() doesn't copy(save) the utilityStmt member of Query type nodes,because copyObject() is not implemented for nodes of (Create/Destroy etc)Stmt type.2. Aggregates in PL/pgSQL cause wrong results.... It's a list including Aggreg type nodes which exist in TargetList(i.e Aggreg type nodes are common to aggs member list and TargetList). AFAIC the common pointer is not copied to the same pointer by copyObject() function. In my patch I reconstruct aggs member node from new(copied) Agg type node. Is it proper to use set_agg_tlist_references() function to reconstruct aggs member node for Agg type nodes ?Thanks.Hiroshi InoueInoue@tpf.co.jp
1 parent289a826 commit03155dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/backend/nodes/copyfuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.52 1999/01/2116:38:36 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.53 1999/01/2122:55:41 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -506,7 +506,7 @@ _copyAgg(Agg *from)
506506

507507
CopyPlanFields((Plan*)from, (Plan*)newnode);
508508

509-
Node_Copy(from,newnode,aggs);
509+
newnode->aggs=set_agg_tlist_references(newnode);
510510
Node_Copy(from,newnode,aggstate);
511511

512512
returnnewnode;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp