1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Bug#19392 Rename Database: Crash if case change

Problem:
Renaming a database to itself crashed server.
It hapenned because of wrong DBUG_ASSERT.
Fix: removing wrong DBUG_ASSERT. Now it reports
a correct error message "database alreadt exists".


mysql-test/r/renamedb.result:
  Adding test case
mysql-test/t/renamedb.test:
  Adding test case
sql/sql_db.cc:
  DBUG_ASSERT crashed server when renaming a database to itself.
This commit is contained in:
unknown
2006-05-18 12:21:13 +05:00
parent de0e4a9a8f
commit 9c686c8a68
3 changed files with 15 additions and 3 deletions

View File

@@ -134,9 +134,9 @@ void lock_db_delete(const char *name, uint length)
{
my_dblock_t *opt;
safe_mutex_assert_owner(&LOCK_lock_db);
opt= (my_dblock_t *)hash_search(&lock_db_cache, (const byte*) name, length);
DBUG_ASSERT(opt != NULL);
hash_delete(&lock_db_cache, (byte*) opt);
if (opt= (my_dblock_t *)hash_search(&lock_db_cache,
(const byte*) name, length))
hash_delete(&lock_db_cache, (byte*) opt);
}