diff options
author | Andrei Elkin <aelkin@mysql.com> | 2009-11-06 18:35:04 +0200 |
---|---|---|
committer | Andrei Elkin <aelkin@mysql.com> | 2009-11-06 18:35:04 +0200 |
commit | 69d6fcbd3b225c177c4e0e3af65aa2cf9494eff3 (patch) | |
tree | 44a02955b1dc18fc2e94cd0b4dc6ef62cd81d936 /sql/handler.cc | |
parent | ea84da107a8d8f6b061d00dcf76c3369f8a96868 (diff) | |
parent | 684b1d39ac7eab6ff5d9095aaa25dcea35b88a28 (diff) | |
download | mariadb-git-69d6fcbd3b225c177c4e0e3af65aa2cf9494eff3.tar.gz |
merging 5.1 main -> rpl+2. Some manual work required mostly due to bug46640
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index abe705960f0..c881142aa6f 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1913,12 +1913,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); @@ -3499,14 +3529,10 @@ int handler::index_next_same(uchar *buf, const uchar *key, uint keylen) if (!(error=index_next(buf))) { my_ptrdiff_t ptrdiff= buf - table->record[0]; - uchar *save_record_0; - KEY *key_info; - KEY_PART_INFO *key_part; - KEY_PART_INFO *key_part_end; - LINT_INIT(save_record_0); - LINT_INIT(key_info); - LINT_INIT(key_part); - LINT_INIT(key_part_end); + uchar *UNINIT_VAR(save_record_0); + KEY *UNINIT_VAR(key_info); + KEY_PART_INFO *UNINIT_VAR(key_part); + KEY_PART_INFO *UNINIT_VAR(key_part_end); /* key_cmp_if_same() compares table->record[0] against 'key'. |