Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5cf51f1

Browse files
committed
Merge remote-tracking branch 'origin/PGPROEE10' into PGPROEE10_pg_shardman
2 parents ddaf884 + 90ebfc0 commit 5cf51f1

File tree

12 files changed

+524
-182
lines changed

12 files changed

+524
-182
lines changed

contrib/in_memory/in_memory.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "postmaster/autovacuum.h"
2727
#include "replication/message.h"
2828
#include "storage/ipc.h"
29+
#include "storage/lmgr.h"
2930
#include "storage/lwlock.h"
3031
#include "storage/proc.h"
3132
#include "storage/shmem.h"
@@ -345,8 +346,7 @@ in_memory_utility_command(PlannedStmt *pstmt,
345346
}
346347
else if (IsA(pstmt->utilityStmt, AlterTableStmt))
347348
{
348-
AlterTableStmt *stmt = (AlterTableStmt*)pstmt->utilityStmt;
349-
RangeVar *rv;
349+
AlterTableStmt *stmt = (AlterTableStmt * )pstmt->utilityStmt;
350350
Relation rel;
351351
Oid myrelid;
352352
LOCKMODE mode;
@@ -365,20 +365,22 @@ in_memory_utility_command(PlannedStmt *pstmt,
365365
}
366366
if (mode != AccessExclusiveLock)
367367
goto done_alter_table;
368-
rv = stmt->relation;
369-
rel = heap_openrv(rv, AccessExclusiveLock);
370-
myrelid = RelationGetRelid(rel);
368+
myrelid = AlterTableLookupRelation(stmt, AccessExclusiveLock);
369+
370+
if (!OidIsValid(myrelid))
371+
goto done_alter_table;
371372

372373
if (!check_fdw_is_in_memory_relid(myrelid))
373374
{
374-
heap_close(rel, AccessExclusiveLock);
375+
UnlockRelationOid(myrelid, AccessExclusiveLock);
375376
goto done_alter_table;
376377
}
377378

379+
rel = heap_open(myrelid, NoLock);
378380
validate_fdw_alter_table_commands(myrelid, stmt->cmds, rel);
379381
call_next = true;
380382
heap_close(rel, AccessExclusiveLock);
381-
383+
382384
done_alter_table:
383385
(void)0;
384386
}

contrib/pgpro_scheduler/src/scheduler_manager.c

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/*
2+
* contrib/pgpro_scheduler/src/scheduler_manager.c
3+
*/
14
#include <stdlib.h>
25
#include "postgres.h"
36

@@ -946,8 +949,21 @@ int launch_executor_worker(scheduler_manager_ctx_t *ctx, scheduler_manager_slot_
946949
void init_executor_shared_data(schd_executor_share_t *data, scheduler_manager_ctx_t *ctx, job_t *job)
947950
{
948951
data->status = SchdExecutorInit;
949-
memcpy(data->database, ctx->database, strlen(ctx->database));
950-
memcpy(data->nodename, job->node, strlen(job->node));
952+
953+
if(strlen(ctx->database) < PGPRO_SCHEDULER_DBNAME_MAX)
954+
strcpy(data->database, ctx->database);
955+
else
956+
elog(ERROR, "String \"%s\"\n"
957+
"has %d symbols, while it should have less than %d symbols.",
958+
ctx->database, strlen(ctx->database), PGPRO_SCHEDULER_DBNAME_MAX);
959+
960+
if(strlen(job->node) < PGPRO_SCHEDULER_NODENAME_MAX)
961+
strcpy(data->nodename, job->node);
962+
else
963+
elog(ERROR, "String \"%s\"\n"
964+
"has %d symbols, while it should have less than %d symbols.",
965+
job->node, strlen(job->node), PGPRO_SCHEDULER_NODENAME_MAX);
966+
951967
data->new_job = true;
952968

953969
if(job)
@@ -1775,8 +1791,21 @@ int start_at_worker(scheduler_manager_ctx_t *ctx, int pos)
17751791
item->res_owner = CurrentResourceOwner;
17761792
shm_data = dsm_segment_address(item->shared);
17771793

1778-
memcpy(shm_data->database, ctx->database, strlen(ctx->database));
1779-
memcpy(shm_data->nodename, ctx->nodename, strlen(ctx->nodename));
1794+
1795+
if(strlen(ctx->database) < PGPRO_SCHEDULER_DBNAME_MAX)
1796+
strcpy(shm_data->database, ctx->database);
1797+
else
1798+
elog(ERROR, "String \"%s\"\n"
1799+
"has %d symbols, while it should have less than %d symbols.",
1800+
ctx->database, strlen(ctx->database), PGPRO_SCHEDULER_DBNAME_MAX);
1801+
1802+
if(strlen(ctx->nodename) < PGPRO_SCHEDULER_NODENAME_MAX)
1803+
strcpy(shm_data->nodename, ctx->nodename);
1804+
else
1805+
elog(ERROR, "String \"%s\"\n"
1806+
"has %d symbols, while it should have less than %d symbols.",
1807+
ctx->nodename, strlen(ctx->nodename), PGPRO_SCHEDULER_NODENAME_MAX);
1808+
17801809
shm_data->stop_worker = false;
17811810
shm_data->status = SchdExecutorInit;
17821811
shm_data->start_at = 0;

doc/src/sgml/config.sgml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7654,7 +7654,8 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
76547654
</term>
76557655
<listitem>
76567656
<para>
7657-
Defines the backend to use for range partitioning. Possible values are:
7657+
Defines the backend to use for partitioning with declarative syntax.
7658+
Possible values are:
76587659
<itemizedlist spacing="compact">
76597660
<listitem>
76607661
<para>

doc/src/sgml/filelist.sgml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@
197197
<!ENTITY sourcerepo SYSTEM "sourcerepo.sgml">
198198

199199
<!ENTITY release SYSTEM "release.sgml">
200+
<!ENTITY release-proee-10 SYSTEM "release-proee-10.sgml">
200201
<!ENTITY release-pro-10 SYSTEM "release-pro-10.sgml">
201202
<!ENTITY release-pro-9.6 SYSTEM "release-pro-9.6.sgml">
202203
<!ENTITY release-pro-9.5 SYSTEM "release-pro-9.5.sgml">

0 commit comments

Comments
 (0)