272
270
util::insensitive_hash hasher;
273
271
hash_value= hasher(path);
275
std::string tb_name(getTableName());
276
std::transform(tb_name.begin(), tb_name.end(), tb_name.begin(), ::tolower);
278
key.set(getKeySize(), getSchemaName(), tb_name);
273
key.set(getKeySize(), getSchemaName(), getTableName());
287
void TableIdentifier::getSQLPath(std::string &sql_path) const // @todo this is just used for errors, we should find a way to optimize it
290
case message::Table::FUNCTION:
291
case message::Table::STANDARD:
292
sql_path.append(getSchemaName());
293
sql_path.append(".");
294
sql_path.append(table_name);
296
case message::Table::INTERNAL:
297
sql_path.append("temporary.");
298
sql_path.append(table_name);
300
case message::Table::TEMPORARY:
301
sql_path.append(getSchemaName());
302
sql_path.append(".#");
303
sql_path.append(table_name);
308
bool TableIdentifier::isValid() const
310
if (not SchemaIdentifier::isValid())
316
if (table_name.empty())
322
if (table_name.size() > NAME_LEN)
328
if (table_name.at(table_name.length() -1) == ' ')
334
if (table_name.at(0) == '.')
341
const CHARSET_INFO * const cs= &my_charset_utf8mb4_general_ci;
343
int well_formed_error;
344
uint32_t res= cs->cset->well_formed_len(cs, table_name.c_str(), table_name.c_str() + table_name.length(),
345
NAME_CHAR_LEN, &well_formed_error);
346
if (well_formed_error or table_name.length() != res)
359
my_error(ER_WRONG_TABLE_NAME, MYF(0), name.c_str());
282
const std::string &TableIdentifier::getSQLPath() // @todo this is just used for errors, we should find a way to optimize it
284
if (sql_path.empty())
287
case message::Table::FUNCTION:
288
case message::Table::STANDARD:
289
sql_path.append(getSchemaName());
290
sql_path.append(".");
291
sql_path.append(table_name);
293
case message::Table::INTERNAL:
294
sql_path.append("temporary.");
295
sql_path.append(table_name);
297
case message::Table::TEMPORARY:
298
sql_path.append(getSchemaName());
299
sql_path.append(".#");
300
sql_path.append(table_name);