summaryrefslogtreecommitdiff
path: root/mysql-test/t/group_by.test
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2005-06-07 03:05:57 -0700
committerunknown <igor@rurik.mysql.com>2005-06-07 03:05:57 -0700
commit931e78ecb7327e33b6298a70e1c7c25bb02304eb (patch)
tree1567594821af194ea5d889382825c2064b87ccf0 /mysql-test/t/group_by.test
parentaada57038ac1c5923cb5f529357aeeaf0eff9b10 (diff)
downloadmariadb-git-931e78ecb7327e33b6298a70e1c7c25bb02304eb.tar.gz
sql_select.cc, item_buff.cc, item.h:
Fixed bug #11088: a crash for queries with GROUP BY a BLOB column + COUNT(DISTINCT...) due to an attempt to allocate a too large buffer for the BLOB field. Now the size of the buffer is limited by max_sort_length. group_by.test, group_by.result: Added a test case for bug #11088. mysql-test/r/group_by.result: Added a test case for bug #11088. mysql-test/t/group_by.test: Added a test case for bug #11088. sql/item.h: Fixed bug #11088: a crash for queries with GROUP BY a BLOB column + COUNT(DISTINCT...) due to an attempt to allocate a too large buffer for the BLOB fields. Now the size of the buffer is limited by max_sort_length. sql/item_buff.cc: Fixed bug #11088: a crash for queries with GROUP BY a BLOB column + COUNT(DISTINCT...) due to an attempt to allocate a too large buffer for the BLOB fields. Now the size of the buffer is limited by max_sort_length. sql/sql_select.cc: Fixed bug #11088: a crash for queries with GROUP BY a BLOB column + COUNT(DISTINCT...) due to an attempt to allocate a too large buffer for the BLOB fields. Now the size of the buffer is limited by max_sort_length.
Diffstat (limited to 'mysql-test/t/group_by.test')
-rw-r--r--mysql-test/t/group_by.test17
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index fbd39019e6d..21d5abcc287 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -522,3 +522,20 @@ insert into t1 values(3000000000);
select * from t1;
select min(b) from t1;
drop table t1;
+
+#
+# Test for bug #11088: GROUP BY a BLOB colimn with COUNT(DISTINCT column1)
+#
+
+CREATE TABLE t1 (id int PRIMARY KEY, user_id int, hostname longtext);
+
+INSERT INTO t1 VALUES
+ (1, 7, 'cache-dtc-af05.proxy.aol.com'),
+ (2, 3, 'what.ever.com'),
+ (3, 7, 'cache-dtc-af05.proxy.aol.com'),
+ (4, 7, 'cache-dtc-af05.proxy.aol.com');
+
+SELECT hostname, COUNT(DISTINCT user_id) as no FROM t1
+ WHERE hostname LIKE '%aol%'
+ GROUP BY hostname;
+