mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge sinisa@work.mysql.com:/home/bk/mysql-4.0
into sinisa.nasamreza.org:/mnt/work/mysql-4.0 scripts/mysqld_safe.sh: Auto merged sql/net_pkg.cc: Auto merged sql/sql_acl.cc: Auto merged
This commit is contained in:
@ -1,5 +1,8 @@
|
||||
drop table if exists t1;
|
||||
create table t1 (id int not null, str char(10), unique(str));
|
||||
explain select * from t1;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 system NULL NULL NULL NULL 0 const row not found
|
||||
insert into t1 values (1, null),(2, null),(3, "foo"),(4, "bar");
|
||||
select * from t1 where str is null;
|
||||
id str
|
||||
|
@ -467,3 +467,17 @@ NOT NULL);
|
||||
max(value)
|
||||
4
|
||||
drop table t1,t2,t3;
|
||||
create table t1 (a blob null);
|
||||
insert into t1 values (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(""),(""),(""),("b");
|
||||
select a,count(*) from t1 group by a;
|
||||
a count(*)
|
||||
NULL 9
|
||||
3
|
||||
b 1
|
||||
set option sql_big_tables=1;
|
||||
select a,count(*) from t1 group by a;
|
||||
a count(*)
|
||||
NULL 9
|
||||
3
|
||||
b 1
|
||||
drop table t1;
|
||||
|
@ -14,8 +14,7 @@ insert into t1 values (101);
|
||||
insert into t1 values (105);
|
||||
insert into t1 values (106);
|
||||
insert into t1 values (107);
|
||||
insert into t2 values (107);
|
||||
insert into t2 values (75);
|
||||
insert into t2 values (107),(75),(1000);
|
||||
select t1.id, t2.id from t1, t2 where t2.id = t1.id;
|
||||
id id
|
||||
107 107
|
||||
@ -28,6 +27,16 @@ select t1.id, count(t2.id) from t1,t2 where t2.id = t1.id group by t2.id;
|
||||
id count(t2.id)
|
||||
75 1
|
||||
107 1
|
||||
select t1.id,t2.id from t2 left join t1 on t1.id>=74 and t1.id<=0 where t2.id=75 and t1.id is null;
|
||||
id id
|
||||
NULL 75
|
||||
explain select t1.id,t2.id from t2 left join t1 on t1.id>=74 and t1.id<=0 where t2.id=75 and t1.id is null;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 const PRIMARY NULL NULL NULL 1 Impossible ON condition
|
||||
t2 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain select t1.id, t2.id from t1, t2 where t2.id = t1.id and t1.id <0 and t1.id > 0;
|
||||
Comment
|
||||
Impossible WHERE noticed after reading const tables
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1 (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (id int not null, str char(10), unique(str));
|
||||
explain select * from t1;
|
||||
insert into t1 values (1, null),(2, null),(3, "foo"),(4, "bar");
|
||||
select * from t1 where str is null;
|
||||
select * from t1 where str="foo";
|
||||
@ -12,8 +13,10 @@ explain select * from t1 ignore key (str) where str="foo";
|
||||
explain select * from t1 use key (str,str) where str="foo";
|
||||
|
||||
#The following should give errors
|
||||
!$1072 explain select * from t1 use key (str,str,foo) where str="foo";
|
||||
!$1072 explain select * from t1 ignore key (str,str,foo) where str="foo";
|
||||
--error 1072
|
||||
explain select * from t1 use key (str,str,foo) where str="foo";
|
||||
--error 1072
|
||||
explain select * from t1 ignore key (str,str,foo) where str="foo";
|
||||
drop table t1;
|
||||
|
||||
explain select 1;
|
||||
|
@ -354,3 +354,14 @@ m.c1id = c1.id AND c1.active = 'Yes' LEFT JOIN t3 AS c2 ON m.c2id =
|
||||
c2.id AND c2.active = 'Yes' WHERE m.pid=1 AND (c1.id IS NOT NULL OR c2.id IS
|
||||
NOT NULL);
|
||||
drop table t1,t2,t3;
|
||||
|
||||
#
|
||||
# Test bug in GROUP BY on BLOB that is NULL or empty
|
||||
#
|
||||
|
||||
create table t1 (a blob null);
|
||||
insert into t1 values (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(""),(""),(""),("b");
|
||||
select a,count(*) from t1 group by a;
|
||||
set option sql_big_tables=1;
|
||||
select a,count(*) from t1 group by a;
|
||||
drop table t1;
|
||||
|
@ -19,13 +19,18 @@ insert into t1 values (105);
|
||||
insert into t1 values (106);
|
||||
insert into t1 values (107);
|
||||
|
||||
insert into t2 values (107);
|
||||
insert into t2 values (75);
|
||||
insert into t2 values (107),(75),(1000);
|
||||
|
||||
select t1.id, t2.id from t1, t2 where t2.id = t1.id;
|
||||
select t1.id, count(t2.id) from t1,t2 where t2.id = t1.id group by t1.id;
|
||||
select t1.id, count(t2.id) from t1,t2 where t2.id = t1.id group by t2.id;
|
||||
|
||||
#
|
||||
# Test problems with impossible ON or WHERE
|
||||
#
|
||||
select t1.id,t2.id from t2 left join t1 on t1.id>=74 and t1.id<=0 where t2.id=75 and t1.id is null;
|
||||
explain select t1.id,t2.id from t2 left join t1 on t1.id>=74 and t1.id<=0 where t2.id=75 and t1.id is null;
|
||||
explain select t1.id, t2.id from t1, t2 where t2.id = t1.id and t1.id <0 and t1.id > 0;
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
|
Reference in New Issue
Block a user