diff options
author | unknown <timour/tkatchaounov@dl145s.mysql.com> | 2006-09-01 14:29:27 +0200 |
---|---|---|
committer | unknown <timour/tkatchaounov@dl145s.mysql.com> | 2006-09-01 14:29:27 +0200 |
commit | 495edb59bddc9a43242c27106d73ecd18b9d933d (patch) | |
tree | 4687f44ffd0ffcc55e29314e36c849b1c328a0fa /mysql-test/t/limit.test | |
parent | 70b73788980a955e5ee4e064c053d83b73b0b295 (diff) | |
parent | b017caefbd5f95fcdc81f1f545fdc944a454d168 (diff) | |
download | mariadb-git-495edb59bddc9a43242c27106d73ecd18b9d933d.tar.gz |
Merge timka@10.100.64.80:/home/timka/mysql/src/4.1-bug-21787
into dl145s.mysql.com:/data/tkatchaounov/5.0-bug-21787
mysql-test/r/limit.result:
Auto merged
mysql-test/t/limit.test:
Auto merged
sql/sql_select.cc:
Adjust the fix for BUG#21787 for 5.0
Diffstat (limited to 'mysql-test/t/limit.test')
-rw-r--r-- | mysql-test/t/limit.test | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mysql-test/t/limit.test b/mysql-test/t/limit.test index 6df865278f6..cf7789428b2 100644 --- a/mysql-test/t/limit.test +++ b/mysql-test/t/limit.test @@ -60,4 +60,14 @@ select 1 as a from t1 union all select 1 from dual limit 1; (select 1 as a from t1) union all (select 1 from dual) limit 1; drop table t1; +# +# Bug #21787: COUNT(*) + ORDER BY + LIMIT returns wrong result +# +create table t1 (a int); +insert into t1 values (1),(2),(3),(4),(5),(6),(7); +explain select count(*) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3; +select count(*) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3; +explain select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3; +select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3; + # End of 4.1 tests |