Evgeny Potemkin
b5f40f3454
Bug#50539: Wrong result when loose index scan is used for an aggregate
...
function with distinct.
Loose index scan is used to find MIN/MAX values using appropriate index and
thus allow to avoid grouping. For each found row it updates non-aggregated
fields with values from row with found MIN/MAX value.
Without loose index scan non-aggregated fields are copied by end_send_group
function. With loose index scan there is no need in end_send_group and
end_send is used instead. Non-aggregated fields still need to be copied and
this was wrongly implemented in QUICK_GROUP_MIN_MAX_SELECT::get_next.
WL#3220 added a case when loose index scan can be used with end_send_group to
optimize calculation of aggregate functions with distinct. In this case
the row found by QUICK_GROUP_MIN_MAX_SELECT::get_next might belong to a next
group and copying it will produce wrong result.
Update of non-aggregated fields is moved to the end_send function from
QUICK_GROUP_MIN_MAX_SELECT::get_next.
2010-02-12 11:51:52 +03:00
..
2009-06-17 15:54:01 +02:00
2010-02-11 18:25:34 +01:00
2009-10-15 17:23:43 +05:00
2009-10-22 23:30:28 +01:00
2009-09-23 23:32:31 +02:00
2009-11-02 21:05:42 +01:00
2009-09-23 23:32:31 +02:00
2009-10-30 19:13:58 +01:00
2009-09-29 17:38:40 +02:00
2009-10-15 17:23:43 +05:00
2010-01-24 00:09:23 +03:00
2008-05-09 09:43:02 +02:00
2010-01-22 17:38:21 +08:00
2009-02-13 11:41:47 -05:00
2008-11-10 21:21:49 +01:00
2008-05-09 09:43:02 +02:00
2010-02-03 17:01:48 +03:00
2010-02-03 17:01:48 +03:00
2009-06-17 15:54:01 +02:00
2009-12-25 13:56:50 +03:00
2010-01-30 22:13:36 +03:00
2010-01-30 22:13:36 +03:00
2009-02-13 11:41:47 -05:00
2009-06-09 18:11:21 +02:00
2009-09-23 23:32:31 +02:00
2009-11-10 10:31:33 +03:00
2009-09-23 23:32:31 +02:00
2008-03-29 09:52:16 +02:00
2009-09-23 23:32:31 +02:00
2009-09-23 23:32:31 +02:00
2009-11-10 10:31:33 +03:00
2009-10-22 23:30:28 +01:00
2010-01-24 00:09:23 +03:00
2009-12-25 13:56:50 +03:00
2009-12-03 23:46:06 +03:00
2009-11-06 12:37:00 +03:00
2009-10-14 20:37:38 +04:00
2009-10-14 20:37:38 +04:00
2008-04-03 13:14:57 -04:00
2010-01-13 12:28:42 +02:00
2010-01-13 12:28:42 +02:00
2010-01-15 14:26:53 +03:00
2009-12-25 13:56:50 +03:00
2009-12-25 13:56:50 +03:00
2009-11-24 18:26:13 +03:00
2009-09-23 23:32:31 +02:00
2008-02-22 13:30:33 +03:00
2009-09-23 23:32:31 +02:00
2010-01-30 22:13:36 +03:00
2010-01-30 22:13:36 +03:00
2009-12-11 12:39:38 +03:00
2009-12-11 12:39:38 +03:00
2009-12-11 12:39:38 +03:00
2009-12-11 12:39:38 +03:00
2009-12-11 19:40:58 +03:00
2009-12-19 11:33:33 +03:00
2009-11-06 22:34:25 +03:00
2009-09-23 23:32:31 +02:00
2010-01-24 00:09:23 +03:00
2010-01-15 14:26:53 +03:00
2009-10-15 17:23:43 +05:00
2009-10-29 18:04:23 +01:00
2009-10-14 20:37:38 +04:00
2010-01-30 21:47:11 +03:00
2010-02-12 12:04:57 +08:00
2010-01-30 22:13:36 +03:00
2010-01-30 21:47:11 +03:00
2009-12-11 19:40:58 +03:00
2009-11-05 15:08:37 +03:00
2009-09-23 23:32:31 +02:00
2008-10-23 15:28:53 +02:00
2008-10-23 15:28:53 +02:00
2008-10-23 15:28:53 +02:00
2009-09-10 03:18:29 -06:00
2009-11-02 09:21:39 -02:00
2010-01-30 22:13:36 +03:00
2009-10-06 13:04:51 +02:00
2009-09-23 23:32:31 +02:00
2010-02-03 19:28:40 +03:00
2009-11-02 14:10:04 +03:00
2008-11-22 01:10:38 +01:00
2009-09-23 23:32:31 +02:00
2010-02-12 11:51:52 +03:00
2009-09-28 10:21:25 +03:00
2009-10-28 11:07:30 +01:00
2009-06-19 13:24:43 +05:00
2009-04-13 18:09:10 +05:00
2009-10-28 18:32:48 +01:00
2009-12-17 18:39:10 +01:00
2009-12-17 18:39:10 +01:00
2009-06-01 16:00:38 +04:00
2009-10-28 10:55:44 +03:00
2009-12-15 23:47:04 +01:00
2009-10-28 10:55:44 +03:00
2009-11-06 19:13:33 +03:00
2009-11-06 19:13:33 +03:00
2010-02-03 16:56:17 +00:00
2009-09-23 23:32:31 +02:00
2009-11-02 21:05:42 +01:00
2008-12-29 17:04:10 +01:00
2009-10-14 20:37:38 +04:00
2010-01-31 03:14:29 +08:00
2009-09-26 12:49:49 +08:00
2010-01-28 19:51:40 -02:00
2009-10-14 15:14:58 +04:00
2010-02-03 16:56:17 +00:00
2010-02-03 16:56:17 +00:00
2010-01-28 19:51:40 -02:00
2009-10-22 01:15:45 +01:00
2009-06-16 16:04:30 +01:00
2009-06-16 16:04:30 +01:00
2010-02-03 16:56:17 +00:00
2009-12-16 16:47:07 +03:00
2009-12-11 12:39:38 +03:00
2009-10-14 20:37:38 +04:00
2008-06-30 22:11:18 +02:00
2010-01-05 14:25:29 +08:00
2009-09-23 23:32:31 +02:00
2010-01-24 00:09:23 +03:00
2009-10-29 12:19:36 +01:00
2010-02-03 16:56:17 +00:00
2009-11-12 17:10:19 +02:00
2009-12-11 12:39:38 +03:00
2008-07-03 23:41:22 +04:00
2010-01-30 21:47:11 +03:00
2009-11-20 16:18:01 +01:00
2009-09-10 03:18:29 -06:00
2009-12-18 16:44:24 -02:00
2009-12-11 12:39:38 +03:00
2009-09-10 03:18:29 -06:00
2010-01-30 21:47:11 +03:00
2009-11-20 16:18:01 +01:00
2009-08-28 18:21:54 +02:00
2009-06-17 16:56:44 +02:00
2010-02-03 17:01:48 +03:00
2009-12-11 12:39:38 +03:00
2009-06-17 16:56:44 +02:00
2009-09-23 23:32:31 +02:00
2009-09-23 23:32:31 +02:00
2010-01-30 21:47:11 +03:00
2009-10-22 23:30:28 +01:00
2009-12-11 12:39:38 +03:00
2009-12-11 12:39:38 +03:00
2009-12-11 12:39:38 +03:00
2010-01-30 21:47:11 +03:00
2009-12-23 16:42:05 +03:00
2009-12-04 13:36:58 -02:00
2009-12-11 19:40:58 +03:00
2009-11-06 18:28:25 +03:00
2010-01-30 22:13:36 +03:00
2010-01-30 21:47:11 +03:00
2009-09-10 03:18:29 -06:00
2009-10-23 15:22:21 +04:00
2009-10-15 17:23:43 +05:00
2009-11-02 14:10:04 +03:00
2009-10-22 00:02:06 +04:00
2010-01-30 21:47:11 +03:00
2009-11-03 12:37:02 +01:00
2010-02-03 17:01:48 +03:00
2009-10-22 00:02:06 +04:00
2009-10-22 23:31:06 +04:00
2010-01-30 21:47:11 +03:00
2009-11-06 12:52:45 +03:00
2008-12-04 19:41:53 +01:00
2009-09-23 23:32:31 +02:00
2010-01-30 22:13:36 +03:00
2010-01-30 21:47:11 +03:00
2009-12-16 16:47:07 +03:00
2009-11-02 21:05:42 +01:00
2010-02-05 15:02:03 +03:00
2009-11-02 21:05:42 +01:00
2010-01-24 00:09:23 +03:00
2009-10-22 00:02:06 +04:00
2009-10-22 00:02:06 +04:00
2009-10-09 15:59:25 +02:00
2010-01-24 15:03:23 +08:00
2010-02-05 15:02:03 +03:00
2009-09-23 23:32:31 +02:00
2010-02-12 11:51:52 +03:00
2010-01-24 00:09:23 +03:00
2010-01-15 14:26:53 +03:00
2009-09-23 23:32:31 +02:00
2010-02-03 20:22:58 +03:00
2008-11-10 21:21:49 +01:00
2009-09-10 03:18:29 -06:00
2009-09-10 03:18:29 -06:00
2009-09-23 23:32:31 +02:00
2009-09-30 10:09:28 +05:00
2009-10-28 10:55:44 +03:00
2010-02-11 18:25:34 +01:00
2010-01-30 21:47:11 +03:00
2010-01-30 22:13:36 +03:00
2010-01-30 21:47:11 +03:00
2009-09-23 23:32:31 +02:00
2010-01-30 21:47:11 +03:00
2009-09-23 23:32:31 +02:00
2009-12-22 17:52:15 +02:00
2010-01-30 21:47:11 +03:00
2010-01-30 21:47:11 +03:00
2009-09-23 23:32:31 +02:00
2010-02-03 17:01:48 +03:00
2009-09-23 15:21:29 +02:00
2009-11-03 20:45:52 +03:00
2010-01-24 00:09:23 +03:00
2009-12-11 12:39:38 +03:00
2009-09-10 03:18:29 -06:00
2009-11-06 17:20:27 +03:00
2009-09-23 23:32:31 +02:00
2009-10-14 20:37:38 +04:00
2009-09-23 23:32:31 +02:00
2009-10-14 12:25:39 +04:00
2009-06-17 16:56:44 +02:00
2009-10-15 15:17:32 +05:00
2010-02-10 10:47:14 +01:00