Commit graph

78 commits

Author SHA1 Message Date
gkodinov/kgeorge@macbook.gmz
9380bb837f Bug#16712: group_concat returns odd srting insead of intended result
when calculating GROUP_CONCAT all blob fields are transformed
  to varchar when making the temp table.
  However a varchar has at max 2 bytes for length. 
  This fix makes the conversion only for blobs whose max length 
  is below that limit. 
  Otherwise blob field is created by make_string_field() call.
2006-07-25 11:45:10 +03:00
igor@rurik.mysql.com
639e875032 Post merge fixes 2006-04-21 08:19:38 -07:00
evgen@moonbone.local
e347ec5cbe func_gconcat.result, func_gconcat.test:
Remove duplicate test case for bug#14169
2006-04-20 13:34:14 +04:00
igor@rurik.mysql.com
692da27388 Post merge fix 2006-04-20 00:42:12 -07:00
igor@rurik.mysql.com
27cc6f4bc3 Merge rurik.mysql.com:/home/igor/dev/mysql-4.1-2
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-0
2006-04-19 18:08:15 -07:00
igor@rurik.mysql.com
67458961cf Temporarily commented out a query from the test case for bug 14169 to make it pass with --ps-protocol. 2006-04-19 16:08:37 -07:00
evgen@moonbone.local
8b4eae6e4f func_gconcat.result:
Corrected test case for the bug#14169 to make it pass in --ps-protocol mode.
2006-04-20 00:27:43 +04:00
evgen@moonbone.local
ac54aa2aee Fixed bug#14169: type of group_concat() result changed to blob if tmp_table was
used

In a simple queries a result of the GROUP_CONCAT() function was always of 
varchar type.
But if length of GROUP_CONCAT() result is greater than 512 chars and temporary
table is used during select then the result is converted to blob, due to
policy to not to store fields longer than 512 chars in tmp table as varchar
fields.

In order to provide consistent behaviour, result of GROUP_CONCAT() now
will always be converted to blob if it is longer than 512 chars.
Item_func_group_concat::field_type() is modified accordingly.
2006-04-12 23:05:38 +04:00
gluh@eagle.intranet.mysql.r18.ru
4ef7e5b5f7 Fix for bug#18281 group_concat changes charset to binary
skip charset aggregation for order columns
2006-04-07 13:19:31 +05:00
evgen@sunlight.local
eb075f2255 Manual merge 2006-03-30 17:14:55 +04:00
evgen@moonbone.local
1c13e54890 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.
2006-03-29 23:30:34 +04:00
igor@rurik.mysql.com
7b1b69a6e7 Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-2
2005-11-22 23:00:57 -08:00
konstantin@mysql.com
a86eaaf5c3 A test case for Bug#8568 "GROUP_CONCAT returns string, unless in
a UNION in which case returns BLOB". The bug is not present anymore.
2005-11-18 23:46:04 +03:00
igor@rurik.mysql.com
8e8a2d79cc Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-2
2005-11-04 17:54:47 -08:00
evgen@moonbone.local
93cc0de7cf func_gconcat.result:
Fixed wrong test case
table.cc:
  Fixed wrong DBUG_ENTER placement
2005-11-03 01:50:36 +03:00
igor@rurik.mysql.com
c136e9c43b Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
2005-10-15 14:32:37 -07:00
hf@deer.(none)
ba82a6a759 Fix for bug #9855 (Inconsistend column type in create select) 2005-10-15 19:47:23 +05:00
igor@rurik.mysql.com
80484114d4 Manual merge 2005-09-07 18:06:14 -07:00
igor@rurik.mysql.com
1e6736b543 Merge rurik.mysql.com:/home/igor/mysql-4.1
into rurik.mysql.com:/home/igor/dev/mysql-4.1-0
2005-09-07 16:33:12 -07:00
bar@mysql.com
cd5cd2bf79 Merge mysql.com:/usr/home/bar/mysql-4.1.b12829
into  mysql.com:/usr/home/bar/mysql-5.0
2005-09-07 14:57:27 +05:00
bar@mysql.com
2ff61bd697 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/bar/mysql-4.1.b12829
2005-09-07 13:12:29 +05:00
igor@rurik.mysql.com
af9740d0fd func_gconcat.result, func_gconcat.test:
Added test cases for bug #12863.
item_sum.cc, item_sum.h:
  Fixed bug #12863.
  Added a flag to Item_func_group_concat set to FALSE after
  concatenation of the first element of a group.
2005-09-06 22:20:11 -07:00
msvensson@neptunus.(none)
ef6d75d032 Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0
2005-09-05 22:49:36 +02:00
evgen@moonbone.local
7493f615d8 func_gconcat.test, func_gconcat.result:
Test case for bug #12859 group_concat in subquery cause incorrect not null.
2005-09-05 17:58:29 +04:00
jimw@mysql.com
1d997477aa Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-08-31 15:24:06 -07:00
evgen@moonbone.local
f1fb30a15f Fix bug #12861 client hang with group_concat insubquery FROM DUAL.
Item_func_group_concat::fix_fields() set maybe_null flag to 0, and set it to
1 only if some of it's arguments may be null. When used in subquery in tmp 
table created field which can't be null. When no data retireved result field
have to be set to null and error mentioned in bug report occurs. Also this 
bug can occur if selecting from not null field in empty table.

Function group_concat now marked maybe_null from the very beginning not only
if some of it's argument may be null.
2005-08-31 18:26:50 +04:00
bar@mysql.com
98581508c3 Bug #12829
Cannot convert the charset of a GROUP_CONCAT result:

item_sum.cc:
  "result" character set was not set into proper value.

