mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
Bug#25373: Stored functions wasn't compared correctly which leads to a wrong
result. For built-in functions like sqrt() function names are hard-coded and can be compared by pointer. But this isn't the case for a used-defined stored functions - names there are dynamical and should be compared as strings. Now the Item_func::eq() function employs my_strcasecmp() function to compare used-defined stored functions names. mysql-test/t/sp.test: Added a test case for bug#25373: Stored functions wasn't compared correctly which leads to a wrong result. mysql-test/r/sp.result: Added a test case for bug#25373: Stored functions wasn't compared correctly which leads to a wrong result. sql/item_func.cc: Bug#25373: Stored functions wasn't compared correctly which leads to a wrong result. Now the Item_func::eq() function employs my_strcasecmp() function to compare used-defined stored functions names.
This commit is contained in:
parent
4b40ed9532
commit
11b533b8be
3 changed files with 35 additions and 2 deletions
|
|
@ -5741,4 +5741,17 @@ END|
|
|||
CALL bug24117()|
|
||||
DROP PROCEDURE bug24117|
|
||||
DROP TABLE t3|
|
||||
DROP FUNCTION IF EXISTS bug25373|
|
||||
CREATE FUNCTION bug25373(p1 INTEGER) RETURNS INTEGER
|
||||
LANGUAGE SQL DETERMINISTIC
|
||||
RETURN p1;|
|
||||
CREATE TABLE t3 (f1 INT, f2 FLOAT)|
|
||||
INSERT INTO t3 VALUES (1, 3.4), (1, 2), (1, 0.9), (2, 8), (2, 7)|
|
||||
SELECT SUM(f2), bug25373(f1) FROM t3 GROUP BY bug25373(f1) WITH ROLLUP|
|
||||
SUM(f2) bug25373(f1)
|
||||
6.3000000715256 1
|
||||
15 2
|
||||
21.300000071526 NULL
|
||||
DROP FUNCTION bug25373|
|
||||
DROP TABLE t3|
|
||||
drop table t1,t2;
|
||||
|
|
|
|||
|
|
@ -6714,6 +6714,21 @@ CALL bug24117()|
|
|||
DROP PROCEDURE bug24117|
|
||||
DROP TABLE t3|
|
||||
|
||||
#
|
||||
# Bug#25373: Stored functions wasn't compared correctly which leads to a wrong
|
||||
# result.
|
||||
#
|
||||
--disable_warnings
|
||||
DROP FUNCTION IF EXISTS bug25373|
|
||||
--disable_warnings
|
||||
CREATE FUNCTION bug25373(p1 INTEGER) RETURNS INTEGER
|
||||
LANGUAGE SQL DETERMINISTIC
|
||||
RETURN p1;|
|
||||
CREATE TABLE t3 (f1 INT, f2 FLOAT)|
|
||||
INSERT INTO t3 VALUES (1, 3.4), (1, 2), (1, 0.9), (2, 8), (2, 7)|
|
||||
SELECT SUM(f2), bug25373(f1) FROM t3 GROUP BY bug25373(f1) WITH ROLLUP|
|
||||
DROP FUNCTION bug25373|
|
||||
DROP TABLE t3|
|
||||
#
|
||||
# NOTE: The delimiter is `|`, and not `;`. It is changed to `;`
|
||||
# at the end of the file!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue