summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-02-08 15:14:14 -0800
committerunknown <jimw@mysql.com>2005-02-08 15:14:14 -0800
commit1de817e9c467178b82690618223cf320d48a4b0b (patch)
tree6a89a3a3531f64e04508caa83d1b54a1482520a2 /sql/sql_base.cc
parentffe417fddeb68274166153a357d9d534675d1823 (diff)
downloadmariadb-git-1de817e9c467178b82690618223cf320d48a4b0b.tar.gz
Fix removal of tables from cache when the database they are contained
within is dropped and lower_case_table_names is set. (Bug #8355) mysql-test/t/lowercase_table2.test: Add new regression test mysql-test/r/lowercase_table2.result: Add results for regression test sql/mysql_priv.h: Change remove_db_from_cache() to use char* instead of my_string sql/sql_base.cc: Lowercase database name in remove_db_from_cache so that all of the correct entries are removed.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index fe1f268e277..7ff5a02f05a 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2864,8 +2864,18 @@ static void mysql_rm_tmp_tables(void)
** and afterwards delete those marked unused.
*/
-void remove_db_from_cache(const my_string db)
+void remove_db_from_cache(const char *db)
{
+ char name_buff[NAME_LEN+1];
+ if (db && lower_case_table_names)
+ {
+ /*
+ convert database to lower case for comparision.
+ */
+ strmake(name_buff, db, sizeof(name_buff)-1);
+ my_casedn_str(files_charset_info, name_buff);
+ db= name_buff;
+ }
for (uint idx=0 ; idx < open_cache.records ; idx++)
{
TABLE *table=(TABLE*) hash_element(&open_cache,idx);