func_gconcat.result, func_gconcat.test:
  Fixing tests accordingly.
2005-08-30 15:36:47 +05:00
igor@rurik.mysql.com
64e53ec5c4 Manual merge 2005-07-28 21:28:20 -07:00
igor@rurik.mysql.com
a5f2c7528c func_gconcat.result, func_gconcat.test:
Added a test case for bug #12095.
sql_class.h:
  Fixed bug #12095: a join query with GROUP_CONCAT over a single row table.
  Added a flag to the TMP_TABLE_PARAM class forcing to put constant
  items generated after elimination of a single row table into temp table
  in some cases (e.g. when GROUP_CONCAT is calculated over a single row
  table).
  bk ci sql/item_sum.cc
  Fixed bug #12095: a join query with GROUP_CONCAT over a single row table.
  If GROUP_CONCAT is calculated we always put its argument into a temp
  table, even when the argument is a constant item.
sql_select.cc:
  Fixed bug #12095: a join query with GROUP_CONCAT over one row table.
  If temp table is used to calculate GROUP_CONCAT the argument should
  be always put into this table, even when it is a constant item.
2005-07-28 19:11:29 -07:00
bar@mysql.com
991e344285 Bug#10201 group_concat returns string with binary collation
item.cc:
  After merge fixes.
func_gconcat.result:
  After merge fixes
2005-07-26 14:52:33 +05:00
bar@mysql.com
0255803b4e Merge mysql.com:/usr/home/bar/mysql-4.1.b10201
into  mysql.com:/usr/home/bar/mysql-5.0
2005-07-26 13:25:18 +05:00
bar@mysql.com
0c2035b7bd func_gconcat.result, func_gconcat.test:
Adding test
item_sum.cc:
  Adding a call for collation/charset aggregation,
      to collect attributes from the arguments. The actual bug fix.
item_func.h, item_func.cc, item.h, item.cc:
  - Removing collation aggrgation functions from Item_func class
      in item.cc, and adding it as non-class functions in item.cc
      to be able to reuse this code for group_concat.
      - Adding replacement for these functions into Item_func class
      as wrappers for moved functions, to minizize patch size,
2005-07-26 12:52:02 +05:00
monty@mysql.com
775f17667b Merge with 4.1 2005-06-07 00:31:53 +03:00
monty@mysql.com
29fd1f2fd9 Move USE_PRAGMA_IMPLEMENTATION to proper place
Ensure that 'null_value' is not accessed before val() is called in FIELD() functions
Fixed initialization of key maps. This fixes some problems with keys when you have more than 64 keys
Fixed that ROLLUP don't always create a temporary table. This fix ensures that func_gconcat.test results are now predictable
2005-06-03 23:46:03 +03:00
ramil@mysql.com
cc0061a122 a fix (bug #7405: group_concat with distinct and rollup => ignores distinct in some rows). 2005-05-31 10:54:33 +05:00
konstantin@mysql.com
371850a459 Cleanup of Item_func_group_concat 2005-03-18 00:41:03 +03:00
gluh@gluh.mysql.r18.ru
edb4dd5366 after merge fix 2005-03-17 18:44:24 +03:00
gluh@gluh.mysql.r18.ru
b435d6e862 Merge 4.1 -> 5.0 2005-03-17 16:51:07 +03:00
gluh@gluh.mysql.r18.ru
41487d0b4e Fix for bug#8656: Crash with group_concat on alias in outer table
fixed result_field support of Item_ref
2005-03-16 16:44:28 +03:00
monty@mysql.com
8d616390e9 After merge fixes
Fix for BIT(X) field as string
2005-01-15 17:38:43 +02:00
monty@mysql.com
0a1076a25f Merge with 4.1 2005-01-15 14:09:45 +02:00
igor@rurik.mysql.com
cd577f2590 func_gconcat.result, func_gconcat.test:
Added a test case for bug #7769.
item_sum.h:
  Fixed bug #7769: a crash for queries with group_concat and
  having when the query table was empty.
  The bug was due an unsafe dereferencing.
2005-01-15 01:05:00 -08:00
ram@gw.mysql.r18.ru
3e8e4d06b6 A fix (bug #6475: Another server crash in 5.0.2
bug #6515: count(distinct...) crashes the server)
2004-11-10 14:36:21 +04:00
monty@mysql.com
afbe601302 merge with 4.1 2004-10-29 19:26:52 +03:00
ram@gw.mysql.r18.ru
5f857a7a82 Blob support for the group_concat() function.
(Bug #4315: GROUP_CONCAT with ORDER BY returns strange results for TEXT fields
 Bug #5564: Strange behaviour with group_concat and distinct
 Bug #5970: group_concat doesn't print warnings)
2004-10-10 12:10:53 +05:00
monty@mysql.com
31122efde7 Merge with 4.1
(Includes merge of arena code in 4.1 and 5.0)
2004-09-06 15:14:10 +03:00
bell@sanja.is.com.ua
b57e68e6e0 fixed typo in group_concat printing (BUG#5161) 2004-09-01 21:32:24 +03:00
bell@sanja.is.com.ua
6fcd27e9cd after review fixes:
allowed parsing of table fields inside aggregate functions
 added new tests of fields resolving in grouping
2004-08-23 22:31:01 +03:00
bell@sanja.is.com.ua
0ce931947e skip resolving field in table list if table list is not accessable due to groupping (BUG#4814) 2004-08-13 10:01:30 +03:00
wax@kishkin.ru
d3f1a6f0cb BUG#4315
BUG#4535
BUG#4686
2004-08-10 15:48:22 +06:00