=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2008-05-24 17:57:58 +0000
+++ b/sql/sql_table.cc	2008-05-24 20:33:22 +0000
@@ -6981,6 +6981,7 @@
     attached here it is safe to call close_temporary_table().
   */
   close_temporary_table(thd, new_table, 1, 0);
+  new_table= 0;
 
   /*
     Data is copied. Now we:



