From 36667b6a91517f682b43c88a4d6c9144f3965f43 Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Thu, 2 Sep 2004 00:11:40 +0300 Subject: fixed printing of characters casting operartion (BUG#5264) --- mysql-test/r/view.result | 8 ++++++++ mysql-test/t/view.test | 8 ++++++++ sql/item_timefunc.cc | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index b6d7b881498..6129850b9dc 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -1238,3 +1238,11 @@ c 4 drop view v1; drop table t1; +create view v1 as select cast(1 as char(3)); +show create view v1; +Table Create Table +v1 CREATE VIEW `test`.`v1` AS select cast(1 as char(3) charset latin1) AS `cast(1 as char(3))` +select * from v1; +cast(1 as char(3)) +1 +drop view v1; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 506fdf8f5d8..3b1d4a0b362 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -1188,3 +1188,11 @@ create view v1(c) as select a+1 from t1 where b >= 4; select c from v1 where exists (select * from t1 where a=2 and b=c); drop view v1; drop table t1; + +# +# view with cast operation +# +create view v1 as select cast(1 as char(3)); +show create view v1; +select * from v1; +drop view v1; diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 5aa14010058..0e7594a1d98 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2011,7 +2011,7 @@ void Item_char_typecast::print(String *str) if (cast_cs) { str->append(" charset ", 9); - str->append(cast_cs->name); + str->append(cast_cs->csname); } str->append(')'); } -- cgit v1.2.1