summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/limit.result2
-rw-r--r--mysql-test/r/rpl000001.result2
-rw-r--r--mysql-test/r/select.result4
-rw-r--r--mysql-test/r/select_found.result17
-rw-r--r--mysql-test/t/limit.test2
-rw-r--r--mysql-test/t/rpl000001.test1
-rw-r--r--mysql-test/t/select_found.test12
7 files changed, 37 insertions, 3 deletions
diff --git a/mysql-test/r/limit.result b/mysql-test/r/limit.result
index f341eebb968..5a8edc99c12 100644
--- a/mysql-test/r/limit.result
+++ b/mysql-test/r/limit.result
@@ -48,3 +48,5 @@ i
2
1
drop table t1;
+select 0 limit 0;
+0
diff --git a/mysql-test/r/rpl000001.result b/mysql-test/r/rpl000001.result
index 3dae52c6d3f..60a5db1de3a 100644
--- a/mysql-test/r/rpl000001.result
+++ b/mysql-test/r/rpl000001.result
@@ -7,7 +7,7 @@ use test;
drop table if exists t1,t3;
create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1;
-load data local infile '/home/sasha/bk/mysql-4.0/mysql-test/std_data/words.dat' into table t1;
+load data local infile 'MYSQL_TEST_DIR/std_data/words.dat' into table t1;
select * from t1;
word
Aarhus
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index ee057b268fd..051aeb43b43 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -1331,10 +1331,10 @@ table type possible_keys key key_len ref rows Extra
t2 ref fld3 fld3 30 const 1 where used; Using index
explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle';
table type possible_keys key key_len ref rows Extra
-t2 index fld3 fld3 30 NULL 1199 where used; Using index
+t2 index NULL fld3 30 NULL 1199 where used; Using index
explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle';
table type possible_keys key key_len ref rows Extra
-t2 index fld3 fld3 30 NULL 1199 where used; Using index
+t2 index NULL fld3 30 NULL 1199 where used; Using index
explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle';
table type possible_keys key key_len ref rows Extra
t2 ref fld3 fld3 30 const 1 where used; Using index
diff --git a/mysql-test/r/select_found.result b/mysql-test/r/select_found.result
index 2fab1642cc5..3a84c3e52da 100644
--- a/mysql-test/r/select_found.result
+++ b/mysql-test/r/select_found.result
@@ -45,3 +45,20 @@ select found_rows();
FOUND_ROWS()
8
drop table t1;
+create table t1 (a int not null primary key);
+insert into t1 values (1),(2),(3),(4),(5);
+select sql_calc_found_rows a from t1 where a in (1,2,3) order by a desc limit 0,2;
+a
+3
+2
+select FOUND_ROWS();
+FOUND_ROWS()
+3
+select sql_calc_found_rows a from t1 where a in (1,2,3) order by a+2 desc limit 0,2;
+a
+3
+2
+select FOUND_ROWS();
+FOUND_ROWS()
+3
+drop table t1;
diff --git a/mysql-test/t/limit.test b/mysql-test/t/limit.test
index 112761abd87..d4f6ce186cf 100644
--- a/mysql-test/t/limit.test
+++ b/mysql-test/t/limit.test
@@ -28,3 +28,5 @@ delete from t1 limit 0;
update t1 set i=3 limit 0;
select * from t1;
drop table t1;
+
+select 0 limit 0;
diff --git a/mysql-test/t/rpl000001.test b/mysql-test/t/rpl000001.test
index 597b1c69b1e..a5496d505f0 100644
--- a/mysql-test/t/rpl000001.test
+++ b/mysql-test/t/rpl000001.test
@@ -5,6 +5,7 @@ use test;
drop table if exists t1,t3;
create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1;
select * from t1;
set password for root@"localhost" = password('foo');
diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test
index 52c8039b2f5..9b14ab1fcf0 100644
--- a/mysql-test/t/select_found.test
+++ b/mysql-test/t/select_found.test
@@ -18,3 +18,15 @@ 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;
+
+#
+# Test SQL_CALC_FOUND_ROWS optimization when used with one table and filesort
+#
+
+create table t1 (a int not null primary key);
+insert into t1 values (1),(2),(3),(4),(5);
+select sql_calc_found_rows a from t1 where a in (1,2,3) order by a desc limit 0,2;
+select FOUND_ROWS();
+select sql_calc_found_rows a from t1 where a in (1,2,3) order by a+2 desc limit 0,2;
+select FOUND_ROWS();
+drop table t1;