summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <petr@mysql.com>2005-09-14 07:30:04 +0400
committerunknown <petr@mysql.com>2005-09-14 07:30:04 +0400
commit50c1bdcd062140d43ecc9d3b21d787bb12e55bd6 (patch)
tree5837bf0448632a0ea9bb813175384229648db4b6 /mysql-test
parent4f4ab005af7800dcc25a4f53aa2a6a01ced62811 (diff)
parent685173664a1c970318775cb05dfa4a72b8cd4e45 (diff)
downloadmariadb-git-50c1bdcd062140d43ecc9d3b21d787bb12e55bd6.tar.gz
Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/cps/mysql/trees/mysql-5.0-virgin
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/sp.result16
-rw-r--r--mysql-test/r/type_newdecimal.result3
-rw-r--r--mysql-test/t/sp.test29
-rw-r--r--mysql-test/t/type_newdecimal.test7
4 files changed, 55 insertions, 0 deletions
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 0559b45168b..9ad9f9175db 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -3331,4 +3331,20 @@ set @x=y;
end|
call bug13124()|
drop procedure bug13124|
+drop procedure if exists bug12979_1|
+create procedure bug12979_1(inout d decimal(5)) set d = d / 2|
+set @bug12979_user_var = NULL|
+call bug12979_1(@bug12979_user_var)|
+drop procedure bug12979_1|
+drop procedure if exists bug12979_2|
+create procedure bug12979_2()
+begin
+declare internal_var decimal(5);
+set internal_var= internal_var / 2;
+select internal_var;
+end|
+call bug12979_2()|
+internal_var
+NULL
+drop procedure bug12979_2|
drop table t1,t2;
diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result
index f06e290a49b..d821339a229 100644
--- a/mysql-test/r/type_newdecimal.result
+++ b/mysql-test/r/type_newdecimal.result
@@ -1016,3 +1016,6 @@ v tdec
v tdec
9 0
drop procedure wg2;
+select cast(@non_existing_user_var/2 as DECIMAL);
+cast(@non_existing_user_var/2 as DECIMAL)
+NULL
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index a1e2bf8aa32..d44b6ac7e98 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -4178,6 +4178,35 @@ call bug13124()|
drop procedure bug13124|
#
+# Bug #12979 Stored procedures: crash if inout decimal parameter
+#
+
+# check NULL inout parameters processing
+
+--disable_warnings
+drop procedure if exists bug12979_1|
+--enable_warnings
+create procedure bug12979_1(inout d decimal(5)) set d = d / 2|
+set @bug12979_user_var = NULL|
+call bug12979_1(@bug12979_user_var)|
+drop procedure bug12979_1|
+
+# check NULL local variables processing
+
+--disable_warnings
+drop procedure if exists bug12979_2|
+--enable_warnings
+create procedure bug12979_2()
+begin
+declare internal_var decimal(5);
+set internal_var= internal_var / 2;
+select internal_var;
+end|
+call bug12979_2()|
+drop procedure bug12979_2|
+
+
+#
# BUG#NNNN: New bug synopsis
#
#--disable_warnings
diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test
index 55e0618a3e5..3f04aa931d2 100644
--- a/mysql-test/t/type_newdecimal.test
+++ b/mysql-test/t/type_newdecimal.test
@@ -1037,3 +1037,10 @@ call wg2()//
delimiter ;//
drop procedure wg2;
+
+#
+# Bug #12979 Stored procedures: crash if inout decimal parameter
+# (not a SP bug in fact)
+#
+
+select cast(@non_existing_user_var/2 as DECIMAL);