Alexander Barkov
aef530bb69
MDEV-15340 Wrong result HOUR(case_expression_with_time_and_datetime)
...
The problem was that Item_func_hybrid_field_type::get_date() did not
convert the result to the correct data type, so MYSQL_TIME::time_type
of the get_date() result could be not in sync with field_type().
Changes:
1. Adding two new classes Datetime and Date to store MYSQL_TIMESTAMP_DATETIME
and MYSQL_TIMESTAMP_DATE values respectively
(in addition to earlier added class Time, for MYSQL_TIMESTAMP_TIME values).
2. Adding Item_func_hybrid_field_type::time_op().
It performs the operation using TIME representation,
and always returns a MYSQL_TIME value with time_type=MYSQL_TIMESTAMP_TIME.
Implementing time_op() for all affected children classes.
3. Fixing all implementations of date_op() to perform the operation
using strictly DATETIME representation. Now they always return a MYSQL_TIME
value with time_type=MYSQL_TIMESTAMP_{DATE|DATETIME},
according to the result data type.
4. Removing assignment of ltime.time_type to mysql_timestamp_type()
from all val_xxx_from_date_op(), because now date_op() makes sure
to return a proper MYSQL_TIME value with a good time_type (and other member)
5. Adding Item_func_hybrid_field_type::val_xxx_from_time_op().
6. Overriding Type_handler_time_common::Item_func_hybrid_field_type_val_xxx()
to call val_xxx_from_time_op() instead of val_xxx_from_date_op().
7. Modified Item_func::get_arg0_date() to return strictly a TIME value
if TIME_TIME_ONLY is passed, or return strictly a DATETIME value otherwise.
If args[0] returned a value of a different temporal type,
(for example a TIME value when TIME_TIME_ONLY was not passed,
or a DATETIME value when TIME_TIME_ONLY was passed), the conversion
is automatically applied.
Earlier, get_arg0_date() did not guarantee a result in
accordance to TIME_TIME_ONLY flag.
2018-02-19 23:41:01 +04:00
..
2017-07-20 20:13:28 +02:00
2018-02-12 17:17:26 +02:00
2017-07-12 22:54:49 +04:00
2017-08-14 11:12:17 +04:00
2017-06-23 09:16:27 +02:00
2017-12-18 01:55:40 +04:00
2017-10-30 09:26:38 +04:00
2017-10-30 16:42:46 +04:00
2017-11-13 21:58:00 +04:00
2017-09-18 10:12:23 +02:00
2017-07-05 17:15:59 +02:00
2017-12-12 13:27:16 +02:00
2018-01-24 12:11:29 +04:00
2017-08-09 18:09:04 +05:30
2017-12-29 13:35:41 +02:00
2017-04-23 12:57:26 +04:00
2017-12-12 13:27:16 +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-09 12:48:23 +02:00
2018-02-09 12:48:23 +02:00
2017-09-17 11:05:33 +03:00
2017-05-20 16:29:11 +04:00
2017-09-17 11:05:33 +03:00
2017-05-11 19:39:49 +04:00
2017-09-17 14:03:51 +03:00
2017-09-17 11:05:33 +03:00
2017-09-17 11:05:33 +03:00
2017-09-17 11:05:33 +03:00
2017-10-24 14:53:18 +02:00
2017-12-08 16:00:10 +02:00
2017-05-11 19:39:49 +04:00
2017-12-08 13:19:19 +04:00
2017-09-17 11:05:33 +03:00
2017-05-11 19:39:49 +04:00
2017-07-05 17:15:59 +02:00
2017-05-11 19:39:49 +04:00
2017-12-08 13:19:19 +04:00
2017-10-30 16:42:46 +04:00
2017-09-17 11:05:33 +03:00
2017-12-08 13:19:19 +04:00
2017-12-14 09:53:19 +02:00
2017-09-17 11:05:33 +03:00
2017-09-17 11:05:33 +03:00
2017-09-17 11:05:33 +03:00
2017-12-08 13:19:19 +04:00
2017-12-14 08:40:01 +02:00
2017-12-08 13:19:19 +04: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
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-11-06 12:56:56 +00:00
2018-01-11 18:00:31 +02:00
2017-07-04 15:31:25 +04:00
2018-02-08 19:06:25 +04:00
2017-06-23 09:16:27 +02:00
2017-12-12 13:27:16 +02: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-11-03 09:27:53 +04:00
2017-05-09 13:24:52 +02:00
2017-11-13 09:41:29 +01:00
2018-01-01 19:39:59 +02:00
2017-06-02 13:52:47 +03:00
2017-06-02 13:52:47 +03:00
2018-02-12 17:17:26 +02:00
2018-02-08 19:06:25 +04:00
2017-05-11 19:39:49 +04:00
2018-01-30 11:35:27 +04:00
2017-07-05 19:08:55 +02:00
2017-09-22 12:45:34 +04:00
2017-05-29 10:29:46 +04:00
2017-06-19 16:56:13 +03:00
2017-11-29 10:03:51 +04:00
2018-02-19 23:41:01 +04:00
2017-10-01 00:30:58 +04:00
2018-02-06 14:50:50 +01:00
2018-01-01 19:39:59 +02:00
2017-09-20 17:47:49 +03:00
2018-01-01 19:39:59 +02:00
2017-08-14 11:12:17 +04: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-08-14 11:12:17 +04:00
2018-02-19 23:41:01 +04:00
2017-04-24 12:09:25 +04:00
2017-12-12 13:27:16 +02:00
2017-10-18 14:11:55 +04:00
2017-07-20 20:13:28 +02:00
2017-08-14 11:12:17 +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-11-29 10:03:51 +04:00
2017-12-12 13:27:16 +02:00
2018-01-01 19:39:59 +02:00
2017-06-23 09:16:27 +02:00
2017-04-27 19:12:38 +02:00
2018-01-01 19:39:59 +02:00
2017-08-16 18:44:17 +02:00
2017-07-05 17:15:59 +02:00
2017-07-05 17:15:59 +02:00
2017-07-05 17:15:59 +02:00
2018-02-12 17:17:26 +02:00
2017-06-08 12:45:08 +03:00
2017-05-09 13:24:52 +02:00
2017-06-02 13:52:47 +03: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
2018-01-01 19:39:59 +02:00
2018-01-01 19:39:59 +02:00
2017-07-07 12:43:10 +04:00
2017-04-30 14:58:11 +02:00
2017-04-05 15:02:56 +04:00
2017-05-24 15:43:09 +04:00
2017-06-15 15:27:11 +04: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
2017-09-19 12:43:02 +03:00
2017-08-15 14:13:42 +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-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-05-17 00:00:27 +03:00
2017-05-17 00:00:27 +03:00
2017-10-03 20:23:33 +02:00
2017-10-03 20:23:34 +02:00
2017-08-01 09:52:59 +02:00
2017-05-09 13:24:52 +02:00
2018-02-06 14:50:50 +01:00
2018-02-12 17:17:26 +02: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
2017-12-29 13:35:41 +02:00
2017-12-29 13:35:41 +02:00
2017-09-28 18:42:14 +04:00
2017-11-05 22:23:31 +02:00
2018-02-06 14:50:50 +01:00
2018-02-12 17:17:26 +02:00
2017-07-05 19:08:55 +02:00
2017-05-04 11:38:55 +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-08-08 09:56:38 +02:00
2017-11-10 14:01:29 -08: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
2017-07-05 17:15:59 +02:00
2017-07-05 17:15:59 +02:00
2017-07-07 12:43:10 +04:00
2017-10-24 14:53:18 +02:00
2017-07-05 17:15:59 +02:00
2017-07-05 17:15:59 +02:00
2017-07-05 17:15:59 +02:00
2017-07-05 17:15:59 +02:00
2017-07-07 12:43:10 +04:00
2017-07-05 17:15:59 +02:00
2018-02-12 17:17:26 +02:00
2017-07-05 17:15:59 +02:00
2017-07-05 17:15:59 +02:00
2017-07-05 17:15:59 +02:00
2017-07-05 17:15:59 +02:00
2017-07-05 17:15:59 +02:00
2017-07-05 17:15:59 +02:00
2017-09-19 12:43:02 +03:00
2017-07-05 17:15:59 +02:00
2017-12-25 15:18:21 +01:00
2018-02-12 17:17:26 +02:00
2017-04-27 19:12:38 +02:00
2017-12-12 13:27:16 +02:00
2018-02-12 17:17:26 +02:00
2017-05-24 15:43:09 +04:00
2017-05-24 15:43:09 +04:00
2017-05-24 15:43:09 +04:00
2017-05-24 15:43:09 +04:00
2018-02-12 17:17:26 +02:00
2018-02-12 17:17:26 +02:00
2018-02-06 14:50:50 +01:00
2017-05-05 16:43:25 +02:00
2017-09-18 10:12:23 +02:00
2017-05-11 19:39:49 +04:00
2017-10-24 14:53:18 +02:00
2017-10-06 00:08:36 -07:00
2017-05-11 19:39:49 +04:00
2017-10-24 14:53:18 +02:00
2017-06-02 13:52:47 +03:00
2018-02-12 17:17:26 +02:00
2018-02-12 17:17:26 +02:00
2018-02-12 17:17:26 +02:00
2018-02-12 17:17:26 +02:00
2017-08-10 14:26:29 -07:00
2017-08-10 14:26:29 -07:00
2018-02-12 17:17:26 +02:00
2018-02-12 17:17:26 +02:00
2017-11-05 22:23:31 +02:00
2017-10-10 16:16:12 +03:00
2017-05-05 07:00:18 +04:00
2017-12-12 13:27:16 +02:00
2017-12-12 13:27:16 +02: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
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-12-12 13:27:16 +02:00
2017-11-16 14:33:28 +04:00
2017-12-12 13:27:16 +02: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-08-08 09:56:38 +02:00
2017-05-11 17:28:47 +03:00
2017-05-11 17:28:47 +03:00
2017-08-14 19:45:59 +02:00
2017-10-24 14:53:18 +02:00
2017-05-26 19:32:28 +04:00
2017-05-26 19:32:28 +04:00
2017-05-26 19:32:28 +04:00
2017-11-09 23:21:41 +02:00
2017-06-08 12:45:08 +03:00
2017-10-30 16:42:46 +04:00
2017-07-07 12:43:10 +04:00
2018-01-11 18:00:31 +02:00
2018-01-11 18:00:31 +02:00
2018-01-11 18:00:31 +02:00
2018-01-11 18:00:31 +02:00
2018-01-11 18:00:31 +02:00
2017-07-12 10:39:02 +02:00
2017-07-07 12:43:10 +04:00
2017-06-15 15:27:11 +04:00
2017-07-07 12:43:10 +04:00
2017-06-15 15:27:11 +04:00
2018-01-11 18:00:31 +02:00
2017-09-19 12:43:02 +03:00
2017-10-14 17:28:54 +04:00
2017-10-14 17:28:54 +04:00
2017-10-14 17:28:54 +04:00
2017-10-14 17:28:54 +04:00
2017-10-04 18:36:30 +02:00
2017-05-15 23:45:31 +04:00
2018-02-01 09:01:15 +00:00
2017-11-29 12:06:48 +04:00
2017-11-08 13:12:11 +02:00
2017-10-22 13:03:41 +02:00
2017-11-09 23:21:41 +02:00
2017-07-07 12:43:10 +04:00
2018-02-14 22:58:34 +04:00
2017-04-25 14:22:07 +04:00
2017-05-02 11:39:20 +04:00
2017-10-18 14:11:55 +04:00
2017-08-14 19:45:59 +02:00
2017-05-11 19:39:49 +04:00
2017-08-14 19:45:59 +02:00
2017-05-22 13:44:26 +04:00
2017-11-15 14:34:04 +04:00
2018-02-11 13:47:16 +01:00
2017-05-10 08:30:56 +04:00
2018-02-14 22:58:34 +04:00
2017-05-10 08:30:56 +04:00
2017-05-11 19:39:49 +04:00
2017-10-24 14:53:18 +02: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
2017-10-02 22:35:13 +04:00
2018-02-12 17:17:26 +02:00
2017-08-30 14:37:16 +00:00
2017-12-12 13:27:16 +02:00
2017-09-19 15:14:10 +03: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