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-02-10 06:30:42 -05:00
2017-08-08 10:18:43 +02:00
2018-02-12 17:17:26 +02:00
2017-03-13 15:31:12 +01:00
2017-07-12 19:46:44 +05:30
2017-01-23 14:13:53 +11:00
2016-12-21 22:40:52 +02:00
2017-02-10 06:30:42 -05:00
2017-02-10 06:30:42 -05:00
2017-12-18 01:55:40 +04:00
2017-07-05 19:08:55 +02:00
2017-02-10 06:30:42 -05:00
2017-02-01 08:00:50 +04:00
2017-10-30 16:42:46 +04:00
2017-11-13 21:58:00 +04:00
2017-03-29 12:07:33 -07:00
2017-09-18 10:12:23 +02:00
2017-07-05 17:15:59 +02:00
2017-02-10 06:30:42 -05:00
2017-02-10 06:30:42 -05:00
2017-08-09 18:09:04 +05:30
2017-12-29 13:35:41 +02:00
2017-08-05 20:41:55 +03:00
2016-10-09 01:20:17 +02:00
2016-10-05 01:11:07 +03:00
2017-09-22 02:27:00 +02:00
2017-12-29 11:40:23 +04:00
2018-02-08 19:06:25 +04:00
2017-11-21 20:03:57 +01:00
2018-02-06 08:32:49 -08:00
2018-02-08 19:06:25 +04:00
2017-02-10 06:30:42 -05:00
2016-11-21 10:33:09 +00:00
2017-02-10 06:30:42 -05:00
2017-02-10 06:30:42 -05:00
2017-02-10 06:30:42 -05:00
2017-02-10 06:30:42 -05:00
2017-02-11 11:16:36 -05:00
2017-10-24 14:53:18 +02:00
2017-12-08 13:19:19 +04:00
2017-02-10 06:30:42 -05:00
2017-12-08 13:19:19 +04:00
2017-02-10 06:30:42 -05:00
2017-02-10 06:30:42 -05:00
2017-02-10 06:30:42 -05:00
2017-02-10 06:30:42 -05:00
2017-01-06 17:09:59 +02:00
2017-01-06 17:09:59 +02:00
2017-12-08 13:19:19 +04:00
2017-10-24 14:53:18 +02:00
2017-02-10 06:30:42 -05:00
2017-02-10 06:30:42 -05:00
2017-03-21 11:37:24 +01:00
2017-12-08 13:19:19 +04:00
2017-12-14 09:53:19 +02:00
2017-12-08 13:19:19 +04:00
2017-12-14 08:40:01 +02:00
2017-01-06 17:09:59 +02:00
2017-12-08 13:19:19 +04:00
2017-02-10 17:01:45 +01:00
2017-02-10 06:30:42 -05:00
2017-12-08 13:19:19 +04:00
2017-10-24 14:53:18 +02:00
2017-09-18 10:12:23 +02:00
2016-12-21 13:18:45 +04:00
2017-02-21 20:31:06 +01:00
2017-09-14 08:09:44 +03:00
2017-10-23 15:35:10 -07:00
2017-08-25 14:04:51 +02:00
2017-02-10 06:30:42 -05:00
2017-11-06 12:56:56 +00:00
2017-11-07 13:31:55 +00:00
2018-01-11 18:00:31 +02:00
2017-05-23 11:09:47 +03:00
2018-02-06 14:50:50 +01:00
2017-03-10 18:21:24 +01:00
2017-04-07 18:22:06 +04:00
2018-02-08 13:53:21 +02:00
2017-10-14 17:28:54 +04:00
2017-08-01 09:52:57 +02:00
2017-03-31 15:18:28 +04:00
2017-11-03 09:27:53 +04:00
2017-04-28 20:19:32 +02:00
2016-12-17 00:16:15 +01:00
2017-11-13 09:41:29 +01:00
2017-01-23 14:13:53 +11:00
2017-12-30 10:18:22 +05:30
2017-02-10 06:30:42 -05:00
2016-10-05 01:11:07 +03:00
2017-02-10 06:30:42 -05:00
2018-02-12 17:17:26 +02:00
2016-12-03 22:03:38 +01:00
2018-02-06 14:50:50 +01:00
2016-12-29 13:23:18 +01:00
2018-01-30 11:35:27 +04:00
2017-07-05 19:08:55 +02:00
2016-12-20 00:42:46 -08:00
2016-12-17 23:35:12 +04:00
2016-12-29 13:23:18 +01:00
2017-05-29 10:29:46 +04:00
2017-06-19 16:56:13 +03:00
2017-06-19 10:44:13 +04:00
2017-10-30 16:42:46 +04:00
2017-10-01 00:30:58 +04:00
2018-01-15 11:19:14 -08:00
2018-01-01 19:39:59 +02:00
2017-02-10 06:30:42 -05:00
2017-09-20 17:47:49 +03:00
2018-01-01 19:39:59 +02:00
2017-10-24 14:53:18 +02:00
2017-10-01 00:30:58 +04:00
2017-12-22 12:23:39 +02:00
2017-12-14 09:53:19 +02:00
2017-10-30 16:42:46 +04:00
2016-12-12 20:27:22 +01:00
2017-05-29 15:46:29 +04:00
2017-10-18 14:11:55 +04:00
2017-07-20 20:13:28 +02:00
2017-04-13 06:50:00 +04:00
2017-11-14 13:36:50 +04:00
2017-10-18 14:11:55 +04:00
2017-07-11 23:27:19 +04:00
2018-01-05 16:52:40 +02:00
2017-10-01 00:30:58 +04:00
2017-03-30 12:48:42 +02:00
2016-12-11 09:53:42 +01:00
2017-12-22 12:23:39 +02:00
2017-12-22 12:23:39 +02:00
2017-02-10 06:30:42 -05:00
2017-02-10 17:01:45 +01:00
2016-12-29 13:23:49 +01:00
2016-12-20 17:42:08 +04:00
2018-02-12 17:17:26 +02:00
2017-06-08 12:45:08 +03:00
2017-02-10 06:30:42 -05:00
2016-12-21 13:18:45 +04:00
2017-02-10 06:30:42 -05:00
2017-01-17 20:16:09 +01:00
2017-09-22 02:27:00 +02:00
2017-11-13 10:02:59 +01:00
2018-02-06 14:50:50 +01:00
2017-02-24 09:40:53 -08:00
2017-02-10 06:30:42 -05:00
2017-12-20 13:30:05 +02:00
2017-02-10 06:30:42 -05:00
2017-04-30 14:58:11 +02:00
2017-04-05 15:02:56 +04:00
2017-05-08 11:08:18 +02:00
2017-05-09 13:24:52 +02:00
2017-12-13 13:22:45 +04:00
2017-09-23 20:22:46 +02:00
2016-12-21 13:18:45 +04:00
2017-01-04 03:33:39 +02:00
2017-02-10 06:30:42 -05:00
2017-03-21 11:37:24 +01:00
2017-06-03 02:48:47 +03:00
2017-08-15 20:10:04 +03:00
2017-03-07 22:28:33 +04:00
2017-03-07 22:28:33 +04:00
2017-03-07 22:28:33 +04:00
2017-10-03 20:23:34 +02:00
2017-10-23 15:33:13 -07:00
2018-01-23 17:29:58 +05:30
2017-04-01 19:32:36 +02:00
2017-06-19 16:46:34 +03:00
2017-07-05 17:15:57 +02:00
2018-02-12 17:17:26 +02:00
2017-05-24 15:43:09 +04:00
2017-02-10 06:30:42 -05:00
2017-02-10 06:30:42 -05:00
2017-10-03 20:23:33 +02:00
2016-12-29 13:23:49 +01:00
2017-10-03 20:23:34 +02:00
2017-05-22 09:46:51 +03:00
2017-02-10 06:30:42 -05:00
2018-01-25 14:03:24 +01:00
2017-02-10 06:30:42 -05:00
2017-02-10 06:30:42 -05:00
2018-02-12 17:17:26 +02:00
2016-10-05 01:11:07 +03:00
2016-10-14 01:12:04 +02:00
2017-03-21 11:37:24 +01:00
2017-03-21 11:37:24 +01:00
2017-03-21 11:37:24 +01:00
2017-08-17 11:38:34 +02:00
2017-06-30 13:28:39 +02:00
2017-12-29 13:35:41 +02:00
2016-11-03 13:37:15 +01:00
2016-11-03 13:37:15 +01:00
2017-11-10 01:14:58 +01:00
2017-08-17 11:38:34 +02:00
2018-01-24 09:35:07 +01:00
2017-05-09 13:24:52 +02:00
2017-02-10 06:30:42 -05:00
2017-07-05 19:08:55 +02:00
2017-03-31 19:28:58 +02:00
2017-02-14 07:46:58 +02:00
2017-02-10 06:30:42 -05:00
2017-04-24 12:09:25 +04:00
2017-05-27 16:45:22 +04:00
2017-09-22 13:58:00 +02:00
2018-01-02 02:03:12 +02:00
2017-08-08 09:56:38 +02:00
2017-11-10 14:01:29 -08:00
2017-02-10 06:30:42 -05:00
2017-02-14 07:46:58 +02:00
2018-02-06 14:50:50 +01:00
2017-04-05 15:02:38 +04:00
2017-07-05 19:08:55 +02:00
2016-12-12 20:35:41 +01:00
2017-03-10 18:21:24 +01:00
2017-10-24 14:53:18 +02:00
2016-11-03 16:35:15 +04:00
2017-04-07 18:26:55 +02:00
2017-02-10 06:30:42 -05:00
2017-02-10 06:30:42 -05:00
2018-02-02 16:15:13 +02:00
2017-02-08 10:22:42 +01:00
2017-03-03 01:37:54 +02:00
2017-09-18 10:40:26 +02:00
2018-02-08 19:06:25 +04:00
2017-03-30 12:48:42 +02:00
2017-04-07 09:55:54 +02:00
2017-01-04 13:03:30 +02:00
2017-01-04 13:03:30 +02:00
2016-12-29 13:23:49 +01:00
2018-02-12 17:17:26 +02:00
2018-01-23 17:43:12 +04:00
2018-02-06 14:50:50 +01:00
2017-05-05 16:43:25 +02:00
2017-03-15 20:15:31 +05:30
2017-09-18 10:12:23 +02:00
2017-10-06 00:08:36 -07:00
2017-04-03 15:59:38 -07:00
2017-10-24 14:53:18 +02:00
2017-03-11 16:23:31 +01:00
2018-01-25 14:03:24 +01:00
2017-02-10 06:30:42 -05:00
2017-02-10 06:30:42 -05:00
2017-02-13 18:12:05 +01:00
2016-12-29 13:23:49 +01:00
2018-02-12 17:17:26 +02:00
2016-12-14 12:45:50 +05:30
2016-12-11 09:53:42 +01:00
2017-02-10 06:30:42 -05:00
2017-02-10 06:30:42 -05:00
2017-01-24 17:29:51 +04:00
2018-02-12 17:17:26 +02:00
2017-11-09 23:21:41 +02:00
2016-11-21 02:32:48 +03:00
2017-10-10 16:16:12 +03:00
2017-03-31 19:28:58 +02:00
2017-02-10 06:30:42 -05:00
2016-09-28 17:59:11 +02:00
2017-02-10 06:30:42 -05:00
2017-10-27 20:48:16 +04:00
2017-10-27 20:48:16 +04:00
2017-10-27 20:48:16 +04:00
2016-12-16 17:31:40 +04:00
2017-11-16 14:33:28 +04:00
2017-11-16 14:33:28 +04:00
2017-08-14 19:45:59 +02:00
2017-02-10 06:30:42 -05:00
2017-02-10 06:30:42 -05:00
2017-11-16 14:33:28 +04:00
2017-01-06 10:46:21 +01:00
2017-04-05 15:02:56 +04:00
2017-12-07 15:54:27 +04:00
2017-04-07 13:40:27 +04:00
2017-07-28 12:30:30 +04:00
2017-05-25 14:12:18 +04:00
2018-02-08 19:06:25 +04:00
2017-10-14 17:28:54 +04:00
2017-05-09 18:53:10 +02:00
2017-04-27 19:12:44 +02:00
2017-05-09 18:53:10 +02:00
2016-10-06 12:31:23 +02:00
2017-08-08 09:56:38 +02:00
2017-05-11 17:28:47 +03:00
2017-09-20 18:17:50 +02:00
2017-08-14 19:45:59 +02:00
2016-12-21 13:18:45 +04:00
2017-02-10 06:30:42 -05:00
2017-02-11 09:45:34 +01:00
2017-03-21 19:20:44 +01:00
2017-01-23 14:13:53 +11:00
2017-11-09 09:31:03 +01:00
2017-05-29 00:27:14 -07:00
2017-10-13 07:24:54 -07:00
2017-07-12 10:39:02 +02:00
2017-06-07 22:54:57 -07:00
2017-01-24 01:21:43 +05:30
2017-07-05 19:08:55 +02:00
2017-05-23 08:59:03 +03:00
2018-01-11 18:00:31 +02:00
2017-02-27 12:35:10 +01:00
2017-03-14 00:25:26 +02:00
2017-09-18 10:40:26 +02:00
2017-02-10 06:30:42 -05:00
2017-03-09 08:53:08 +02:00
2017-10-04 18:36:30 +02:00
2016-11-21 17:14:14 -05:00
2018-02-01 09:01:15 +00:00
2017-03-30 12:48:42 +02:00
2016-10-05 01:11:07 +03:00
2017-01-15 07:41:13 +01:00
2016-10-05 01:11:07 +03:00
2016-10-05 01:11:07 +03:00
2017-11-29 12:06:48 +04:00
2016-11-03 16:35:15 +04:00
2017-06-02 13:52:47 +03:00
2017-02-10 06:30:42 -05:00
2017-02-10 06:30:42 -05:00
2017-11-08 13:12:11 +02:00
2017-02-10 06:30:42 -05:00
2017-11-09 23:21:41 +02:00
2018-02-14 22:58:34 +04:00
2017-04-24 16:08:28 +04:00
2017-05-02 11:39:20 +04:00
2017-10-06 13:29:29 +04:00
2017-08-14 19:45:59 +02:00
2017-03-30 12:48:42 +02:00
2017-08-14 19:45:59 +02:00
2017-02-10 06:30:42 -05:00
2017-11-15 14:34:04 +04:00
2017-02-10 06:30:42 -05:00
2018-02-09 19:47:00 +04:00
2018-02-14 22:58:34 +04:00
2017-04-25 11:05:41 +04:00
2017-02-10 06:30:42 -05:00
2017-10-24 14:53:18 +02:00
2017-02-10 06:30:42 -05:00
2017-04-07 18:09:56 +04:00
2017-04-07 18:09:56 +04:00
2018-02-08 19:06:25 +04:00
2018-02-02 10:09:44 +01:00
2017-10-03 20:23:34 +02:00
2017-10-02 22:35:13 +04:00
2016-09-28 22:14:27 +02:00
2017-04-05 15:02:56 +04:00
2018-02-12 17:17:26 +02:00
2017-08-30 14:37:16 +00:00
2017-02-10 06:30:42 -05:00
2017-09-19 15:14:10 +03:00
2017-02-15 14:09:27 +02:00
2017-02-15 14:09:27 +02:00
2016-09-24 15:12:34 +02:00
2017-05-27 16:39:20 +04:00
2017-09-19 15:14:10 +03:00
2018-01-23 17:43:12 +04:00
2018-02-08 19:06:25 +04:00
2018-02-06 14:50:50 +01:00
2017-02-10 06:30:42 -05:00