summaryrefslogtreecommitdiff
path: root/mysql-test/t/select_found.test
diff options
context:
space:
mode:
authorunknown <monty@tik.mysql.fi>2001-05-23 02:40:46 +0300
committerunknown <monty@tik.mysql.fi>2001-05-23 02:40:46 +0300
commit4b799725034bd5f2d7cda76d8a5bcb3b42cb88f3 (patch)
tree22a09c551394dd62383433e28ef919ca86f669b7 /mysql-test/t/select_found.test
parent8ec67661b4327060a12f9888a1179d5161e4b9c4 (diff)
downloadmariadb-git-4b799725034bd5f2d7cda76d8a5bcb3b42cb88f3.tar.gz
Don't write rows in MyISAM tables when using count(distinct)
Don't read MyISAM header when running without locking include/myisam.h: Don't read header when running without locking. myisam/mi_locking.c: Don't update changed flag for temporary files. myisam/mi_open.c: Don't read header when running without locking. myisam/mi_static.c: Don't read header when running without locking. sql/item_sum.cc: Don't write rows in MyISAM tables when using count(distinct) sql/mysqld.cc: Don't read MyISAM header when running without locking. Remove -Sg option. sql/sql_analyse.h: Remove duplicate header. sql/sql_select.cc: Cleaned up prototypes. Don't write rows to count(DISTINCT) MyISAM tables. sql/sql_select.h: Cleaned up prototypes. sql/table.h: A BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'mysql-test/t/select_found.test')
-rw-r--r--mysql-test/t/select_found.test20
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test
new file mode 100644
index 00000000000..d86ef1e0907
--- /dev/null
+++ b/mysql-test/t/select_found.test
@@ -0,0 +1,20 @@
+#
+# Testing of found_rows()
+#
+
+drop table if exists t1;
+create table t1 (a int not null auto_increment, b int not null, primary key(a));
+insert into t1 (b) values (2),(3),(5),(5),(5),(6),(7),(9);
+select SQL_CALC_FOUND_ROWS * from t1;
+select found_rows();
+select SQL_CALC_FOUND_ROWS * from t1 limit 1;
+select found_rows();
+select SQL_CALC_FOUND_ROWS * from t1 order by b desc limit 1;
+select found_rows();
+select SQL_CALC_FOUND_ROWS distinct b from t1 limit 1;
+select found_rows();
+select SQL_CALC_FOUND_ROWS b,count(*) as c from t1 group by b order by c limit 1;
+select found_rows();
+select SQL_CALC_FOUND_ROWS * from t1 left join t1 as t2 on (t1.b=t2.a) limit 2,1;
+select found_rows();
+drop table t1;