diff options
Diffstat (limited to 'src/mongo/db/commands/do_txn_cmd.cpp')
-rw-r--r-- | src/mongo/db/commands/do_txn_cmd.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mongo/db/commands/do_txn_cmd.cpp b/src/mongo/db/commands/do_txn_cmd.cpp index 9d87249fa6e..033669f7132 100644 --- a/src/mongo/db/commands/do_txn_cmd.cpp +++ b/src/mongo/db/commands/do_txn_cmd.cpp @@ -42,6 +42,7 @@ #include "mongo/db/client.h" #include "mongo/db/commands.h" #include "mongo/db/commands/oplog_application_checks.h" +#include "mongo/db/commands/test_commands_enabled.h" #include "mongo/db/concurrency/write_conflict_exception.h" #include "mongo/db/db_raii.h" #include "mongo/db/dbdirectclient.h" @@ -163,8 +164,14 @@ public: return doTxnStatus; } +}; -} doTxnCmd; +MONGO_INITIALIZER(RegisterDoTxnCommand)(InitializerContext* ctx) { + if (getTestCommandsEnabled()) { + new DoTxnCmd(); + } + return Status::OK(); +} } // namespace } // namespace mongo |