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:
@ -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)
|
||||
|
Reference in New Issue
Block a user