diff options
author | unknown <mhansson/martin@linux-st28.site> | 2007-05-11 16:05:20 +0300 |
---|---|---|
committer | unknown <mhansson/martin@linux-st28.site> | 2007-05-11 16:05:20 +0300 |
commit | 10be360ece3e148164aa9c83d45a2526c34262e7 (patch) | |
tree | fb50fb4c32f6db304ca86359415c5e60a85b7544 /mysql-test/r/func_gconcat.result | |
parent | be5ff3e2ba4ddf32241348de6184be0172d34a37 (diff) | |
download | mariadb-git-10be360ece3e148164aa9c83d45a2526c34262e7.tar.gz |
bug#28273: GROUP_CONCAT and ORDER BY: No warning when result gets truncated.
When using GROUP_CONCAT with ORDER BY, a tree is used for the sorting, as
opposed to normal nested loops join used when there is no ORDER BY.
The tree traversal that generates the result counts the lines that have been
cut down. (as they get cut down to the field's max_size)
But the check of that count was before the tree traversal, so no
warning was generated if the output is truncated.
Fixed by moving the check to after the tree traversal.
mysql-test/r/func_gconcat.result:
bug#28273: correct result
mysql-test/t/func_gconcat.test:
bug#28273: test case
sql/item_sum.cc:
bug#28273: the fix
Moved the code that outputs a warning to after temporary table (tree) is traversed.
Diffstat (limited to 'mysql-test/r/func_gconcat.result')
-rw-r--r-- | mysql-test/r/func_gconcat.result | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 71419b5b2c3..20df776ec1b 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -737,4 +737,30 @@ SELECT GROUP_CONCAT(DISTINCT UCASE(b)) FROM t1; GROUP_CONCAT(DISTINCT UCASE(b)) ONE.1,TWO.2,ONE.3 DROP TABLE t1; +CREATE TABLE t1( a VARCHAR( 10 ), b INT ); +INSERT INTO t1 VALUES ( repeat( 'a', 10 ), 1), +( repeat( 'b', 10 ), 2); +SET group_concat_max_len = 20; +SELECT GROUP_CONCAT( a ) FROM t1; +GROUP_CONCAT( a ) +aaaaaaaaaa,bbbbbbbbb +Warnings: +Warning 1260 1 line(s) were cut by GROUP_CONCAT() +SELECT GROUP_CONCAT( DISTINCT a ) FROM t1; +GROUP_CONCAT( DISTINCT a ) +aaaaaaaaaa,bbbbbbbbb +Warnings: +Warning 1260 1 line(s) were cut by GROUP_CONCAT() +SELECT GROUP_CONCAT( a ORDER BY b ) FROM t1; +GROUP_CONCAT( a ORDER BY b ) +aaaaaaaaaa,bbbbbbbbb +Warnings: +Warning 1260 1 line(s) were cut by GROUP_CONCAT() +SELECT GROUP_CONCAT( DISTINCT a ORDER BY b ) FROM t1; +GROUP_CONCAT( DISTINCT a ORDER BY b ) +aaaaaaaaaa,bbbbbbbbb +Warnings: +Warning 1260 1 line(s) were cut by GROUP_CONCAT() +SET group_concat_max_len = DEFAULT; +DROP TABLE t1; End of 5.0 tests |