summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorunknown <gluh@eagle.intranet.mysql.r18.ru>2006-06-29 16:52:46 +0500
committerunknown <gluh@eagle.intranet.mysql.r18.ru>2006-06-29 16:52:46 +0500
commita7f9f7ae743efca9b1f405773416d19f9ebaf3c2 (patch)
treef2ea28c11a3dc6f2075f8fd1aac5d21c2f9bbb47 /sql/item.h
parent728371c56e3e0a3f421425a9db9e5bab289670cc (diff)
downloadmariadb-git-a7f9f7ae743efca9b1f405773416d19f9ebaf3c2.tar.gz
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. sql/item.cc: Bug#19671 mysql_list_fields returns incorrect table name for VIEWs new Item_ident_for_show class which correctly sets view db and table names for Send_field. sql/item.h: Bug#19671 mysql_list_fields returns incorrect table name for VIEWs new Item_ident_for_show class which correctly sets view db and table names for Send_field. sql/sql_show.cc: Bug#19671 mysql_list_fields returns incorrect table name for VIEWs new Item_ident_for_show is used for views tests/mysql_client_test.c: Bug#19671 mysql_list_fields returns incorrect table name for VIEWs test case
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/sql/item.h b/sql/item.h
index 2cadfda6895..bee24d23245 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1142,6 +1142,28 @@ public:
bool any_privileges);
};
+
+class Item_ident_for_show :public Item
+{
+public:
+ Field *field;
+ const char *db_name;
+ const char *table_name;
+
+ Item_ident_for_show(Field *par_field, const char *db_arg,
+ const char *table_name_arg)
+ :field(par_field), db_name(db_arg), table_name(table_name_arg)
+ {}
+
+ enum Type type() const { return FIELD_ITEM; }
+ double val_real() { return field->val_real(); }
+ longlong val_int() { return field->val_int(); }
+ String *val_str(String *str) { return field->val_str(str); }
+ my_decimal *val_decimal(my_decimal *dec) { return field->val_decimal(dec); }
+ void make_field(Send_field *tmp_field);
+};
+
+
class Item_equal;
class COND_EQUAL;