[MDEV-13997] Change Item_bool_rowready_func2 to cache const items at fix time rather than evaluation time Created: 2017-10-04 Updated: 2017-10-30 Resolved: 2017-10-30 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data types, Temporal Types |
| Fix Version/s: | 10.3.3 |
| Type: | Task | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Sprint: | 10.3.3-1 | ||||||||||||
| Description |
|
Currently there is an asymmetry in how binary comparison operators (such as = or >, etc) are implemented for temporal vs other data types. Item_bool_rowready_func2 does not cache its constant arguments of temporal types at fix time. Instead, constant arguments are replaced to instances of Item_cache_temporal at evaluation time, when get_datetime_value() is executed for the first time. Non-temporal types do it in a different way: constant arguments are cached at fix time, while the evaluation time code does not do any argument substitution or caching. Substitution is done in Arg_comparator::set_cmp_func_(string|int|real|decimals)(), with these two lines:
Under terms of this task we will change the code for the temporal data types to cache constant arguments in fix time, using cache_converted_constant(), like it is done for the other data types. Caching during evaluation time will be removed. Rationale:
|