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

Commit c3ea6c7

Browse files
committed
allow to work in non-mm databases
1 parent db3c40c commit c3ea6c7

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/commit.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,6 @@ MtmBeginTransaction()
8484

8585
MtmDDLResetStatement();
8686

87-
if (!MtmDatabaseId)
88-
MtmDatabaseId = get_database_oid(MtmDatabaseName, false);
89-
90-
// XXX: maybe allow commit, but don't use mm?
91-
if (MtmDatabaseId != MyDatabaseId)
92-
mtm_log(ERROR,
93-
"Refusing to work. Multimaster configured to work with database '%s'",
94-
MtmDatabaseName);
95-
9687
/* XXX: ugly hack with debug_query_string */
9788

9889
/* Application name can be changed using PGAPPNAME environment variable */
@@ -110,7 +101,7 @@ MtmBeginTransaction()
110101
}
111102
}
112103

113-
bool // XXX: do we need that bool?
104+
bool
114105
MtmTwoPhaseCommit()
115106
{
116107
nodemask_t participantsMask;
@@ -120,6 +111,15 @@ MtmTwoPhaseCommit()
120111
char stream[DMQ_NAME_MAXLEN];
121112
pgid_t gid;
122113

114+
if (!MtmDatabaseId)
115+
MtmDatabaseId = get_database_oid(MtmDatabaseName, false);
116+
117+
if (MtmDatabaseId != MyDatabaseId)
118+
return false;
119+
// mtm_log(ERROR,
120+
// "Refusing to work. Multimaster configured to work with database '%s'",
121+
// MtmDatabaseName);
122+
123123
if ( (!MtmTx.contains_ddl && !MtmTx.contains_dml) || !Mtm->extension_created)
124124
return false;
125125

0 commit comments

Comments
 (0)