diff options
-rw-r--r-- | project2/sql/sqlMergeTask.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/project2/sql/sqlMergeTask.cpp b/project2/sql/sqlMergeTask.cpp index d4e22c7..4356279 100644 --- a/project2/sql/sqlMergeTask.cpp +++ b/project2/sql/sqlMergeTask.cpp @@ -6,6 +6,7 @@ #include "exceptions.h" #include "sqlVariableBinder.h" #include "scriptLoader.h" +#include "scopeObject.h" #include <misc.h> #include <stdio.h> #include <stdexcept> @@ -161,6 +162,11 @@ class MergeWhere : public TablePatch::WhereProvider { void SqlMergeTask::execute(ExecContext * ec) const { + auto savepoint(stringf("sqlmerge_savepoint_%p", this)); + destdb->savepoint(savepoint); + ScopeObject SPHandler(NULL, + boost::bind(&DB::Connection::releaseSavepoint, destdb, savepoint), + boost::bind(&DB::Connection::rollbackToSavepoint, destdb, savepoint)); createTempTable(); if (earlyKeys(NULL)) { createTempKey(); |