Commit b0269816 authored by Sergei Petrunia's avatar Sergei Petrunia

MyRocks: post-merge fixes for Windows: take into account FN_LIBCHAR2

Table name may be passed either as "./db/table" or as ".\\db\\table".
parent 4d51009a
...@@ -7141,12 +7141,17 @@ int rdb_normalize_tablename(const std::string &tablename, ...@@ -7141,12 +7141,17 @@ int rdb_normalize_tablename(const std::string &tablename,
std::string *const strbuf) { std::string *const strbuf) {
DBUG_ASSERT(strbuf != nullptr); DBUG_ASSERT(strbuf != nullptr);
if (tablename.size() < 2 || tablename[0] != '.' || tablename[1] != FN_LIBCHAR) { if (tablename.size() < 2 || tablename[0] != '.' ||
(tablename[1] != FN_LIBCHAR && tablename[1] != FN_LIBCHAR2)) {
DBUG_ASSERT(0); // We were not passed table name? DBUG_ASSERT(0); // We were not passed table name?
return HA_ERR_ROCKSDB_INVALID_TABLE; return HA_ERR_ROCKSDB_INVALID_TABLE;
} }
size_t pos = tablename.find_first_of(FN_LIBCHAR, 2); size_t pos = tablename.find_first_of(FN_LIBCHAR, 2);
if (pos == std::string::npos) {
pos = tablename.find_first_of(FN_LIBCHAR2, 2);
}
if (pos == std::string::npos) { if (pos == std::string::npos) {
DBUG_ASSERT(0); // We were not passed table name? DBUG_ASSERT(0); // We were not passed table name?
return HA_ERR_ROCKSDB_INVALID_TABLE; return HA_ERR_ROCKSDB_INVALID_TABLE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment