This is a cleanup task to simplify future development of SQL function and operator overloading.
The only user visible side affect will be the change in error reporting in some cases, e.g.:
To implement easier overloading for SQL operators and functions for user defined data type arguments, we should:
- Gradually turn all Item_func descendants (for which we want overloading) into Item_handled_func
- Add infrastructure to search and choose best overload candidates. Overload candidates will be searched and chosen during fix_length_and_dec() time.
- The default implementation of Item_func::check_arguments(), which disallows ROW type arguments, should be removed for all Item_func_xxx classes that we want overloading for.
As a first step, let's cleanup Item_num_op and Item_func_min_max. Namely, let's do the following:
1. Move Type_handler_row into its own Type_collection_row (separate from Type_collection_std, which after this change will hold only scalar built-in types).
2. Overload Item_num_op::check_arguments() and Item_func_min_max::check_arguments() from the default implementation to:
Arguments for these classes are checked during aggregate_for_num_op() and aggregate_for_min_max(), which after change #1, will return an error for a combination of ROW and scalar arguments, e.g.:
and for two ROW arguments:
so the second test for ROW type arguments in check_arguments() won't be needed.
As an additional benefit:
- The virtual method Type_handler::is_traditional_type() will be removed
- A non-virtual method Type_handller::is_traditional_scalar_type() will be added, with this implementation