diff options
author | Sergei Golubchik <sergii@pisem.net> | 2015-01-19 14:18:44 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2015-01-19 14:18:44 +0100 |
commit | 47c844f236fc7e9f6065ba4332facea6b51fe26e (patch) | |
tree | 7a4a70cf84dca76777696a8636b7f2a091b30c3d /mysql-test/t/select_found.test | |
parent | ce0ed977d51e4621fbb241ea7f231ee35db48b39 (diff) | |
download | mariadb-git-47c844f236fc7e9f6065ba4332facea6b51fe26e.tar.gz |
MDEV-7219 SQL_CALC_FOUND_ROWS yields wrong result
revert the code in filesort that conditionally updated 'found_rows',
rely on filesort_limit_arg instead.
Diffstat (limited to 'mysql-test/t/select_found.test')
-rw-r--r-- | mysql-test/t/select_found.test | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test index d529dc415e7..88940eaf2b8 100644 --- a/mysql-test/t/select_found.test +++ b/mysql-test/t/select_found.test @@ -257,3 +257,23 @@ select sql_calc_found_rows 1 as res from t1 left join t2 on i1 = i2 where v2 = 5 select found_rows() as count; drop table t1, t2; +# +# MDEV-7219 SQL_CALC_FOUND_ROWS yields wrong result +# +create table t1 (i int, v varchar(64), key (i)); + +--disable_query_log +let $1=150; +while ($1) +{ + eval insert into t1 values ($1 % 2, 'foo'); + dec $1; +} +--enable_query_log + +select sql_calc_found_rows * from t1 where i = 0 order by v limit 59,2; +select found_rows(); +select sql_calc_found_rows * from t1 ignore index (i) where i = 0 order by v limit 59,2; +select found_rows(); +drop table t1; + |