1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fix some bugs introduced with the new my_getopt

Added counting of rollback's and commits
Fixed bug in 'SELECT 0 LIMIT 0'
Fixed bug in 'SELECT SQL_CALC_FOUND_ROWS'
This commit is contained in:
monty@hundin.mysql.fi
2002-02-08 03:21:34 +02:00
parent 040b5c2997
commit d36ac6b669
14 changed files with 128 additions and 48 deletions

View File

@ -48,3 +48,5 @@ i
2
1
drop table t1;
select 0 limit 0;
0

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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');

View File

@ -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;