summaryrefslogtreecommitdiff
path: root/mysql-test/t/select_found.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/select_found.test')
-rw-r--r--mysql-test/t/select_found.test23
1 files changed, 8 insertions, 15 deletions
diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test
index 684ae54b517..5571d51830b 100644
--- a/mysql-test/t/select_found.test
+++ b/mysql-test/t/select_found.test
@@ -208,11 +208,10 @@ select f1 from t1,t2 where f1=f3 and f2=3 order by f1;
select found_rows();
drop table t1, t2;
-create table t1 (
- a1 int auto_increment primary key,
- b1 datetime,
- c1 int
-);
+#
+# MDEV-5898 FOUND_ROWS() return incorrect value when using DISTINCT
+#
+create table t1 (a1 int auto_increment primary key, c1 int);
insert t1 (a1) values (null);
insert t1 (a1) select null from t1;
@@ -226,12 +225,7 @@ insert t1 (a1) select null from t1;
insert t1 (a1) select null from t1;
update t1 set c1=a1 % 2;
-create table t2 (
- a2 int,
- b2 int,
- c2 char(16) default '',
- primary key (a2, b2)
-);
+create table t2 (a2 int, b2 int, c2 char(16) default '', primary key (a2, b2));
insert t2 select a1, 1, 'ok' from t1;
insert t2 select a1, 2, 'ko' from t1;
@@ -239,10 +233,9 @@ insert t2 select a1, 3, 'ko' from t1;
insert t2 select a1, 4, 'ok' from t1;
insert t2 select a1, 5, 'ok' from t1;
---disable_result_log
-select sql_calc_found_rows distinct a1,b1,c2 from t1 join t2 on a2=a1
- where a1 <= 256 and c1=0 and c2='ok' order by b1 desc, a1 desc limit 46;
---enable_result_log
+--disable_result_log ONCE
+select sql_calc_found_rows distinct a1,c2 from t1 join t2 on a2=a1
+ where a1 <= 256 and c1=0 and c2='ok' order by a1 desc limit 46;
select found_rows();