1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00
Files
mariadb/include
Alexander Barkov c17a06abf8 MDEV-15310 Range optimizer does not work well for "WHERE temporal_column NOT IN (const_list)"
There were two problems related to the bug report:
1. Item_datetime::get_date() was not implemented.
   So execution went through val_int() followed
   by int-to-datetime or int-to-time conversion.
   This was the reason why the optimizer did not
   work well on data with fractional seconds.
2. Item_datetime::set() did not have a TIME specific code
   to mix months and days to hours after unpack_time().
   This is why the optimizer did not work well with negative
   TIME values, as well as huge time values.

Changes:

1. Overriding Item_datetime::get_date(), to return ltime.
   This fixes the problem N1.
2. Cleanup: Moving pack_time() and unpack_time() from
   sql-common/my_time.c and include/my_time.h to
   sql/sql_time.cc and sql/sql_time.h, as they are not needed
   on the client side.
3. Adding a new "enum_mysql_timestamp_type ts_type" parameter
   to unpack_time() and moving the TIME specific code to mix
   months and days with hours inside unpack_time().
   Adding a new "ts_type" parameter to Item_datetime::set(),
   to pass it from the caller down to unpack_time().
   So now the TIME specific code is automatically called
   from Item_datetime::set(). This fixes the problem N2.
   This change also helped to get rid of duplicate TIME specific code
   from other three places, where mixing month/days to hours
   was done immediately after unpack_time().
   Moving the DATE specific code to zero hhmmssff
   from Item_func_min_max::get_date_native to inside unpack_time(),
   for symmetry.
4. Removing the virtual method in_vector::result_type(),
   adding in_vector::type_handler() instead.
   This helps to get result_type(), field_type(),
   mysql_timestamp_type() of an in_vector easier.
   Passing type_handler()->mysql_timestamp_type() as
   a new parameter to Item_datetime::set() inside
   in_temporal::value_to_item().
5. Cleaup: Removing separate implementations of in_datetime::get_value()
   and in_time::get_value(). Adding a single implementation
   in_temporal::get_value() instead.
   Passing type_handler()->field_type() to get_value_internal().
2018-02-14 22:58:34 +04:00
..
2017-12-08 13:44:45 +02:00
2013-03-26 00:03:13 +02:00
2016-09-02 13:22:28 +03:00
2014-06-06 00:07:27 +02:00
2014-03-15 18:24:15 +01:00
2014-03-26 22:25:38 +01:00
2017-12-08 13:44:45 +02:00
2013-03-26 00:03:13 +02:00
2017-03-31 19:22:20 +02:00
2014-03-16 13:59:44 +01:00
2018-01-30 20:47:12 +02:00
2013-03-26 00:03:13 +02:00
2015-01-21 12:03:02 +01:00
2018-02-06 14:51:44 +01:00
2016-03-23 22:36:46 +01:00
2018-01-14 20:50:45 +04:00
2017-03-10 18:21:29 +01:00
2017-07-06 10:39:21 +04:00
2015-04-05 13:14:37 +02:00
2017-05-06 14:36:46 +03:00
2017-03-10 18:21:29 +01:00
2016-06-21 14:11:02 +02:00
2017-03-30 12:48:42 +02:00
2013-07-18 16:46:57 +02:00
2017-03-30 12:48:42 +02:00
2014-03-16 21:03:01 +01:00
2017-03-07 19:07:27 +02:00
2014-10-10 22:27:36 +02:00
2017-03-10 18:21:29 +01:00
2017-03-10 18:21:29 +01:00