summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2002-11-16 16:41:29 +0200
committerunknown <Sinisa@sinisa.nasamreza.org>2002-11-16 16:41:29 +0200
commita40a9d59161e2de19551b0bd1ad016681741e918 (patch)
tree04cf66893d87bd087aed3902c9fffa2f5a62a328 /mysql-test
parent9c28568dc269a7b0c3de79880a72d1588210b2c6 (diff)
downloadmariadb-git-a40a9d59161e2de19551b0bd1ad016681741e918.tar.gz
Some new tests...................
mysql-test/r/derived.result: A test for derived table which requires creation on temporary MyISAM table ... mysql-test/r/select_found.result: A test for LIMIT ) mysql-test/t/derived.test: A test for derived table which requires creation on temporary MyISAM table ... mysql-test/t/select_found.test: A test for LIMIT 0
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/derived.result25
-rw-r--r--mysql-test/r/select_found.result10
-rw-r--r--mysql-test/t/derived.test12
-rw-r--r--mysql-test/t/select_found.test4
4 files changed, 51 insertions, 0 deletions
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index 0290d0755d5..204ca86f306 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -40,3 +40,28 @@ a
select 1 from (select 1);
1
1
+drop table if exists t1;
+create table t1(a int not null, t char(8), index(a));
+SELECT * FROM (SELECT * FROM t1) ORDER BY a ASC LIMIT 0,20;
+a t
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+8 8
+9 9
+10 10
+11 11
+12 12
+13 13
+14 14
+15 15
+16 16
+17 17
+18 18
+19 19
+20 20
+drop table if exists t1;
diff --git a/mysql-test/r/select_found.result b/mysql-test/r/select_found.result
index 1c2cd7da894..6fb9ea0ee0b 100644
--- a/mysql-test/r/select_found.result
+++ b/mysql-test/r/select_found.result
@@ -168,4 +168,14 @@ test2 2 2
SELECT FOUND_ROWS();
FOUND_ROWS()
2
+SELECT SQL_CALC_FOUND_ROWS 1 FROM (SELECT 1) LIMIT 0;
+1
+SELECT FOUND_ROWS();
+FOUND_ROWS()
+1
+SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 0;
+titre numeropost maxnumrep
+SELECT FOUND_ROWS();
+FOUND_ROWS()
+3
drop table t1;
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index 501d4db26fa..de765a0e280 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -22,3 +22,15 @@ drop table if exists t1.t2,t3;
select * from (select 1);
select a from (select 1 as a);
select 1 from (select 1);
+drop table if exists t1;
+create table t1(a int not null, t char(8), index(a));
+disable_query_log;
+let $1 = 10000;
+while ($1)
+ {
+ eval insert into t1 values ($1,'$1');
+ dec $1;
+ }
+enable_query_log;
+SELECT * FROM (SELECT * FROM t1) ORDER BY a ASC LIMIT 0,20;
+drop table if exists t1; \ No newline at end of file
diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test
index 0a483c860cb..c67c99924c3 100644
--- a/mysql-test/t/select_found.test
+++ b/mysql-test/t/select_found.test
@@ -84,4 +84,8 @@ INSERT INTO t1 (titre,maxnumrep) VALUES
('test1','1'),('test2','2'),('test3','3');
SELECT SQL_CALC_FOUND_ROWS titre,numeropost,maxnumrep FROM t1 WHERE numeropost IN (1,2) ORDER BY maxnumrep DESC LIMIT 0, 1;
SELECT FOUND_ROWS();
+SELECT SQL_CALC_FOUND_ROWS 1 FROM (SELECT 1) LIMIT 0;
+SELECT FOUND_ROWS();
+SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 0;
+SELECT FOUND_ROWS();
drop table t1;