00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <config.h>
00021 #include <drizzled/resource_context.h>
00022
00023 #include <cassert>
00024
00025 using namespace std;
00026
00027 namespace drizzled
00028 {
00029
00031 void ResourceContext::reset()
00032 {
00033 monitored= NULL;
00034 xa_resource_manager= NULL;
00035 trx_storage_engine= NULL;
00036 modified_data= false;
00037 }
00038
00039 void ResourceContext::markModifiedData()
00040 {
00041 assert(isStarted());
00042 modified_data= true;
00043 }
00044
00045 bool ResourceContext::hasModifiedData() const
00046 {
00047 assert(isStarted());
00048 return modified_data;
00049 }
00050
00051 bool ResourceContext::isStarted() const
00052 {
00053 return monitored != NULL;
00054 }
00055
00056 void ResourceContext::coalesceWith(const ResourceContext *stmt_ctx)
00057 {
00058
00059
00060
00061
00062
00063 assert(isStarted());
00064 if (stmt_ctx->hasModifiedData())
00065 markModifiedData();
00066 }
00067
00068 }