Below is the list of changes that have just been committed into a local
5.1 repository of gluh. When gluh does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-11-23 15:00:22+04:00, gluh@stripped +5 -0
Bug#30152 MySQLD crash duing alter table causes DROP DATABASE to FAIL due to temp file
disable decoding of table name if the table is internal temporary table
mysql-test/r/drop.result@stripped, 2007-11-23 15:00:20+04:00, gluh@stripped +5 -0
test result
mysql-test/t/drop.test@stripped, 2007-11-23 15:00:20+04:00, gluh@stripped +12 -0
test case
sql/sql_db.cc@stripped, 2007-11-23 15:00:20+04:00, gluh@stripped +1 -0
check is the name is internal tmp table name
sql/sql_table.cc@stripped, 2007-11-23 15:00:20+04:00, gluh@stripped +3 -2
disable decoding of table name if the table is internal temporary table
sql/table.h@stripped, 2007-11-23 15:00:20+04:00, gluh@stripped +1 -0
added flag which is true when table name is the name of internal temporary table
diff -Nrup a/mysql-test/r/drop.result b/mysql-test/r/drop.result
--- a/mysql-test/r/drop.result 2006-11-22 00:42:11 +04:00
+++ b/mysql-test/r/drop.result 2007-11-23 15:00:20 +04:00
@@ -85,3 +85,8 @@ select 1;
1
unlock tables;
End of 5.0 tests
+create database mysql_test;
+create table mysql_test.t1(f1 int);
+create table mysql_test.`#sql-347f_7` (f1 int);
+drop database mysql_test;
+End of 5.1 tests
diff -Nrup a/mysql-test/t/drop.test b/mysql-test/t/drop.test
--- a/mysql-test/t/drop.test 2006-08-21 13:18:56 +05:00
+++ b/mysql-test/t/drop.test 2007-11-23 15:00:20 +04:00
@@ -122,3 +122,15 @@ disconnect addconroot2;
connection default;
--echo End of 5.0 tests
+
+#
+# Bug#30152 MySQLD crash duing alter table causes DROP DATABASE to FAIL due to temp file
+#
+create database mysql_test;
+create table mysql_test.t1(f1 int);
+create table mysql_test.`#sql-347f_7` (f1 int);
+
+copy_file $MYSQLTEST_VARDIR/master-data/mysql_test/t1.frm
$MYSQLTEST_VARDIR/master-data/mysql_test/#sql-347f_6.frm;
+drop database mysql_test;
+
+--echo End of 5.1 tests
diff -Nrup a/sql/sql_db.cc b/sql/sql_db.cc
--- a/sql/sql_db.cc 2007-09-11 03:10:32 +05:00
+++ b/sql/sql_db.cc 2007-11-23 15:00:20 +04:00
@@ -1111,6 +1111,7 @@ static long mysql_rm_known_files(THD *th
VOID(filename_to_tablename(file->name, table_list->table_name,
strlen(file->name) + 1));
table_list->alias= table_list->table_name; // If lower_case_table_names=2
+ table_list->internal_tmp_table= is_prefix(file->name, tmp_file_prefix);
/* Link into list */
(*tot_list_next)= table_list;
tot_list_next= &table_list->next_local;
diff -Nrup a/sql/sql_table.cc b/sql/sql_table.cc
--- a/sql/sql_table.cc 2007-11-02 02:48:11 +04:00
+++ b/sql/sql_table.cc 2007-11-23 15:00:20 +04:00
@@ -1632,8 +1632,9 @@ int mysql_rm_table_part2(THD *thd, TABLE
}
alias= (lower_case_table_names == 2) ? table->alias : table->table_name;
/* remove .frm file and engine files */
- path_length= build_table_filename(path, sizeof(path),
- db, alias, reg_ext, 0);
+ path_length= build_table_filename(path, sizeof(path), db, alias, reg_ext,
+ table->internal_tmp_table ?
+ FN_IS_TMP : 0);
}
if (drop_temporary ||
(table_type == NULL &&
diff -Nrup a/sql/table.h b/sql/table.h
--- a/sql/table.h 2007-11-02 00:52:52 +04:00
+++ b/sql/table.h 2007-11-23 15:00:20 +04:00
@@ -1081,6 +1081,7 @@ struct TABLE_LIST
... SELECT implementation).
*/
bool create;
+ bool internal_tmp_table;
/* View creation context. */
| Thread |
|---|
| • bk commit into 5.1 tree (gluh:1.2612) BUG#30152 | gluh | 23 Nov |