List:Commits« Previous MessageNext Message »
From:ahristov Date:July 19 2006 4:48pm
Subject:bk commit into 5.1 tree (andrey:1.2254) BUG#16532
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of andrey. When andrey 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, 2006-07-19 18:48:17+02:00, andrey@lmy004. +4 -0
  Fix for bug#16532 mysql server assert in debug if table definition is removed
  
  Emit an error instead of doing ASSERT

  BitKeeper/etc/ignore@stripped, 2006-07-19 18:48:10+02:00, andrey@lmy004. +4 -0
    Added mysql-test/t.sql mysql-test/t.txt mysql-test/v1.sql mysql-test/v2.sql to the ignore list

  mysql-test/r/debug_non_windows.result@stripped, 2006-07-19 18:48:10+02:00, andrey@lmy004. +19 -0
    New BitKeeper file ``mysql-test/r/debug_non_windows.result''

  mysql-test/r/debug_non_windows.result@stripped, 2006-07-19 18:48:10+02:00, andrey@lmy004. +0 -0

  mysql-test/t/debug_non_windows.test@stripped, 2006-07-19 18:48:10+02:00, andrey@lmy004. +29 -0
    New BitKeeper file ``mysql-test/t/debug_non_windows.test''

  mysql-test/t/debug_non_windows.test@stripped, 2006-07-19 18:48:10+02:00, andrey@lmy004. +0 -0

  sql/sql_table.cc@stripped, 2006-07-19 18:48:10+02:00, andrey@lmy004. +5 -1
    it could happen that an user deletes the frm file on OS level.
    In addition if the table was already opened, the file system level
    check for existance of table.frm will pass but get_cached_table_share()
    will return non-NULL value. In this case we will emit the standard
    error that the table exist. The error case is quite obscure but error
    message is better than a sigabort.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	andrey
# Host:	lmy004.
# Root:	/work/mysql-5.1-runtime-bug16532

--- 1.358/sql/sql_table.cc	2006-07-19 18:48:33 +02:00
+++ 1.359/sql/sql_table.cc	2006-07-19 18:48:33 +02:00
@@ -3321,7 +3321,11 @@
       my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
       goto unlock_and_end;
     }
-    DBUG_ASSERT(get_cached_table_share(db, alias) == 0);
+    if (get_cached_table_share(db, alias))
+    {
+      my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name);
+      goto unlock_and_end;
+    }
   }
 
   /*
--- New file ---
+++ mysql-test/r/debug_non_windows.result	06/07/19 18:48:10
use test;
drop table if exists table_manual_delete;
create table table_manual_delete(a int) engine=myisam;
insert into table_manual_delete values(1);
"We get an error because the table is in the definition cache"
create table table_manual_delete(a int, b int);
ERROR 42S01: Table 'table_manual_delete' already exists
"Flush the cache and recreate the table anew to be able to drop it"
flush tables;
show open tables;
Database	Table	In_use	Name_locked
mysql	general_log	1	0
create table table_manual_delete(a int, b int, c int);
"Try to select from the table. This should not crash the server"
"and don't care about the actual data."
select count(a) from table_manual_delete;
count(a)
COUNT
drop table table_manual_delete;

--- New file ---
+++ mysql-test/t/debug_non_windows.test	06/07/19 18:48:10
# Non-windows specific create tests.

--source include/not_windows.inc
--source include/have_debug.inc

#
# Bug#16532:mysql server assert in debug if table det is removed
#
use test;
--disable_warnings
drop table if exists table_manual_delete;
--enable_warnings
create table table_manual_delete(a int) engine=myisam;
insert into table_manual_delete values(1);
--system rm -f $MYSQLTEST_VARDIR/master-data/test/table_manual_delete.frm
--echo "We get an error because the table is in the definition cache"
--error ER_TABLE_EXISTS_ERROR
create table table_manual_delete(a int, b int);
--echo "Flush the cache and recreate the table anew to be able to drop it"
flush tables;
show open tables;
create table table_manual_delete(a int, b int, c int);
--echo "Try to select from the table. This should not crash the server"
--echo "and don't care about the actual data."
--replace_column 1 COUNT
select count(a) from table_manual_delete;
drop table table_manual_delete;

# End of 5.0 tests


--- 1.251/BitKeeper/etc/ignore	2006-07-19 18:48:33 +02:00
+++ 1.252/BitKeeper/etc/ignore	2006-07-19 18:48:33 +02:00
@@ -1782,3 +1782,7 @@
 vio/viotest.cpp
 zlib/*.ds?
 zlib/*.vcproj
+mysql-test/t.sql
+mysql-test/t.txt
+mysql-test/v1.sql
+mysql-test/v2.sql
Thread
bk commit into 5.1 tree (andrey:1.2254) BUG#16532ahristov19 Jul