Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.3(EOL), 10.4(EOL)
-
None
Description
The FETCH GROUP NEXT ROW statement is accepted in various unexpected contexts.
Procedures
DELIMITER $$
|
CREATE OR REPLACE PROCEDURE p1() |
BEGIN
|
FETCH GROUP NEXT ROW; |
END; |
$$
|
DELIMITER ;
|
CALL p1;
|
It silently compiles and executes the procedure. The FETCH GROUP NEXT ROW is silently ignored.
It should probably return an error at compile time, like inside a non-aggregate FUNCTION.
Anonymous blocks
The same problem is repeatable with anonymous blocks:
DELIMITER $$
|
BEGIN NOT ATOMIC |
FETCH GROUP NEXT ROW; |
END; |
$$
|
DELIMITER ;
|
Non-aggregate functions with DEFINER
If I add the DEFINER clause into a non-aggregate function, FETCH GROUP NEXT ROW is silently accepted:
DELIMITER $$
|
CREATE OR REPLACE DEFINER=root@localhost FUNCTION f1() RETURNS INT |
BEGIN
|
FETCH GROUP NEXT ROW; |
RETURN 0; |
END; |
$$
|
Triggers
CREATE OR REPLACE TABLE t1 (a INT); |
CREATE OR REPLACE TRIGGER tr1 |
AFTER INSERT ON t1 FOR EACH ROW |
FETCH GROUP NEXT ROW; |
Events
CREATE OR REPLACE EVENT ev1 |
ON SCHEDULE EVERY 1 HOUR |
STARTS CURRENT_TIMESTAMP + INTERVAL 1 MONTH |
ENDS CURRENT_TIMESTAMP + INTERVAL 1 MONTH + INTERVAL 1 WEEK |
DO FETCH GROUP NEXT ROW; |
Package body (10.4.4 only)
SET sql_mode=ORACLE; |
DELIMITER $$
|
CREATE OR REPLACE PACKAGE pkg1 AS |
PROCEDURE p1; |
END; |
CREATE OR REPLACE PACKAGE BODY pkg1 AS |
PROCEDURE p1 AS |
BEGIN |
NULL; |
END; |
BEGIN
|
FETCH GROUP NEXT ROW; |
END; |
$$
|
DELIMITER ;
|
Attachments
Issue Links
- blocks
-
MDEV-12518 Unify sql_yacc.yy and sql_yacc_ora.yy
- Closed