Merge pull request #3020 from citusdata/fix-pg12

Fix pg12
pull/3016/head
Hadi Moshayedi 2019-09-23 15:18:43 -07:00 committed by GitHub
commit e293230712
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 25 additions and 6 deletions

View File

@ -19,6 +19,9 @@
#include "miscadmin.h"
#include "funcapi.h"
#if PG_VERSION_NUM >= 120000
#include "access/genam.h"
#endif
#include "access/htup_details.h"
#include "access/xact.h"
#include "catalog/namespace.h"

View File

@ -1176,7 +1176,11 @@ BlessRecordExpression(Expr *expr)
ListCell *argCell = NULL;
int currentResno = 1;
#if PG_VERSION_NUM >= 120000
rowTupleDesc = CreateTemplateTupleDesc(list_length(rowExpr->args));
#else
rowTupleDesc = CreateTemplateTupleDesc(list_length(rowExpr->args), false);
#endif
foreach(argCell, rowExpr->args)
{

View File

@ -84,6 +84,7 @@ wait_until_metadata_sync(PG_FUNCTION_ARGS)
ListCell *workerCell = NULL;
bool waitNotifications = false;
MultiConnection *connection = NULL;
int waitFlags = 0;
foreach(workerCell, workerList)
{
@ -112,9 +113,14 @@ wait_until_metadata_sync(PG_FUNCTION_ARGS)
"localhost", PostPortNumber);
ExecuteCriticalRemoteCommand(connection, "LISTEN " METADATA_SYNC_CHANNEL);
waitResult = WaitLatchOrSocket(NULL, WL_SOCKET_READABLE | WL_TIMEOUT,
PQsocket(connection->pgConn), timeout, 0);
if (waitResult & WL_SOCKET_MASK)
waitFlags = WL_SOCKET_READABLE | WL_TIMEOUT | WL_POSTMASTER_DEATH;
waitResult = WaitLatchOrSocket(NULL, waitFlags, PQsocket(connection->pgConn),
timeout, 0);
if (waitResult & WL_POSTMASTER_DEATH)
{
ereport(ERROR, (errmsg("postmaster was shut down, exiting")));
}
else if (waitResult & WL_SOCKET_MASK)
{
ClearResults(connection, true);
}

View File

@ -705,7 +705,9 @@ SELECT
FROM
distributed_table, all_data
WHERE
distributed_table.key = all_data.key AND distributed_table.key = 1;
distributed_table.key = all_data.key AND distributed_table.key = 1
-- the following is to avoid CTE inlining
AND EXISTS (SELECT * FROM all_data);
count
-------
1

View File

@ -691,7 +691,9 @@ SELECT
FROM
distributed_table, all_data
WHERE
distributed_table.key = all_data.key AND distributed_table.key = 1;
distributed_table.key = all_data.key AND distributed_table.key = 1
-- the following is to avoid CTE inlining
AND EXISTS (SELECT * FROM all_data);
count
-------
1

View File

@ -425,7 +425,9 @@ SELECT
FROM
distributed_table, all_data
WHERE
distributed_table.key = all_data.key AND distributed_table.key = 1;
distributed_table.key = all_data.key AND distributed_table.key = 1
-- the following is to avoid CTE inlining
AND EXISTS (SELECT * FROM all_data);
-- get ready for the next commands