summaryrefslogtreecommitdiff
path: root/mysql-test/t/sp.test
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2012-06-15 00:01:20 -0700
committerIgor Babaev <igor@askmonty.org>2012-06-15 00:01:20 -0700
commit1d74ae6b42296edb585d42439ca472632c57d06e (patch)
tree0a9b35a34f5af3cfecc982632656f30df59340c2 /mysql-test/t/sp.test
parent28b4aba40a65006af33cc8e1464ab28643442309 (diff)
downloadmariadb-git-1d74ae6b42296edb585d42439ca472632c57d06e.tar.gz
Fixed LP bug #1002157.
The class Item_func missed an implementation of the virtual function update_null_value. Back-ported the fix for bug 62125 from mysql 5.6 code line. The test case was also back-ported.
Diffstat (limited to 'mysql-test/t/sp.test')
-rw-r--r--mysql-test/t/sp.test41
1 files changed, 41 insertions, 0 deletions
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 5d92fea0bf1..08421040109 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -9145,3 +9145,44 @@ CALL p1(2);
CALL p1(1);
DROP PROCEDURE p1;
+
+--echo #
+--echo # LP bug#1002157 : testing stored function
+--echo # bug#62125 result for null incorrectly yields 1292 warning.
+--echo #
+
+--disable_warnings
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+DROP FUNCTION IF EXISTS f3;
+DROP FUNCTION IF EXISTS f4;
+--enable_warnings
+
+delimiter /;
+
+CREATE FUNCTION f1() RETURNS VARCHAR(1)
+BEGIN RETURN 'X'; END;/
+
+CREATE FUNCTION f2() RETURNS CHAR(1)
+BEGIN RETURN 'X'; END;/
+
+CREATE FUNCTION f3() RETURNS VARCHAR(1)
+BEGIN RETURN NULL; END;/
+
+CREATE FUNCTION f4() RETURNS CHAR(1)
+BEGIN RETURN NULL; END;/
+
+delimiter ;/
+
+SELECT f1() IS NULL;
+SELECT f2() IS NULL;
+SELECT f3() IS NULL;
+SELECT f4() IS NULL;
+
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+DROP FUNCTION f3;
+DROP FUNCTION f4;
+
+--echo # End of 5.5 test
+