summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2004-09-02 00:11:40 +0300
committerbell@sanja.is.com.ua <>2004-09-02 00:11:40 +0300
commit36667b6a91517f682b43c88a4d6c9144f3965f43 (patch)
tree47052d0d52529411310035be7033f18d8df612e6
parentd1b667bdd12af231c3e4984baf6071828ee0ce0c (diff)
downloadmariadb-git-36667b6a91517f682b43c88a4d6c9144f3965f43.tar.gz
fixed printing of characters casting operartion (BUG#5264)
-rw-r--r--mysql-test/r/view.result8
-rw-r--r--mysql-test/t/view.test8
-rw-r--r--sql/item_timefunc.cc2
3 files changed, 17 insertions, 1 deletions
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(')');
}