Loading mysql-test/r/lowercase_table2.result +18 −0 Original line number Diff line number Diff line Loading @@ -141,3 +141,21 @@ select * from T1; a b 1 abc drop table T1; create database mysqltest_LC2; use mysqltest_LC2; create table myUC (i int); insert into myUC values (1),(2),(3); select * from myUC; i 1 2 3 use test; drop database mysqltest_LC2; create database mysqltest_LC2; use mysqltest_LC2; create table myUC (i int); select * from myUC; i use test; drop database mysqltest_LC2; mysql-test/t/lowercase_table2.test +17 −0 Original line number Diff line number Diff line Loading @@ -111,3 +111,20 @@ select * from T1; alter table T1 add index (a); select * from T1; drop table T1; # # Bug #8355: Tables not dropped from table cache on drop db # create database mysqltest_LC2; use mysqltest_LC2; create table myUC (i int); insert into myUC values (1),(2),(3); select * from myUC; use test; drop database mysqltest_LC2; create database mysqltest_LC2; use mysqltest_LC2; create table myUC (i int); select * from myUC; use test; drop database mysqltest_LC2; sql/mysql_priv.h +1 −1 Original line number Diff line number Diff line Loading @@ -750,7 +750,7 @@ bool close_temporary_table(THD *thd, const char *db, const char *table_name); void close_temporary(TABLE *table, bool delete_table=1); bool rename_temporary_table(THD* thd, TABLE *table, const char *new_db, const char *table_name); void remove_db_from_cache(const my_string db); void remove_db_from_cache(const char *db); void flush_tables(); bool remove_table_from_cache(THD *thd, const char *db, const char *table, bool return_if_owned_by_thd=0); Loading sql/sql_base.cc +11 −1 Original line number Diff line number Diff line Loading @@ -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); Loading Loading
mysql-test/r/lowercase_table2.result +18 −0 Original line number Diff line number Diff line Loading @@ -141,3 +141,21 @@ select * from T1; a b 1 abc drop table T1; create database mysqltest_LC2; use mysqltest_LC2; create table myUC (i int); insert into myUC values (1),(2),(3); select * from myUC; i 1 2 3 use test; drop database mysqltest_LC2; create database mysqltest_LC2; use mysqltest_LC2; create table myUC (i int); select * from myUC; i use test; drop database mysqltest_LC2;
mysql-test/t/lowercase_table2.test +17 −0 Original line number Diff line number Diff line Loading @@ -111,3 +111,20 @@ select * from T1; alter table T1 add index (a); select * from T1; drop table T1; # # Bug #8355: Tables not dropped from table cache on drop db # create database mysqltest_LC2; use mysqltest_LC2; create table myUC (i int); insert into myUC values (1),(2),(3); select * from myUC; use test; drop database mysqltest_LC2; create database mysqltest_LC2; use mysqltest_LC2; create table myUC (i int); select * from myUC; use test; drop database mysqltest_LC2;
sql/mysql_priv.h +1 −1 Original line number Diff line number Diff line Loading @@ -750,7 +750,7 @@ bool close_temporary_table(THD *thd, const char *db, const char *table_name); void close_temporary(TABLE *table, bool delete_table=1); bool rename_temporary_table(THD* thd, TABLE *table, const char *new_db, const char *table_name); void remove_db_from_cache(const my_string db); void remove_db_from_cache(const char *db); void flush_tables(); bool remove_table_from_cache(THD *thd, const char *db, const char *table, bool return_if_owned_by_thd=0); Loading
sql/sql_base.cc +11 −1 Original line number Diff line number Diff line Loading @@ -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); Loading