1
0
mirror of https://github.com/MariaDB/server.git synced 2025-04-28 06:45:23 +03:00
Georgi Kodinov d765e30a1d Bug #55188: GROUP BY, GROUP_CONCAT and TEXT - inconsistent results
In order to be able to check if the set of the grouping fields in a 
GROUP BY has changed (and thus to start a new group) the optimizer
caches the current values of these fields in a set of Cached_item 
derived objects.
The Cached_item_str, used for caching varchar and TEXT columns,
is limited in length by the max_sort_length variable.
A String buffer to store the value with an alloced length of either
the max length of the string or the value of max_sort_length 
(whichever is smaller) in Cached_item_str's constructor.
Then, at compare time the value of the string to compare to was 
truncated to the alloced length of the string buffer inside 
Cached_item_str.
This is all fine and valid, but only if you're not assigning 
values near or equal to the alloced length of this buffer.
Because when assigning values like this the alloced length is 
rounded up and as a result the next set of data will not match the
group buffer, thus leading to wrong results because of the changed
alloced_length.
Fixed by preserving the original maximum length in the 
Cached_item_str's constructor and using this instead of the 
alloced_length to limit the string to compare to.
Test case added.
2010-07-30 16:35:06 +03:00
..
2009-08-20 14:30:59 +02:00
2009-02-09 22:00:15 +01:00
2010-02-25 23:13:11 +04:00
2009-02-09 22:00:15 +01:00
2009-09-29 17:38:40 +02:00
2009-03-27 10:18:06 +08:00
2009-02-06 18:25:08 +01:00
2009-01-23 13:22:05 +01:00
2009-12-11 16:02:47 +02:00
2009-05-06 15:00:14 +05:30
2009-09-02 18:58:17 +02:00
2009-04-09 14:38:50 +05:00
2010-06-01 11:54:06 +04:00
2010-04-27 00:46:52 +04:00
2009-10-20 11:00:07 -07:00
2009-12-17 12:06:36 -08:00
2010-01-29 16:54:27 +02:00
2009-12-10 17:38:01 +02:00
2009-02-03 14:45:17 +01:00
2009-08-12 12:03:05 +02:00
2010-03-12 11:52:38 +01:00
2010-01-15 10:51:39 +02:00
2009-07-03 10:19:32 +02:00
2009-11-27 18:10:28 +02:00
2009-12-23 17:44:03 +04:00
2009-06-10 11:58:36 +03:00
2009-02-19 18:24:25 -05:00
2009-01-31 02:08:41 +01:00
2009-12-22 14:38:33 +04:00
2010-06-04 17:10:22 +03:00