00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <config.h>
00022
00023 #include <drizzled/session.h>
00024 #include <plugin/utility_functions/functions.h>
00025
00026 namespace drizzled
00027 {
00028
00029 namespace utility_functions
00030 {
00031
00032 int64_t GlobalReadLock::val_int()
00033 {
00034 assert(fixed == 1);
00035 null_value= false;
00036
00037 if (getSession().isGlobalReadLock())
00038 return 1;
00039
00040 return 0;
00041 }
00042
00043 String *GlobalReadLock::val_str(String *str)
00044 {
00045 assert(fixed == 1);
00046 null_value= false;
00047 const std::string &global_state_for_session= display::type(getSession().isGlobalReadLock());
00048 str->copy(global_state_for_session.c_str(), global_state_for_session.length(), system_charset_info);
00049
00050 return str;
00051 }
00052
00053 void GlobalReadLock::fix_length_and_dec()
00054 {
00055 max_length= drizzled::display::max_string_length(getSession().isGlobalReadLock()) * system_charset_info->mbmaxlen;
00056 }
00057
00058 }
00059 }