diff options
author | unknown <pem@mysql.com> | 2005-09-27 17:07:28 +0200 |
---|---|---|
committer | unknown <pem@mysql.com> | 2005-09-27 17:07:28 +0200 |
commit | 06eabeeea83ebfeacd491acb1283a35522fad578 (patch) | |
tree | 68d8fac8d165ce2a6cb7fd9c841997b2ae8beee6 /mysql-test/t/sp.test | |
parent | 706731cf8d36936b3897168316c819e7b354e321 (diff) | |
download | mariadb-git-06eabeeea83ebfeacd491acb1283a35522fad578.tar.gz |
Fixed BUG#12589: Assert when creating temp. table from decimal stored
procedure variable
Second version, after review.
Keep the unsigned_flag in Item_decimal updated. Note that this also changed
the result of several old test results - creating tables from decimal
templates now gives unsigned columns and different sizes. (Several tests
had Length > Max_length before.)
mysql-test/r/case.result:
Updated result (after fixing BUG#12589).
mysql-test/r/metadata.result:
Updated result (after fixing BUG#12589).
mysql-test/r/ps_2myisam.result:
Updated result (after fixing BUG#12589).
mysql-test/r/ps_3innodb.result:
Updated result (after fixing BUG#12589).
mysql-test/r/ps_4heap.result:
Updated result (after fixing BUG#12589).
mysql-test/r/ps_5merge.result:
Updated result (after fixing BUG#12589).
mysql-test/r/ps_6bdb.result:
Updated result (after fixing BUG#12589).
mysql-test/r/ps_7ndb.result:
Updated result (after fixing BUG#12589).
mysql-test/r/sp.result:
New test case for BUG#12589.
mysql-test/r/type_newdecimal.result:
Updated result (after fixing BUG#12589).
mysql-test/t/sp.test:
New test case for BUG#12589.
sql/item.cc:
Keep the unsigned_flag updated in Item_splocal and Item_decimal.
Diffstat (limited to 'mysql-test/t/sp.test')
-rw-r--r-- | mysql-test/t/sp.test | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 65d4f89e2bb..e16e7456056 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -4265,6 +4265,57 @@ drop procedure bug6127| # +# BUG#12589: Assert when creating temp. table from decimal stored procedure +# variable +# +--disable_warnings +drop procedure if exists bug12589_1| +drop procedure if exists bug12589_2| +drop procedure if exists bug12589_3| +--enable_warnings +create procedure bug12589_1() +begin + declare spv1 decimal(3,3); + set spv1= 123.456; + + set spv1 = 'test'; + create temporary table tm1 as select spv1; + show create table tm1; + drop temporary table tm1; +end| + +create procedure bug12589_2() +begin + declare spv1 decimal(6,3); + set spv1= 123.456; + + create temporary table tm1 as select spv1; + show create table tm1; + drop temporary table tm1; +end| + +create procedure bug12589_3() +begin + declare spv1 decimal(6,3); + set spv1= -123.456; + + create temporary table tm1 as select spv1; + show create table tm1; + drop temporary table tm1; +end| + +# Note: The type of the field will match the value, not the declared +# type of the variable. (This is a type checking issue which +# might be changed later.) + +# Warning expected from "set spv1 = 'test'", the value is set to decimal "0". +call bug12589_1()| +# No warnings here +call bug12589_2()| +call bug12589_3()| + + +# # BUG#NNNN: New bug synopsis # #--disable_warnings |