Skip to content

Commit

Permalink
MDEV-11503 Introduce Type_handler::make_in_vector() and Item_func_in_…
Browse files Browse the repository at this point in the history
…fix_comparator_compatible_types()

This patch implements the task according to the description:

1. The old code from Item_func_in::fix_length_and_dec() was decomposed
into smaller methods:
- all_items_are_consts()
- compatible_types_scalar_bisection_possible()
- compatible_types_row_bisection_possible()
- fix_in_vector()
- fix_for_scalar_comparison_using_bisection()
- fix_for_scalar_comparison_using_cmp_items()
- fix_for_row_comparison_using_bisection()
- fix_for_row_comparison_using_cmp_items()

The data type dependend pieces where moved as methods to Type_handler.

2. Splits in_datetime into separate:
   - in_datetime, for DATETIME and DATE,
   - in_time, for TIME
   to make the code more symmetric across data types.

Additionally:
- Adds a test func_debug.test to see which calculation strategy
  (bisect or no bisect) is chosen to handle IN with various arguments.
- Adds a new helper method (to avoid duplicate code):
  cmp_item_rows::prepare_comparators()
- Changes the propotype for cmp_item_row::alloc_comparators(),
  to avoid duplicate code, and to use less current_thd.
- Changes "friend" sections in cmp_item_row and in_row from
  an exact Item_func_in method to the entire class Item_func_in,
  as their internals are now needed in multiple Item_func_in methods.
- Added more comments (e.g. on bisection, on the problem reported in MDEV-11511)
  • Loading branch information
Alexander Barkov committed Dec 16, 2016
1 parent 8b930b8 commit 93bc728
Show file tree
Hide file tree
Showing 6 changed files with 1,646 additions and 185 deletions.

0 comments on commit 93bc728

Please sign in to comment.