summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/select_found.result5
-rw-r--r--mysql-test/t/select_found.test7
2 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/r/select_found.result b/mysql-test/r/select_found.result
index 7b38515cf70..c281dc885ad 100644
--- a/mysql-test/r/select_found.result
+++ b/mysql-test/r/select_found.result
@@ -362,4 +362,9 @@ c1
select found_rows();
found_rows()
5
+SELECT SQL_CALC_FOUND_ROWS 1 FROM DUAL WHERE 0;
+1
+SELECT FOUND_ROWS();
+FOUND_ROWS()
+1
drop table t1;
diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test
index 33613697722..092ffc00cdc 100644
--- a/mysql-test/t/select_found.test
+++ b/mysql-test/t/select_found.test
@@ -286,4 +286,11 @@ select * from t1 order by c1 limit 2,1;
select found_rows();
select sql_calc_found_rows * from t1 order by c1 limit 2,1;
select found_rows();
+
+#
+# MDEV-22830 SQL_CALC_FOUND_ROWS not working properly for single SELECT for DUAL
+#
+SELECT SQL_CALC_FOUND_ROWS 1 FROM DUAL WHERE 0;
+SELECT FOUND_ROWS();
+
drop table t1;