From fa0ea36507e886f270ce11ffea67af031febb88d Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Sat, 30 Jul 2005 05:53:35 +0400 Subject: Fix bug #11335 View redefines TinyInt(1) column definition Item_type_holder doesn't store information about length and exact type of original item which results in redefining length to max_length and geometry type to longtext. Changed the way derived tables except unions are built. Now they are created from original field list instead of list of Item_type_holder. --- sql/sql_union.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sql/sql_union.cc') diff --git a/sql/sql_union.cc b/sql/sql_union.cc index f2b637dc5f4..c414f5e9e72 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -235,7 +235,13 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, if ((res= (res || thd_arg->is_fatal_error))) goto err; - if (sl == first_select) + /* + Use items list of underlaid select for derived tables to preserve + information about fields lengths and exact types + */ + if (!is_union) + types= first_select_in_union()->item_list; + else if (sl == first_select) { /* We need to create an empty table object. It is used -- cgit v1.2.1