Content-Length: 286794 | pFad | http://github.com/postgrespro/postgres_cluster/commit/55b2178d768b7c2046e33bda7613c1f02a5bcd04

F3 fix SPI CTA · postgrespro/postgres_cluster@55b2178 · GitHub
Skip to content

Commit 55b2178

Browse files
committed
fix SPI CTA
1 parent 8a0d3ed commit 55b2178

File tree

1 file changed

+9
-3
lines changed
  • src/backend/executor

1 file changed

+9
-3
lines changed

src/backend/executor/spi.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2217,15 +2217,21 @@ _SPI_execute_plan(SPIPlanPtr plan, ParamListInfo paramLI,
22172217
*/
22182218
if (IsA(stmt, CreateTableAsStmt))
22192219
{
2220-
Assert(strncmp(completionTag, "SELECT ", 7) == 0);
2221-
_SPI_current->processed = pg_strtouint64(completionTag + 7,
2220+
CreateTableAsStmt *ctastmt = (CreateTableAsStmt *) stmt;
2221+
2222+
if (strncmp(completionTag, "SELECT ", 7) == 0)
2223+
_SPI_current->processed = pg_strtouint64(completionTag + 7,
22222224
NULL, 10);
2225+
else if (*completionTag == '\0' && ctastmt->if_not_exists)
2226+
_SPI_current->processed = 0;
2227+
else
2228+
Assert(false);
22232229

22242230
/*
22252231
* For historical reasons, if CREATE TABLE AS was spelled
22262232
* as SELECT INTO, return a special return code.
22272233
*/
2228-
if (((CreateTableAsStmt *) stmt)->is_select_into)
2234+
if (ctastmt->is_select_into)
22292235
res = SPI_OK_SELINTO;
22302236
}
22312237
else if (IsA(stmt, CopyStmt))

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/55b2178d768b7c2046e33bda7613c1f02a5bcd04

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy