summaryrefslogtreecommitdiff
path: root/mysql-test/t/cast.test
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2005-06-15 08:27:33 -0700
committerunknown <igor@rurik.mysql.com>2005-06-15 08:27:33 -0700
commit1575df007448a62bec690e6842cd576cc96a3cb5 (patch)
tree72b3677130fa85e1a40e4eabe5bd4460ee20308c /mysql-test/t/cast.test
parentad57284c6925fe19c182e5b43562e131e1297d7b (diff)
downloadmariadb-git-1575df007448a62bec690e6842cd576cc96a3cb5.tar.gz
cast.result, cast.test:
Added test case for bug #11283. field.h, field.cc: Fixed bug #11283: wrong conversion from varchar to decimal. Added methods Field_string::val_decimal, Field_varstring::val_decimal, Field_blob::val_decimal. They are not inherited from the base class Field_longstr anymore. sql/field.cc: Fixed bug #11283: wrong conversion from varchar to decimal. Added methods Field_string::val_decimal, Field_varstring::val_decimal, Field_blob::val_decimal. They are not inherited from the base class Field_longstr anymore. sql/field.h: Fixed bug #11283: wrong conversion from varchar to decimal. Added methods Field_string::val_decimal, Field_varstring::val_decimal, Field_blob::val_decimal. They are not inherited from the base class Field_longstr anymore. mysql-test/t/cast.test: Added test case for bug #11283. mysql-test/r/cast.result: Added test case for bug #11283.
Diffstat (limited to 'mysql-test/t/cast.test')
-rw-r--r--mysql-test/t/cast.test13
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test
index cafecd6000d..d8c64a4a38b 100644
--- a/mysql-test/t/cast.test
+++ b/mysql-test/t/cast.test
@@ -168,3 +168,16 @@ create table t1(s1 time);
insert into t1 values ('11:11:11');
select cast(s1 as decimal(7,2)) from t1;
drop table t1;
+
+#
+# Test for bug #11283: field conversion from varchar, and text types to decimal
+#
+
+CREATE TABLE t1 (v varchar(10), tt tinytext, t text,
+ mt mediumtext, lt longtext);
+INSERT INTO t1 VALUES ('1.01', '2.02', '3.03', '4.04', '5.05');
+
+SELECT CAST(v AS DECIMAL), CAST(tt AS DECIMAL), CAST(t AS DECIMAL),
+ CAST(mt AS DECIMAL), CAST(lt AS DECIMAL) from t1;
+
+DROP TABLE t1;