summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorSergey Vojtovich <sergey.vojtovich@oracle.com>2010-12-01 15:56:46 +0300
committerSergey Vojtovich <sergey.vojtovich@oracle.com>2010-12-01 15:56:46 +0300
commit21779b35eaf0bbbd9aad6c220012a12ff001cc11 (patch)
treed49a55d8fe727fc8e448bd19790e7a10d42b9902 /storage
parent7009fd0e7d72327d11c53b180f05e80d64eff522 (diff)
downloadmariadb-git-21779b35eaf0bbbd9aad6c220012a12ff001cc11.tar.gz
BUG#58205 - Valgrind failure in fn_format when called from
archive_discover Fixed buffer underrun in cleanup_dirname(). Also fixed that original (unencoded) database and table names were used to discover archive tables. mysql-test/r/archive.result: A test case for BUG#58205. mysql-test/t/archive.test: A test case for BUG#58205. mysys/mf_pack.c: Fixed buffer underrun in cleanup_dirname(), when it gets path like "a/../" (relative path, where first directory is to be cut off). storage/archive/ha_archive.cc: Handler discover method gets database and table names as is. It must use build_table_filename() to get name similar to what it gets on create() and open().
Diffstat (limited to 'storage')
-rw-r--r--storage/archive/ha_archive.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index c24fbc21f94..fe167318743 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -20,6 +20,7 @@
#include "sql_priv.h"
#include "probes_mysql.h"
#include "sql_class.h" // SSV
+#include "sql_table.h"
#include <myisam.h>
#include "ha_archive.h"
@@ -256,7 +257,7 @@ int archive_discover(handlerton *hton, THD* thd, const char *db,
char *frm_ptr;
MY_STAT file_stat;
- fn_format(az_file, name, db, ARZ, MY_REPLACE_EXT | MY_UNPACK_FILENAME);
+ build_table_filename(az_file, sizeof(az_file) - 1, db, name, ARZ, 0);
if (!(my_stat(az_file, &file_stat, MYF(0))))
goto err;