23 #include <drizzled/errmsg_print.h>
24 #include <drizzled/gettext.h>
25 #include <drizzled/identifier.h>
26 #include <drizzled/session.h>
27 #include <drizzled/internal/my_sys.h>
29 #include <drizzled/util/tablename_to_filename.h>
30 #include <drizzled/util/backtrace.h>
31 #include <drizzled/charset.h>
37 #include <boost/algorithm/string/compare.hpp>
42 namespace identifier {
44 Catalog::Catalog(
str_ref name_arg) :
45 _name(name_arg.data(), name_arg.size())
52 assert(not _name.empty());
54 path += util::tablename_to_filename(_name);
55 assert(path.length());
56 hash_value= util::insensitive_hash()(path);
59 bool Catalog::compare(
const std::string &arg)
const
61 return boost::iequals(arg, _name);
64 bool Catalog::isValid()
const
67 || _name.size() > NAME_LEN
68 || _name.at(_name.length() -1 ) ==
' ')
70 const charset_info_st& cs= my_charset_utf8mb4_general_ci;
71 int well_formed_error;
72 uint32_t res= cs.cset->well_formed_len(cs, _name, NAME_CHAR_LEN, &well_formed_error);
73 if (well_formed_error)
75 my_error(ER_INVALID_CHARACTER_STRING, MYF(0),
"identifier", _name.c_str());
78 if (_name.length() != res)