File tree 3 files changed +10
-4
lines changed
3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ enum class ExceptionType {
47
47
OUT_OF_MEMORY = 9 ,
48
48
/* * Method not implemented. */
49
49
NOT_IMPLEMENTED = 11 ,
50
+ /* * Execution exception. */
51
+ EXECUTION = 12 ,
50
52
};
51
53
52
54
class Exception : public std ::runtime_error {
@@ -117,4 +119,10 @@ class NotImplementedException : public Exception {
117
119
explicit NotImplementedException (const std::string &msg) : Exception(ExceptionType::NOT_IMPLEMENTED, msg) {}
118
120
};
119
121
122
+ class ExecutionException : public Exception {
123
+ public:
124
+ ExecutionException () = delete ;
125
+ explicit ExecutionException (const std::string &msg) : Exception(ExceptionType::EXECUTION, msg) {}
126
+ };
127
+
120
128
} // namespace bustub
Original file line number Diff line number Diff line change @@ -106,7 +106,6 @@ class IndexWriteRecord {
106
106
enum class AbortReason {
107
107
LOCK_ON_SHRINKING,
108
108
UPGRADE_CONFLICT,
109
- DEADLOCK,
110
109
LOCK_SHARED_ON_READ_UNCOMMITTED,
111
110
TABLE_LOCK_NOT_PRESENT,
112
111
ATTEMPTED_INTENTION_LOCK_ON_ROW,
@@ -135,8 +134,6 @@ class TransactionAbortException : public std::exception {
135
134
case AbortReason::UPGRADE_CONFLICT:
136
135
return " Transaction " + std::to_string (txn_id_) +
137
136
" aborted because another transaction is already waiting to upgrade its lock\n " ;
138
- case AbortReason::DEADLOCK:
139
- return " Transaction " + std::to_string (txn_id_) + " aborted on deadlock\n " ;
140
137
case AbortReason::LOCK_SHARED_ON_READ_UNCOMMITTED:
141
138
return " Transaction " + std::to_string (txn_id_) + " aborted on lockshared on READ_UNCOMMITTED\n " ;
142
139
case AbortReason::TABLE_LOCK_NOT_PRESENT:
Original file line number Diff line number Diff line change 16
16
17
17
#include " buffer/buffer_pool_manager.h"
18
18
#include " catalog/catalog.h"
19
+ #include " concurrency/transaction.h"
19
20
#include " concurrency/transaction_manager.h"
20
21
#include " execution/executor_context.h"
21
22
#include " execution/executor_factory.h"
@@ -62,7 +63,7 @@ class ExecutionEngine {
62
63
try {
63
64
executor->Init ();
64
65
PollExecutor (executor.get (), plan, result_set);
65
- } catch (const Exception &ex) {
66
+ } catch (const ExecutionException &ex) {
66
67
#ifndef NDEBUG
67
68
LOG_ERROR (" Error Encountered in Executor Execution: %s" , ex.what ());
68
69
#endif
You can’t perform that action at this time.
0 commit comments