219
219
static uint32_t filename_to_tablename(const char *from, char *to, uint32_t to_length);
220
static size_t build_table_filename(std::string &buff, const char *db, const char *table_name, bool is_tmp);
220
static size_t build_table_filename(std::string &path, const std::string &db, const std::string &table_name, bool is_tmp);
221
221
static size_t build_tmptable_filename(std::string &buffer);
222
222
static size_t build_tmptable_filename(std::vector<char> &buffer);
225
Create a table cache key
229
key Create key here (must be of size MAX_DBKEY_LENGTH)
230
table_list Table definition
233
The table cache_key is created from:
237
if the table is a tmp table, we add the following to make each tmp table
240
4 bytes for master thread id
241
4 bytes pseudo thread id
246
static uint32_t createKey(char *key, const char *db_arg, const char *table_name_arg)
251
key_pos= strcpy(key_pos, db_arg) + strlen(db_arg);
252
key_pos= strcpy(key_pos+1, table_name_arg) +
253
strlen(table_name_arg);
254
key_length= (uint32_t)(key_pos-key)+1;
259
static uint32_t createKey(char *key, const TableIdentifier &identifier)
264
key_pos= strcpy(key_pos, identifier.getSchemaName().c_str()) + identifier.getSchemaName().length();
265
key_pos= strcpy(key_pos + 1, identifier.getTableName().c_str()) + identifier.getTableName().length();
266
key_length= (uint32_t)(key_pos-key)+1;
271
226
size_t getHashValue() const