diff options
author | Marc Alff <marc.alff@sun.com> | 2009-09-17 03:20:11 -0600 |
---|---|---|
committer | Marc Alff <marc.alff@sun.com> | 2009-09-17 03:20:11 -0600 |
commit | 08ffe21317edee77503b13fac86e30c4b59ea17a (patch) | |
tree | d0d731222454addb05b3890fb2bc555da5af7d63 /sql/handler.cc | |
parent | f662d397c826b21851d7f43df34730f686e1b413 (diff) | |
parent | 4b4fcdd8f00247e4bfcce2229887d572a7aef7f2 (diff) | |
download | mariadb-git-08ffe21317edee77503b13fac86e30c4b59ea17a.tar.gz |
Merge mysql-next-mr --> mysql-trunk-signal
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index c29cb196b60..3a022d88d35 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1886,12 +1886,42 @@ bool ha_flush_logs(handlerton *db_type) return FALSE; } + +/** + @brief make canonical filename + + @param[in] file table handler + @param[in] path original path + @param[out] tmp_path buffer for canonized path + + @details Lower case db name and table name path parts for + non file based tables when lower_case_table_names + is 2 (store as is, compare in lower case). + Filesystem path prefix (mysql_data_home or tmpdir) + is left intact. + + @note tmp_path may be left intact if no conversion was + performed. + + @retval canonized path + + @todo This may be done more efficiently when table path + gets built. Convert this function to something like + ASSERT_CANONICAL_FILENAME. +*/ const char *get_canonical_filename(handler *file, const char *path, char *tmp_path) { + uint i; if (lower_case_table_names != 2 || (file->ha_table_flags() & HA_FILE_BASED)) return path; + for (i= 0; i <= mysql_tmpdir_list.max; i++) + { + if (is_prefix(path, mysql_tmpdir_list.list[i])) + return path; + } + /* Ensure that table handler get path in lower case */ if (tmp_path != path) strmov(tmp_path, path); |