00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #pragma once
00022
00023 #include <string>
00024 #include <vector>
00025 #include <drizzled/session.h>
00026
00027 namespace slave {
00028
00029 class SQLExecutor
00030 {
00031 public:
00032
00033 SQLExecutor(const std::string &user, const std::string &schema);
00034
00035 void markInErrorState()
00036 {
00037 _in_error_state= true;
00038 }
00039
00040 void clearErrorState()
00041 {
00042 _in_error_state= false;
00043 }
00044
00045 const std::string &getErrorMessage() const
00046 {
00047 return _error_message;
00048 }
00049
00058 bool executeSQL(std::vector<std::string> &sql);
00059
00060 protected:
00061 drizzled::Session::shared_ptr _session;
00062
00063 private:
00064 bool _in_error_state;
00065 std::string _error_message;
00066
00067 };
00068
00069 }
00070