summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorSergey Glukhov <Sergey.Glukhov@sun.com>2010-03-12 10:33:16 +0400
committerSergey Glukhov <Sergey.Glukhov@sun.com>2010-03-12 10:33:16 +0400
commitb8132a8d946bde553834c37785bbe53008f1e925 (patch)
tree8c5e7ceda5785c052e709a71c6a64f50b2e93eae /sql/table.cc
parentb182c9bd2030c3b3c548157d1bc4c01c306b2c5c (diff)
downloadmariadb-git-b8132a8d946bde553834c37785bbe53008f1e925.tar.gz
Bug#41788 mysql_fetch_field returns org_table == table by a view
The problem is that Item_direct_view_ref which is inherited from Item_ident updates orig_table_name and table_name with the same values. The fix is introduction of new constructor into Item_ident and up which updates orig_table_name and table_name separately. mysql-test/r/metadata.result: test case mysql-test/t/metadata.test: test case sql/item.cc: new constructor which updates orig_table_name and table_name separately. sql/item.h: new constructor which updates orig_table_name and table_name separately. sql/table.cc: used new constructor
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 8758596d408..a4e2c59fb87 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -4023,9 +4023,7 @@ Item *create_view_field(THD *thd, TABLE_LIST *view, Item **field_ref,
{
DBUG_RETURN(field);
}
- Item *item= new Item_direct_view_ref(&view->view->select_lex.context,
- field_ref, view->alias,
- name);
+ Item *item= new Item_direct_view_ref(view, field_ref, name);
DBUG_RETURN(item);
}