summaryrefslogtreecommitdiff
path: root/mysql-test/t/sp-vars.test
diff options
context:
space:
mode:
authorunknown <malff/marcsql@weblab.(none)>2006-10-19 11:39:51 -0700
committerunknown <malff/marcsql@weblab.(none)>2006-10-19 11:39:51 -0700
commit5bd58f3e00ad7e7430c8d728f94209dce4c1a4e4 (patch)
tree997ff98a25d591733b1ee8e0a441ad58f17eaaaa /mysql-test/t/sp-vars.test
parentde304106ca659f3d74c75e75ee02bc01d7d5d0a1 (diff)
downloadmariadb-git-5bd58f3e00ad7e7430c8d728f94209dce4c1a4e4.tar.gz
Bug#20028 (Function with select return no data)
This patch reverts a change introduced by Bug 6951, which incorrectly set thd->abort_on_warning for stored procedures. As per internal discussions about the SQL_MODE=TRADITIONAL, the correct behavior is to *not* abort on warnings even inside an INSERT/UPDATE trigger. Tests for Stored Procedures, Stored Functions, Triggers involving SQL_MODE have been included or revised, to reflect the intended behavior. (reposting approved patch, to work around source control issues, no review needed) mysql-test/include/sp-vars.inc: Tests for SQL_MODE='TRADITIONAL' mysql-test/r/sp-vars.result: Tests for SQL_MODE='TRADITIONAL' mysql-test/r/sp.result: Tests for SQL_MODE='TRADITIONAL' mysql-test/r/trigger.result: Tests for SQL_MODE='TRADITIONAL' mysql-test/t/sp-vars.test: Tests for SQL_MODE='TRADITIONAL' mysql-test/t/sp.test: Tests for SQL_MODE='TRADITIONAL' mysql-test/t/trigger.test: Tests for SQL_MODE='TRADITIONAL' sql/sp_head.cc: For SQL_MODE='TRADITIONAL', thd->abort_on_warning should be set only when assigning a *column*
Diffstat (limited to 'mysql-test/t/sp-vars.test')
-rw-r--r--mysql-test/t/sp-vars.test10
1 files changed, 10 insertions, 0 deletions
diff --git a/mysql-test/t/sp-vars.test b/mysql-test/t/sp-vars.test
index 48dbd4de7aa..7cf92dc5d0d 100644
--- a/mysql-test/t/sp-vars.test
+++ b/mysql-test/t/sp-vars.test
@@ -15,6 +15,7 @@ DROP FUNCTION IF EXISTS sp_vars_check_ret1;
DROP FUNCTION IF EXISTS sp_vars_check_ret2;
DROP FUNCTION IF EXISTS sp_vars_check_ret3;
DROP FUNCTION IF EXISTS sp_vars_check_ret4;
+DROP FUNCTION IF EXISTS sp_vars_div_zero;
--enable_warnings
@@ -49,6 +50,8 @@ SELECT sp_vars_check_ret3();
SELECT sp_vars_check_ret4();
+SELECT sp_vars_div_zero();
+
# Check that changing sql_mode after creating a store procedure does not
# matter.
@@ -72,6 +75,8 @@ SELECT sp_vars_check_ret3();
SELECT sp_vars_check_ret4();
+SELECT sp_vars_div_zero();
+
# Create the procedure in TRADITIONAL mode. Check that error will be thrown on
# execution.
@@ -81,6 +86,7 @@ DROP FUNCTION sp_vars_check_ret1;
DROP FUNCTION sp_vars_check_ret2;
DROP FUNCTION sp_vars_check_ret3;
DROP FUNCTION sp_vars_check_ret4;
+DROP FUNCTION sp_vars_div_zero;
--source include/sp-vars.inc
@@ -110,6 +116,9 @@ SELECT sp_vars_check_ret3();
SELECT sp_vars_check_ret4();
+--error ER_DIVISION_BY_ZERO
+SELECT sp_vars_div_zero();
+
SET @@sql_mode = 'ansi';
#
@@ -122,6 +131,7 @@ DROP FUNCTION sp_vars_check_ret1;
DROP FUNCTION sp_vars_check_ret2;
DROP FUNCTION sp_vars_check_ret3;
DROP FUNCTION sp_vars_check_ret4;
+DROP FUNCTION sp_vars_div_zero;
###########################################################################
#