Skip to content

Commit cf55766

Browse files
committed
Show error when user tries to use wrong database
1 parent af8b8d1 commit cf55766

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

multimaster.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ char const* const MtmTxnStatusMnem[] =
218218
bool MtmDoReplication;
219219
char* MtmDatabaseName;
220220
char* MtmDatabaseUser;
221+
Oid MtmDatabaseId;
221222

222223
int MtmNodes;
223224
int MtmNodeId;
@@ -938,6 +939,12 @@ MtmPrePrepareTransaction(MtmCurrentTrans* x)
938939
bool found;
939940
MTM_TXTRACE(x, "PrePrepareTransaction Start");
940941

942+
if (!MtmDatabaseId)
943+
MtmDatabaseId = get_database_oid(MtmDatabaseName, false);
944+
945+
if (MtmDatabaseId != MyDatabaseId)
946+
MTM_ELOG(ERROR, "Refusing to work. Multimaster configured to work with database '%s'", MtmDatabaseName);
947+
941948
if (!x->isDistributed) {
942949
return;
943950
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy