1# suite/funcs_1/storedproc/param_check.inc 2# 3# Auxiliary routine to be sourced by 4# suite/funcs_1/t/storedproc.test 5# 6# Purpose: 7# The assignment of float values to objects of type DECIMAL causes 8# conversions and in some cases an adjustment of the value to 9# a border of the value range. 10# Try to reveal that function and procedure parameters get a similar 11# mangling of the value like columns. 12# 13# Variables to be set before sourcing this routine 14# $test_value - value to be checked 15# 16# Created: 17# 2008-08-27 mleich 18# 19# Modified: 20# 2008-11-17 pcrews 21# added --disable / --enable_warning statements to minimize differences 22# between platforms (Bug#40177 Test funcs_1.storedproc failing on Pushbuild) 23# 24# TODO: (After 5.1 GA) 25# 1) Examine reordering statements in this file to minimize the number of 26# --disable / --enable_warning statements. Unsure if performance gains 27# warrant the working time 28# 2) We could probably add a comparison of the # of warnings before the 29# assignment of @v1_proc and @v1_func to the # of warnings after assignment 30# The difference of these values should be zero 31# Refer to Bug#40177 - http://bugs.mysql.com/bug.php?id=40177 for notes as well 32 33eval UPDATE t1_aux SET f1 = NULL; 34# Enforce that all user variables have the same data type and initial value. 35SELECT f1,f1,f1,f1 INTO @v1_tab,@v1_proc,@v2_proc,@v1_func FROM t1_aux; 36 37--disable_warnings 38eval UPDATE t1_aux SET f1 = $test_value; 39--enable_warnings 40SELECT f1 INTO @v1_tab FROM t1_aux; 41--disable_warnings 42eval CALL sproc_1($test_value, @v1_proc); 43eval SET @v1_func = func_1($test_value); 44--enable_warnings 45 46if (`SELECT @v1_tab <> @v1_proc OR @v1_tab <> @v2_proc OR @v1_tab <> @v1_func`) 47{ 48 --echo Error: @v1_tab, @v1_proc, @v2_proc, @v1_func are not all equal 49 SELECT @v1_tab, @v1_proc, @v2_proc, @v1_func; 50} 51