diff options
author | Michael Widenius <monty@askmonty.org> | 2011-11-15 13:14:54 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2011-11-15 13:14:54 +0200 |
commit | ef45b799245d4c33770339619dab4d717b1e552f (patch) | |
tree | 988b9e35cf50faa4a538ebf340ac804b2632a31d /mysql-test/t/select.test | |
parent | b5d41c1c11ab4f34913f6a104638f860bcd74907 (diff) | |
download | mariadb-git-ef45b799245d4c33770339619dab4d717b1e552f.tar.gz |
Fix for lp:780425 sql_buffer_result=1 gives wrong result for GROUP BY with a +# constant expression"
mysql-test/r/select.result:
Test case for lp:780425
mysql-test/r/select_pkeycache.result:
lp:780425
mysql-test/t/select.test:
lp:780425
sql/sql_select.cc:
Added DBUG_ASSERT to be prove some logic and later be able to simplify the code
Set implicit_grouping if we delete a GROUP BY to signal do_select() that a grouping needs to be done.
Diffstat (limited to 'mysql-test/t/select.test')
-rw-r--r-- | mysql-test/t/select.test | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 1139e7acc60..ef1894a5405 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -4121,4 +4121,21 @@ SET SESSION join_buffer_size = DEFAULT; DROP TABLE t1,t2,t3,t4,t5,t6; +# +# Bug #780425: "sql_buffer_result=1 gives wrong result for GROUP BY with a +# constant expression" +# + +CREATE TABLE t1(f1 int UNSIGNED) engine=myisam; +INSERT INTO t1 VALUES (3),(2),(1); +set sql_buffer_result=0; +SELECT f1 FROM t1 GROUP BY 1; +SELECT f1 FROM t1 GROUP BY '123' = 'abc'; +SELECT 1 FROM t1 GROUP BY 1; +set sql_buffer_result=1; +SELECT f1 FROM t1 GROUP BY 1; +SELECT f1 FROM t1 GROUP BY '123' = 'abc'; +SELECT 1 FROM t1 GROUP BY 1; +drop table t1; + --echo End of 5.1 tests |