Bug #93372 UDFs don't throw errors on some validations
Submitted: 27 Nov 2018 19:22 Modified: 23 May 2019 15:21
Reporter: Pedro Gomes Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Group Replication Severity:S3 (Non-critical)
Version:8.0.13 OS:Any
Assigned to: CPU Architecture:Any

[27 Nov 2018 19:22] Pedro Gomes
Description:
Some validations made in the UDF main execution function do not return errors. 

On init fuctions return values make the function return an error ER_CANT_INITIALIZE_UDF

On the main functions however we need to rely on my_error with ER_GRP_RPL_UDF_ERROR

These validations were duplicated because some parameters can't be checked when coming from dynamic sources like SQL queries. 
Why a decision to not throw errors is lost in memory, but there is no reason to not to as far as I see.

In order to improve the integration with other tools like InnoDB Cluster we should improve this

We should also refactor the code a bit to reduce duplication. 

How to repeat:
Go to test 
  gr_primary_mode_group_operations_03

Note the loop execution on line 208 and how no error is returned

Suggested fix:
Use my_error ER_GRP_RPL_UDF_ERROR on UDF main execution functions
Also try to reduce the duplicated code
[23 May 2019 15:21] Margaret Fisher
Posted by developer:
 
Changelog entry added for MySQL 8.0.17:

The Group Replication UDFs for configuring an online group sometimes did not return an error if an issue arose during main execution. The UDFs also now check whether the Group Replication plugin is stopping before they start to initialize.