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

Commit56b01dc

Browse files
committed
Make SPI set SPI_processed for CREATE TABLE AS / SELECT INTO commands;
this in turn causes CREATE TABLE AS in plpgsql to set ROW_COUNT.This is how it behaved before 7.4; I had unintentionally changed thebehavior in a bit of sloppy micro-optimization.
1 parentdce83e7 commit56b01dc

File tree

1 file changed

+6
-4
lines changed
  • src/backend/executor

1 file changed

+6
-4
lines changed

‎src/backend/executor/spi.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.140 2005/05/06 17:24:54 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.141 2005/06/09 21:25:22 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1497,17 +1497,18 @@ static int
14971497
_SPI_pquery(QueryDesc*queryDesc,longtcount)
14981498
{
14991499
intoperation=queryDesc->operation;
1500+
CommandDestorigDest=queryDesc->dest->mydest;
15001501
intres;
15011502
Oidsave_lastoid;
15021503

15031504
switch (operation)
15041505
{
15051506
caseCMD_SELECT:
15061507
res=SPI_OK_SELECT;
1507-
if (queryDesc->parsetree->into!=NULL)/* select into table */
1508+
if (queryDesc->parsetree->into)/* select into table? */
15081509
{
15091510
res=SPI_OK_SELINTO;
1510-
queryDesc->dest=None_Receiver;/* don't output results */
1511+
queryDesc->dest=None_Receiver;/* don't output results */
15111512
}
15121513
break;
15131514
caseCMD_INSERT:
@@ -1548,7 +1549,8 @@ _SPI_pquery(QueryDesc *queryDesc, long tcount)
15481549

15491550
ExecutorEnd(queryDesc);
15501551

1551-
if (queryDesc->dest->mydest==SPI)
1552+
/* Test origDest here so that SPI_processed gets set in SELINTO case */
1553+
if (origDest==SPI)
15521554
{
15531555
SPI_processed=_SPI_current->processed;
15541556
SPI_lastoid=save_lastoid;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp