mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/my/mysql-4.0 mysys/my_thr_init.c: Auto merged
This commit is contained in:
@ -36,9 +36,7 @@ a b
|
||||
3 4
|
||||
drop table t1;
|
||||
create table t1 (i int);
|
||||
insert into t1 (i) values(1);
|
||||
insert into t1 (i) values(1);
|
||||
insert into t1 (i) values(1);
|
||||
insert into t1 (i) values(1),(1),(1);
|
||||
delete from t1 limit 1;
|
||||
update t1 set i=2 limit 1;
|
||||
delete from t1 limit 0;
|
||||
@ -50,3 +48,22 @@ i
|
||||
drop table t1;
|
||||
select 0 limit 0;
|
||||
0
|
||||
CREATE TABLE t1(id int auto_increment primary key, id2 int, index(id2));
|
||||
INSERT INTO t1 (id2) values (0),(0),(0);
|
||||
DELETE FROM t1 WHERE id=1;
|
||||
INSERT INTO t1 SET id2=0;
|
||||
SELECT * FROM t1;
|
||||
id id2
|
||||
4 0
|
||||
2 0
|
||||
3 0
|
||||
DELETE FROM t1 WHERE id2 = 0 ORDER BY id LIMIT 1;
|
||||
SELECT * FROM t1;
|
||||
id id2
|
||||
4 0
|
||||
3 0
|
||||
DELETE FROM t1 WHERE id2 = 0 ORDER BY id desc LIMIT 1;
|
||||
SELECT * FROM t1;
|
||||
id id2
|
||||
3 0
|
||||
DROP TABLE t1;
|
||||
|
@ -169,3 +169,22 @@ SELECT FOUND_ROWS();
|
||||
FOUND_ROWS()
|
||||
2
|
||||
drop table t1;
|
||||
create table t1 (id int, primary key (id));
|
||||
insert into t1 values (1), (2), (3), (4), (5);
|
||||
select SQL_CALC_FOUND_ROWS * from t1 where id > 3 limit 0, 1;
|
||||
id
|
||||
4
|
||||
select FOUND_ROWS();
|
||||
FOUND_ROWS()
|
||||
2
|
||||
select SQL_CALC_FOUND_ROWS * from t1 where id > 3 AND 1=2 limit 0, 1;
|
||||
id
|
||||
select FOUND_ROWS();
|
||||
FOUND_ROWS()
|
||||
0
|
||||
select SQL_CALC_FOUND_ROWS * from t1 where id > 6 limit 0, 1;
|
||||
id
|
||||
select FOUND_ROWS();
|
||||
FOUND_ROWS()
|
||||
0
|
||||
drop table t1;
|
||||
|
@ -3,7 +3,7 @@ CREATE TABLE t1 (a int not null, b char (10) not null);
|
||||
insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
|
||||
CREATE TABLE t2 (a int not null, b char (10) not null);
|
||||
insert into t2 values (3,'c'),(4,'d'),(5,'f'),(6,'e');
|
||||
select a,b from t1 union select a,b from t2;
|
||||
select a,b from t1 union distinct select a,b from t2;
|
||||
a b
|
||||
1 a
|
||||
2 b
|
||||
@ -423,3 +423,7 @@ create temporary table t1 select a from t1 union select a from t2;
|
||||
create table t1 select a from t1 union select a from t2;
|
||||
INSERT TABLE 't1' isn't allowed in FROM table list
|
||||
drop table t1,t2;
|
||||
select length(version()) > 1 as `*` UNION select 2;
|
||||
*
|
||||
1
|
||||
2
|
||||
|
@ -19,9 +19,7 @@ select * from t1;
|
||||
drop table t1;
|
||||
|
||||
create table t1 (i int);
|
||||
insert into t1 (i) values(1);
|
||||
insert into t1 (i) values(1);
|
||||
insert into t1 (i) values(1);
|
||||
insert into t1 (i) values(1),(1),(1);
|
||||
delete from t1 limit 1;
|
||||
update t1 set i=2 limit 1;
|
||||
delete from t1 limit 0;
|
||||
@ -29,4 +27,22 @@ update t1 set i=3 limit 0;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
# LIMIT 0
|
||||
|
||||
select 0 limit 0;
|
||||
|
||||
#
|
||||
# Test with DELETE, ORDER BY and limit (bug #1024)
|
||||
#
|
||||
|
||||
CREATE TABLE t1(id int auto_increment primary key, id2 int, index(id2));
|
||||
INSERT INTO t1 (id2) values (0),(0),(0);
|
||||
DELETE FROM t1 WHERE id=1;
|
||||
INSERT INTO t1 SET id2=0;
|
||||
SELECT * FROM t1;
|
||||
DELETE FROM t1 WHERE id2 = 0 ORDER BY id LIMIT 1;
|
||||
# should have deleted WHERE id=2
|
||||
SELECT * FROM t1;
|
||||
DELETE FROM t1 WHERE id2 = 0 ORDER BY id desc LIMIT 1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
@ -85,3 +85,17 @@ INSERT INTO t1 (titre,maxnumrep) VALUES
|
||||
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();
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test problem with impossible WHERE (Bug #1468)
|
||||
#
|
||||
|
||||
create table t1 (id int, primary key (id));
|
||||
insert into t1 values (1), (2), (3), (4), (5);
|
||||
select SQL_CALC_FOUND_ROWS * from t1 where id > 3 limit 0, 1;
|
||||
select FOUND_ROWS();
|
||||
select SQL_CALC_FOUND_ROWS * from t1 where id > 3 AND 1=2 limit 0, 1;
|
||||
select FOUND_ROWS();
|
||||
select SQL_CALC_FOUND_ROWS * from t1 where id > 6 limit 0, 1;
|
||||
select FOUND_ROWS();
|
||||
drop table t1;
|
||||
|
@ -8,7 +8,7 @@ insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
|
||||
CREATE TABLE t2 (a int not null, b char (10) not null);
|
||||
insert into t2 values (3,'c'),(4,'d'),(5,'f'),(6,'e');
|
||||
|
||||
select a,b from t1 union select a,b from t2;
|
||||
select a,b from t1 union distinct select a,b from t2;
|
||||
select a,b from t1 union all select a,b from t2;
|
||||
select a,b from t1 union all select a,b from t2 order by b;
|
||||
select a,b from t1 union all select a,b from t2 union select 7,'g';
|
||||
@ -227,3 +227,10 @@ create temporary table t1 select a from t1 union select a from t2;
|
||||
--error 1093
|
||||
create table t1 select a from t1 union select a from t2;
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# Problem with alias '*' (BUG #1249)
|
||||
#
|
||||
|
||||
select length(version()) > 1 as `*` UNION select 2;
|
||||
|
||||
|
Reference in New Issue
Block a user