Bug #83439 templatize Item_create
Submitted: 19 Oct 2016 7:18 Modified: 20 Oct 2016 15:00
Reporter: Martin Hansson Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[19 Oct 2016 7:18] Martin Hansson
Description:
This is a refactoring.

Every SQL function has corresponding Item_func and Item_create classes. The purpose of the latter is to instantiate the former when the function is resolved against its arguments. Currently a developer adding a new function has to create a new class and a singleton instance of it, about 12 lines of code in the best case. This refactoring introduces a macro that achieves the same in one line:

DECLARE_UNARY_FUNCTION_FACTORY(found_rows).

This patch deals with zero-argument functions. Patches will follow for one-argument, two-argument functions etc.

How to repeat:
Problems arise when adding or removing a function.
[20 Oct 2016 15:00] Paul DuBois
Posted by developer:
 
Fixed in 8.0.1.

Code cleanup. No changelog entry needed.