summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorevgen@moonbone.local <>2005-07-30 05:53:35 +0400
committerevgen@moonbone.local <>2005-07-30 05:53:35 +0400
commitfa0ea36507e886f270ce11ffea67af031febb88d (patch)
treedcb6725978d9c6687be4f2891dc7c4e48a2d17dc /sql/sql_union.cc
parentf4d27c75e6ffe947711429deff34402e66b7ba56 (diff)
downloadmariadb-git-fa0ea36507e886f270ce11ffea67af031febb88d.tar.gz
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.
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc8
1 files changed, 7 insertions, 1 deletions
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