1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-05 12:42:17 +03:00

Bug #54920 Stored functions are allowed in HANDLER statements,

but broken.

Before this patch, it was allowed to use stored functions in
HANDLER ... READ statements. The problem was that this functionality
was not really supported by the code. Proper locking would for example
not be performed, and it was also possible to break replication by
having stored functions that performed updates.

This patch disallows the use of stored functions in HANDLER ... READ.
Any such statement will now give an ER_NOT_SUPPORTED_YET error.
This is an incompatible change and should be reflected in the
documentation.

Test case added to handler_myisam/handler_innodb.test.
This commit is contained in:
Jon Olav Hauglid
2010-09-24 09:18:16 +02:00
parent 4ecf1d32ac
commit 11c4d8ba1f
4 changed files with 63 additions and 3 deletions

View File

@ -1809,9 +1809,32 @@ CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (1);
HANDLER t1 OPEN;
# This used to cause the assert
--error ER_NO_SUCH_TABLE
--error ER_NOT_SUPPORTED_YET
HANDLER t1 READ FIRST WHERE f1() = 1;
HANDLER t1 CLOSE;
DROP FUNCTION f1;
DROP TABLE t1;
--echo #
--echo # Bug#54920 Stored functions are allowed in HANDLER statements,
--echo # but broken.
--echo #
--disable_warnings
DROP TABLE IF EXISTS t1;
DROP FUNCTION IF EXISTS f1;
--enable_warnings
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1), (2);
CREATE FUNCTION f1() RETURNS INT RETURN 1;
HANDLER t1 OPEN;
--error ER_NOT_SUPPORTED_YET
HANDLER t1 READ FIRST WHERE f1() = 1;
HANDLER t1 CLOSE;
DROP FUNCTION f1;
DROP TABLE t1;