MariaDB server is a community developed fork of MySQL server. Started by core members of the original MySQL team, MariaDB actively works with outside developers to deliver the most featureful, stable, and sanely licensed open SQL server in the industry.
  • MariaDB\ 71.8%
  • C++ 16.4%
  • C 10.4%
  • Shell 0.5%
  • Perl 0.4%
  • Other 0.3%
Find a file
unknown b25315469e Fixed bug#15560: GROUP_CONCAT wasn't ready for WITH ROLLUP queries
The GROUP_CONCAT uses its own temporary table. When ROLLUP is present
it creates the second copy of Item_func_group_concat. This copy receives the
same list of arguments that original group_concat does. When the copy is
set up the result_fields of functions from the argument list are reset to the
temporary table of this copy.
As a result of this action data from functions flow directly to the ROLLUP copy
and the original group_concat functions shows wrong result.
Since queries with COUNT(DISTINCT ...) use temporary tables to store
the results the COUNT function they are also affected by this bug.

The idea of the fix is to copy content of the result_field for the function
under GROUP_CONCAT/COUNT from  the first temporary table to the second one,
rather than setting result_field to point to the second temporary table.
To achieve this goal force_copy_fields flag is added to Item_func_group_concat
and Item_sum_count_distinct classes. This flag is initialized to 0 and set to 1
into the make_unique() member function of both classes.
To the TMP_TABLE_PARAM structure is modified to include the similar flag as
well.
The create_tmp_table() function passes that flag to create_tmp_field().
When the flag is set the create_tmp_field() function will set result_field
as a source field and will not reset that result field to newly created 
field for Item_func_result_field and its descendants. Due to this there
will be created copy func to copy data from old result_field to newly 
created field.


mysql-test/t/func_gconcat.test:
  Added test for bug#15560: GROUP_CONCAT wasn't ready for WITH ROLLUP queries
mysql-test/r/func_gconcat.result:
  Added test for bug#15560: GROUP_CONCAT wasn't ready for WITH ROLLUP queries
sql/sql_table.cc:
  Fixed bug#15560: GROUP_CONCAT wasn't ready for WITH ROLLUP queries
  Added 0 as a last parameter to create_tmp_field()  to force old behaviour.
sql/sql_select.cc:
  Fixed bug#15560: GROUP_CONCAT wasn't ready for WITH ROLLUP queries
  
  Added the flag 'make_copy_field' to create_tmp_field(), so that for Item_result_field descendants create_tmp_field() sets the item's result field as a source field and deny resetting that result field to a new value.
sql/sql_class.h:
  Fixed bug#15560: GROUP_CONCAT wasn't ready for WITH ROLLUP queries
  Added the flag 'force_copy_fields' to the structure TMP_TABLE_PARAM in order to make create_tmp_field() force the creation of 'copy_field' objects.
sql/mysql_priv.h:
  Fixed bug#15560: GROUP_CONCAT wasn't ready for WITH ROLLUP queries
  Added the bool parameter 'make_copy_field' to create_tmp_field().
sql/item_sum.cc:
  Fixed bug#15560: GROUP_CONCAT wasn't ready for WITH ROLLUP queries
  Added initialization of the force_copy_fields flag and passing it to create_tmp_table() through TMP_TBLE_PARAM in the Item_func_group_concat and Item_sum_count_distinct member functions.
sql/item_sum.h:
  Fixed bug#15560: GROUP_CONCAT wasn't ready for WITH ROLLUP queries
  Added the flag 'force_copy_fields' to the Item_func_group_concat and Item_sum_count_distinct classes.
2006-03-29 23:30:34 +04:00
bdb
BitKeeper
BUILD
client Bug #15302 LOAD DATA FROM MASTER -> Packets out of order (Found: 2, expected 1) 2006-01-31 12:47:22 +01:00
cmd-line-utils
dbug
Docs
extra Merge mysql.com:/M40/push-4.0 into mysql.com:/M41/merge-4.1 2006-01-13 17:45:01 +01:00
heap
include Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-4.1 2006-01-27 09:29:59 -05:00
innobase Fixed BUG#15653, BUG#16582. 2006-01-30 22:33:02 +03:00
isam
libmysql fix for bug #12744 (MYSQL_STMT operations cause seg fault after connection reset) 2006-02-01 20:35:16 +01:00
libmysql_r
libmysqld
man
merge
myisam BUG#16489 - utf8 + fulltext leads to corrupt index file. 2006-01-23 17:15:33 +04:00
myisammrg
mysql-test Fixed bug#15560: GROUP_CONCAT wasn't ready for WITH ROLLUP queries 2006-03-29 23:30:34 +04:00
mysys Merge svlasenko@bk-internal.mysql.com:/home/bk/mysql-4.1 2006-02-13 17:29:35 +03:00
ndb Merge perch.ndb.mysql.com:/home/jonas/src/41-work 2006-02-10 09:42:35 +01:00
netware
os2
pstack
regex
scripts Merge mysql.com:/M40/push-4.0 into mysql.com:/M41/merge-4.1 2006-01-13 17:45:01 +01:00
sql Fixed bug#15560: GROUP_CONCAT wasn't ready for WITH ROLLUP queries 2006-03-29 23:30:34 +04:00
sql-bench
sql-common
SSL
strings Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1 2006-01-13 14:22:53 +04:00
support-files support-files/mysql.spec.sh : Use "-i" on "make test-force", essential for log file evaluation. 2006-02-10 17:40:04 +01:00
tests fix for bug #12744 (MYSQL_STMT operations cause seg fault after connection reset) 2006-02-01 20:35:16 +01:00
tools
VC++Files
vio
zlib
.bzrignore BUG#3074: Unversioned symbols in shared library 2006-01-17 18:51:08 +04:00
.cvsignore
acinclude.m4
config.guess
config.sub
configure.in configure.in: 2006-01-27 12:10:40 +01:00
COPYING
depcomp
install-sh
ltconfig
ltmain.sh
Makefile.am
missing
mkinstalldirs
README

This is a release of MySQL, a dual-license SQL database server.
MySQL is brought to you by the MySQL team at MySQL AB.

License information can be found in these files:
- For GPL (free) distributions, see the COPYING file.
- For commercial distributions, see the MySQLEULA.txt file.


For further information about MySQL or additional documentation, see:
- The latest information about MySQL: http://www.mysql.com
- The current MySQL documentation: http:/dev.mysql.com/doc

Some manual sections of special interest:

- If you are migrating from an older version of MySQL, please read the
  "Upgrading from..." section first!
- To see what MySQL can do, take a look at the features section.
- For installation instructions, see the Installation chapter.
- For future plans, see the TODO appendix.
- For the new features/bugfix history, see the News appendix.
- For the currently known bugs/misfeatures (known errors) see the problems
  appendix.
- For a list of developers and other contributors, see the Credits
  appendix.

A local copy of the MySQL Reference Manual can be found in the Docs
directory in GNU Info format.  You can also browse the manual online or
download it in any of several formats at the URL given earlier in this
file.

************************************************************

IMPORTANT:

Bug or error reports should be sent to http://bugs.mysql.com.