summaryrefslogtreecommitdiff
path: root/mysql-test/t/select_found.test
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-06-05 15:59:46 +0200
committerSergei Golubchik <sergii@pisem.net>2014-06-05 15:59:46 +0200
commit2d2697ea8d6b6ef07836c9af06fc0d4eca6aa77b (patch)
tree7d08a0107411367968a068e7726ba0c7d92aa3c4 /mysql-test/t/select_found.test
parentfde6ee61bbdeb051a169aac8da56e24bf2accdce (diff)
downloadmariadb-git-2d2697ea8d6b6ef07836c9af06fc0d4eca6aa77b.tar.gz
MDEV-6221 SQL_CALC_FOUND_ROWS yields wrong result again
replace another old "was there a filesort?" test with a correct "did filesort calculate found_rows?" test.
Diffstat (limited to 'mysql-test/t/select_found.test')
-rw-r--r--mysql-test/t/select_found.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test
index 5571d51830b..d529dc415e7 100644
--- a/mysql-test/t/select_found.test
+++ b/mysql-test/t/select_found.test
@@ -241,3 +241,19 @@ select found_rows();
drop table t1, t2;
+#
+# MDEV-6221 SQL_CALC_FOUND_ROWS yields wrong result again
+#
+create table t1 (i1 int, v1 int, primary key(i1,v1));
+insert into t1 values (1,1),(2,2),(3,3);
+create table t2 (i2 int primary key, v2 int);
+insert into t2 values (1,5),(2,5),(3,10);
+select 1 as res from t1 left join t2 on i1 = i2 where v2 = 5 or v1 = 5 or v1 = 10 order by v1;
+--disable_result_log ONCE
+select sql_calc_found_rows 1 as res from t1 left join t2 on i1 = i2 where v2 = 5 or v1 = 5 or v1 = 10 order by v1 limit 1;
+select found_rows() as count;
+--disable_result_log ONCE
+select sql_calc_found_rows 1 as res from t1 left join t2 on i1 = i2 where v2 = 5 order by v1 limit 1;
+select found_rows() as count;
+drop table t1, t2;
+