1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

BUG#2304 - HANDLER and tables in non-current db

This commit is contained in:
serg@serg.mylan
2004-01-13 12:31:25 +01:00
parent 18036f98ac
commit 90c6ecca93
4 changed files with 47 additions and 9 deletions

View File

@ -276,14 +276,13 @@ static TABLE **find_table_ptr_by_name(THD *thd, const char *db,
int dblen;
TABLE **ptr;
if (!db || ! *db)
db= thd->db ? thd->db : "";
dblen=strlen(db)+1;
DBUG_ASSERT(db);
dblen=*db ? strlen(db)+1 : 0;
ptr=&(thd->handler_tables);
for (TABLE *table=*ptr; table ; table=*ptr)
{
if (!memcmp(table->table_cache_key, db, dblen) &&
if ((!dblen || !memcmp(table->table_cache_key, db, dblen)) &&
!my_strcasecmp((is_alias ? table->table_name : table->real_name),table_name))
{
if (table->version != refresh_version)