1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Bug#19671 mysql_list_fields returns incorrect table name for VIEWs

After view onening real view db name and table name are placed
into table_list->view_db & table_list->view_name.
Item_field class does not handle these names properly during 
intialization of Send_field.
The fix is to use new class 'Item_ident_for_show' 
which sets correct view db name and table name for Send_field.
This commit is contained in:
gluh@eagle.intranet.mysql.r18.ru
2006-06-29 16:52:46 +05:00
parent 9901efea1f
commit f9214221fc
4 changed files with 76 additions and 2 deletions

View File

@@ -582,7 +582,14 @@ mysqld_list_fields(THD *thd, TABLE_LIST *table_list, const char *wild)
{
if (!wild || !wild[0] ||
!wild_case_compare(system_charset_info, field->field_name,wild))
field_list.push_back(new Item_field(field));
{
if (table_list->view)
field_list.push_back(new Item_ident_for_show(field,
table_list->view_db.str,
table_list->view_name.str));
else
field_list.push_back(new Item_field(field));
}
}
restore_record(table, s->default_values); // Get empty record
if (thd->protocol->send_fields(&field_list, Protocol::SEND_DEFAULTS |