Bug #89914 Debug assert when executing create resource group in stored function
Submitted: 5 Mar 2018 14:12 Modified: 23 Mar 2018 18:05
Reporter: Sven Sandberg Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[5 Mar 2018 14:12] Sven Sandberg
Description:
When executing CREATE RESOURCE GROUP in a stored function, the server raises a debug assertion.

How to repeat:
--delimiter |
CREATE FUNCTION func() RETURNS INT
BEGIN
  CREATE RESOURCE GROUP Batch TYPE = USER VCPU = 2-3 THREAD_PRIORITY = 10;
  RETURN 0;
END|
--delimiter ;

SELECT func();

Suggested fix:
The comment before the DBUG_ASSERT statement says that implicit committing statements should not be allowed in sub-statements.

So I guess the fix is to disallow CREATE RESOURCE GROUP in sub-statements.
[23 Mar 2018 18:05] Paul DuBois
Posted by developer:
 
Fixed in 8.0.12.

These resource-group statments are now disallowed in stored functions
because they cause an implicit commit, which is not permitted in a
stored function: CREATE RESOURCE GROUP, ALTER RESOURCE GROUP, DROP
RESOURCE GROUP.