List:Internals« Previous MessageNext Message »
From:Petr Chardin Date:September 14 2005 5:25am
Subject:bk commit into 5.0 tree (petr:1.1954) BUG#12979
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of cps. When cps does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1954 05/09/14 07:25:32 petr@stripped +5 -0
  fix for Bug #12979 Stored procedures: crash if inout decimal parameter

  sql/item_func.cc
    1.251 05/09/14 07:25:21 petr@stripped +1 -1
    call correct method of the item

  mysql-test/t/type_newdecimal.test
    1.29 05/09/14 07:25:21 petr@stripped +7 -0
    add a test for the bug

  mysql-test/t/sp.test
    1.150 05/09/14 07:25:21 petr@stripped +29 -0
    add a test for the bug

  mysql-test/r/type_newdecimal.result
    1.29 05/09/14 07:25:21 petr@stripped +3 -0
    fix result

  mysql-test/r/sp.result
    1.154 05/09/14 07:25:20 petr@stripped +16 -0
    fix result

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	petr
# Host:	owlet.
# Root:	/home/cps/mysql/trees/mysql-5.0-virgin

--- 1.250/sql/item_func.cc	2005-09-09 10:08:44 +04:00
+++ 1.251/sql/item_func.cc	2005-09-14 07:25:21 +04:00
@@ -765,7 +765,7 @@
   }
   case REAL_RESULT:
   {
-    double result= (double)int_op();
+    double result= (double)real_op();
     double2my_decimal(E_DEC_FATAL_ERROR, result, decimal_value);
     break;
   }

--- 1.28/mysql-test/r/type_newdecimal.result	2005-09-04 19:59:55 +04:00
+++ 1.29/mysql-test/r/type_newdecimal.result	2005-09-14 07:25:21 +04:00
@@ -1016,3 +1016,6 @@
 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

--- 1.28/mysql-test/t/type_newdecimal.test	2005-09-04 19:59:55 +04:00
+++ 1.29/mysql-test/t/type_newdecimal.test	2005-09-14 07:25:21 +04:00
@@ -1037,3 +1037,10 @@
 
 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);

--- 1.153/mysql-test/r/sp.result	2005-09-13 18:54:39 +04:00
+++ 1.154/mysql-test/r/sp.result	2005-09-14 07:25:20 +04:00
@@ -3331,4 +3331,20 @@
 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;

--- 1.149/mysql-test/t/sp.test	2005-09-13 19:59:13 +04:00
+++ 1.150/mysql-test/t/sp.test	2005-09-14 07:25:21 +04:00
@@ -4178,6 +4178,35 @@
 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
Thread
bk commit into 5.0 tree (petr:1.1954) BUG#12979Petr Chardin14 Sep