Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PS-5035 : rocksdb.show_table_status: 1051: Unknown table 'db_new' #2712

Merged
merged 1 commit into from
Nov 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sql/partitioning/partition_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ bool get_part_str_for_table(const char *name, std::string &result)
table_name, sizeof(table_name));

// Prepare the path to the .FRM file and open the file
// The 'name' is coming into this function already encoded in fscs.
char path[FN_REFLEN + 1]; //< Path to .FRM file
bool temp_table= (bool)is_prefix(table_name, tmp_file_prefix);
build_table_filename(path, sizeof(path) - 1, db_name, table_name, reg_ext,
temp_table ? FN_IS_TMP : 0);
FN_IS_ENCODED);

return get_part_str_for_path(path, result);
}
Expand Down
8 changes: 6 additions & 2 deletions sql/sql_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -573,12 +573,16 @@ size_t build_table_filename(char *buff, size_t bufflen, const char *db,
DBUG_PRINT("enter", ("db: '%s' table_name: '%s' ext: '%s' flags: %x",
db, table_name, ext, flags));

if (flags & FN_IS_TMP) // FN_FROM_IS_TMP | FN_TO_IS_TMP
if ((flags & FN_IS_TMP) || // FN_FROM_IS_TMP | FN_TO_IS_TMP
(flags & FN_IS_ENCODED))
tab_len= my_stpnmov(tbbuff, table_name, sizeof(tbbuff)) - tbbuff;
else
tab_len= tablename_to_filename(table_name, tbbuff, sizeof(tbbuff));

db_len= tablename_to_filename(db, dbbuff, sizeof(dbbuff));
if (flags & FN_IS_ENCODED)
db_len= my_stpnmov(dbbuff, db, sizeof(dbbuff)) - dbbuff;
else
db_len= tablename_to_filename(db, dbbuff, sizeof(dbbuff));

char *end = buff + bufflen;
/* Don't add FN_ROOTDIR if mysql_data_home already includes it */
Expand Down
2 changes: 2 additions & 0 deletions sql/sql_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ static const uint FRM_ONLY= 1 << 3;
static const uint NO_HA_TABLE= 1 << 4;
/** Don't check foreign key constraints while renaming table */
static const uint NO_FK_CHECKS= 1 << 5;
/** Percona : Database and table name are encoded in fscs already */
static const uint FN_IS_ENCODED= 1 << 6;

size_t filename_to_tablename(const char *from, char *to, size_t to_length
#ifndef DBUG_OFF
Expand Down