Loading mysql-test/r/renamedb.result +4 −0 Original line number Diff line number Diff line Loading @@ -27,3 +27,7 @@ a 2 3 drop database testdb2; create database testdb1; rename database testdb1 to testdb1; ERROR HY000: Can't create database 'testdb1'; database exists drop database testdb1; mysql-test/t/renamedb.test +8 −0 Original line number Diff line number Diff line Loading @@ -16,3 +16,11 @@ select database(); show tables; select a from t1 order by a; drop database testdb2; # # Bug#19392 Rename Database: Crash if case change # create database testdb1; --error 1007 rename database testdb1 to testdb1; drop database testdb1; sql/sql_db.cc +3 −3 Original line number Diff line number Diff line Loading @@ -134,8 +134,8 @@ 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); if ((opt= (my_dblock_t *)hash_search(&lock_db_cache, (const byte*) name, length))) hash_delete(&lock_db_cache, (byte*) opt); } Loading Loading
mysql-test/r/renamedb.result +4 −0 Original line number Diff line number Diff line Loading @@ -27,3 +27,7 @@ a 2 3 drop database testdb2; create database testdb1; rename database testdb1 to testdb1; ERROR HY000: Can't create database 'testdb1'; database exists drop database testdb1;
mysql-test/t/renamedb.test +8 −0 Original line number Diff line number Diff line Loading @@ -16,3 +16,11 @@ select database(); show tables; select a from t1 order by a; drop database testdb2; # # Bug#19392 Rename Database: Crash if case change # create database testdb1; --error 1007 rename database testdb1 to testdb1; drop database testdb1;
sql/sql_db.cc +3 −3 Original line number Diff line number Diff line Loading @@ -134,8 +134,8 @@ 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); if ((opt= (my_dblock_t *)hash_search(&lock_db_cache, (const byte*) name, length))) hash_delete(&lock_db_cache, (byte*) opt); } Loading