1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +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

@ -1726,7 +1726,22 @@ CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (1);
HANDLER t1 OPEN;
HANDLER t1 READ FIRST WHERE f1() = 1;
ERROR 42S02: Table 'test.t2' doesn't exist
ERROR 42000: This version of MySQL doesn't yet support 'stored functions in HANDLER ... READ'
HANDLER t1 CLOSE;
DROP FUNCTION f1;
DROP TABLE t1;
#
# Bug#54920 Stored functions are allowed in HANDLER statements,
# but broken.
#
DROP TABLE IF EXISTS t1;
DROP FUNCTION IF EXISTS f1;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1), (2);
CREATE FUNCTION f1() RETURNS INT RETURN 1;
HANDLER t1 OPEN;
HANDLER t1 READ FIRST WHERE f1() = 1;
ERROR 42000: This version of MySQL doesn't yet support 'stored functions in HANDLER ... READ'
HANDLER t1 CLOSE;
DROP FUNCTION f1;
DROP TABLE t1;