summaryrefslogtreecommitdiff
path: root/sql/discover.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-06-15 19:09:31 +0200
committerSergei Golubchik <sergii@pisem.net>2013-06-15 19:09:31 +0200
commit68a6705ed1dc7a0ff5c86910e23989f97788e741 (patch)
tree9c9c157920481f06dc13344e86be5c92c68dc473 /sql/discover.cc
parent6a0a4f00a1741df68c0d201e090f5d28f59410c8 (diff)
downloadmariadb-git-68a6705ed1dc7a0ff5c86910e23989f97788e741.tar.gz
MDEV-4441 DROP DATABASE with a newly created ARCHIVE table does not work
1. DROP DATABASE should use ha_discover_table_names(), not look at .frm files. 2. filename_to_tablename() also encodes temp file names #sql- -> #mysql50##sql 3. no special treatment for #sql- files, no TABLE_LIST::internal_tmp_table 4. discover also table file names, that start from #
Diffstat (limited to 'sql/discover.cc')
-rw-r--r--sql/discover.cc13
1 files changed, 3 insertions, 10 deletions
diff --git a/sql/discover.cc b/sql/discover.cc
index 4224e8ce0b0..cc0dece031a 100644
--- a/sql/discover.cc
+++ b/sql/discover.cc
@@ -198,10 +198,10 @@ int extension_based_table_discovery(MY_DIR *dirp, const char *ext_meta,
end= cur + dirp->number_of_files;
while (cur < end)
{
- char *octothorp= strrchr(cur->name, '#');
+ char *octothorp= strrchr(cur->name + 1, '#');
char *ext= strchr(octothorp ? octothorp : cur->name, FN_EXTCHAR);
- if (ext && octothorp != cur->name)
+ if (ext)
{
size_t len= (octothorp ? octothorp : ext) - cur->name;
if (from != cur &&
@@ -239,13 +239,6 @@ int extension_based_table_discovery(MY_DIR *dirp, const char *ext_meta,
simplified version of extension_based_table_discovery(), that does not
modify the list of files. It cannot be called many times for the same
directory listing, otherwise it'll produce duplicate results.
-
- @note
- For backward compatibility reasons, this will find tables with names,
- starting from '#', as long as they don't start from '#sql-'.
- These names are invalid since 5.0, and the compex discovery function
- will ignore them. Anyone still having these files, should disable
- discovering engines, and rename these invalid table files.
*/
int ext_table_discovery_simple(MY_DIR *dirp,
handlerton::discovered_list *result)
@@ -259,7 +252,7 @@ int ext_table_discovery_simple(MY_DIR *dirp,
{
char *ext= strrchr(cur->name, FN_EXTCHAR);
- if (ext && !is_prefix(cur->name, tmp_file_prefix))
+ if (ext)
{
if (my_strnncoll(cs, (uchar*)ext, strlen(ext),
(uchar*)reg_ext, reg_ext_length) == 0)