Here's a sample of what I'd like to do. The stored procedure fails to create while the LIMIT is present on the query. If I take the LIMIT off the procedure creates.
CREATE PROCEDURE LimitTest(IN in_start INTEGER UNSIGNED, IN in_limit INTEGER UNSIGNED)
BEGIN
DECLARE no_more_results INTEGER DEFAULT 0;
DECLARE var_result INTEGER UNSIGNED;
DECLARE row CURSOR FOR SELECT id from test LIMIT in_start,in_limit;
DECLARE CONTINUE HANDLER FOR NOT FOUND
SET no_more_results = 1;
OPEN row;
FETCH row INTO var_result;
REPEAT
INSERT INTO results VALUES(var_result);
FETCH row INTO var_result;
UNTIL no_more_results = 1
END REPEAT;
CLOSE row;
END