Merge willster.(none):/home/stewart/Documents/MySQL/5.1/ndb

into  willster.(none):/home/stewart/Documents/MySQL/5.1/bug21253
This commit is contained in:
stewart@willster.(none) 2006-10-18 18:41:43 +10:00
commit 467903724c
23 changed files with 1705 additions and 281 deletions

View file

@ -568,7 +568,7 @@ t1
insert into t1 values (1,1),(2,1),(3,1),(4,1),(5,2),(6,1),(7,1);
explain select * from t1 where a12345678901234567890123456789a1234567890=2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref a12345678901234567890123456789a1234567890 a12345678901234567890123456789a1234567890 5 const 1 Using where
1 SIMPLE t1 ref a12345678901234567890123456789a1234567890 a12345678901234567890123456789a1234567890 5 const # Using where
select * from t1 where a12345678901234567890123456789a1234567890=2;
a1234567890123456789012345678901234567890 a12345678901234567890123456789a1234567890
5 2

View file

@ -40,7 +40,7 @@ insert into t1 values(2,@b2,222,@d2);
commit;
explain select * from t1 where a = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t1 const PRIMARY PRIMARY 4 const #
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
from t1 where a=1;
a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)
@ -87,7 +87,7 @@ replace t1 set a=2,b=@b2,c=222,d=@d2;
commit;
explain select * from t1 where a = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t1 const PRIMARY PRIMARY 4 const #
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
from t1 where a=1;
a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)
@ -134,7 +134,7 @@ insert into t1 values(2,@b2,222,@d2);
commit;
explain select * from t1 where c = 111;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref c c 4 const 1
1 SIMPLE t1 ref c c 4 const #
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
from t1 where c=111;
a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)
@ -177,7 +177,7 @@ insert into t1 values(9,'b9',999,'dd9');
commit;
explain select * from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 9
1 SIMPLE t1 ALL NULL NULL NULL NULL #
select * from t1 order by a;
a b c d
1 b1 111 dd1
@ -212,7 +212,7 @@ insert into t1 values(2,@b2,222,@d2);
commit;
explain select * from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
1 SIMPLE t1 ALL NULL NULL NULL NULL #
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
from t1 order by a;
a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)
@ -242,7 +242,7 @@ insert into t1 values(9,'b9',999,'dd9');
commit;
explain select * from t1 where c >= 100 order by a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c c 4 NULL 9 Using where; Using filesort
1 SIMPLE t1 range c c 4 NULL # Using where; Using filesort
select * from t1 where c >= 100 order by a;
a b c d
1 b1 111 dd1
@ -278,7 +278,7 @@ insert into t1 values(2,@b2,222,@d2);
commit;
explain select * from t1 where c >= 100 order by a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c c 4 NULL 2 Using where; Using filesort
1 SIMPLE t1 range c c 4 NULL # Using where; Using filesort
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
from t1 where c >= 100 order by a;
a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)

View file

@ -186,9 +186,6 @@ p a
4 aAa
5 aaa
6 AAA
explain select * from t1 where a = 'zZz' order by p;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const a NULL NULL NULL 1
select * from t1 where a = 'aAa' order by p;
p a
1 aAa
@ -223,9 +220,6 @@ p a
4 aAa
5 aaa
6 AAA
explain select * from t1 where a = 'zZz' order by p;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const a NULL NULL NULL 1
select * from t1 where a = 'aAa' order by p;
p a
1 aAa

View file

@ -513,7 +513,7 @@ time_field = '01:01:01' and
date_time = '1901-01-01 01:01:01'
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where with pushed condition; Using filesort
1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
select auto from t1 where
string = "aaaa" and
vstring = "aaaa" and
@ -570,7 +570,7 @@ time_field != '01:01:01' and
date_time != '1901-01-01 01:01:01'
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where with pushed condition; Using filesort
1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
select auto from t1 where
string != "aaaa" and
vstring != "aaaa" and
@ -629,7 +629,7 @@ time_field > '01:01:01' and
date_time > '1901-01-01 01:01:01'
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where with pushed condition; Using filesort
1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
select auto from t1 where
string > "aaaa" and
vstring > "aaaa" and
@ -688,7 +688,7 @@ time_field >= '01:01:01' and
date_time >= '1901-01-01 01:01:01'
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where with pushed condition; Using filesort
1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
select auto from t1 where
string >= "aaaa" and
vstring >= "aaaa" and
@ -748,7 +748,7 @@ time_field < '04:04:04' and
date_time < '1904-04-04 04:04:04'
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where with pushed condition; Using filesort
1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
select auto from t1 where
string < "dddd" and
vstring < "dddd" and
@ -807,7 +807,7 @@ time_field <= '04:04:04' and
date_time <= '1904-04-04 04:04:04'
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where with pushed condition; Using filesort
1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
select auto from t1 where
string <= "dddd" and
vstring <= "dddd" and
@ -868,7 +868,7 @@ time_field = '01:01:01' and
date_time = '1901-01-01 01:01:01'
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref medium_index medium_index 3 const 1 Using where with pushed condition; Using filesort
1 SIMPLE t1 ref medium_index medium_index 3 const # Using where with pushed condition; Using filesort
select auto from t1 where
string = "aaaa" and
vstring = "aaaa" and
@ -925,7 +925,7 @@ time_field != '01:01:01' and
date_time != '1901-01-01 01:01:01'
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range medium_index medium_index 3 NULL 3 Using where with pushed condition; Using filesort
1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
select auto from t1 where
string != "aaaa" and
vstring != "aaaa" and
@ -984,7 +984,7 @@ time_field > '01:01:01' and
date_time > '1901-01-01 01:01:01'
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range medium_index medium_index 3 NULL 3 Using where with pushed condition; Using filesort
1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
select auto from t1 where
string > "aaaa" and
vstring > "aaaa" and
@ -1043,7 +1043,7 @@ time_field >= '01:01:01' and
date_time >= '1901-01-01 01:01:01'
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range medium_index medium_index 3 NULL 4 Using where with pushed condition; Using filesort
1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
select auto from t1 where
string >= "aaaa" and
vstring >= "aaaa" and
@ -1103,7 +1103,7 @@ time_field < '04:04:04' and
date_time < '1904-04-04 04:04:04'
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range medium_index medium_index 3 NULL 3 Using where with pushed condition; Using filesort
1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
select auto from t1 where
string < "dddd" and
vstring < "dddd" and
@ -1162,7 +1162,7 @@ time_field <= '04:04:04' and
date_time <= '1904-04-04 04:04:04'
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range medium_index medium_index 3 NULL 4 Using where with pushed condition; Using filesort
1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
select auto from t1 where
string <= "dddd" and
vstring <= "dddd" and
@ -1202,7 +1202,7 @@ bin like concat(0xBB, '%') and
vbin like concat(0xBB, '%')
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where with pushed condition; Using filesort
1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
select auto from t1 where
string like "b%" and
vstring like "b%" and
@ -1219,7 +1219,7 @@ bin not like concat(0xBB, '%') and
vbin not like concat(0xBB, '%')
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where with pushed condition; Using filesort
1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
select auto from t1 where
string not like "b%" and
vstring not like "b%" and
@ -1255,7 +1255,7 @@ select auto from t1 where
(date_time between '1901-01-01 01:01:01' and '1903-03-03 03:03:03')
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range medium_index medium_index 3 NULL 3 Using where with pushed condition; Using filesort
1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
select auto from t1 where
(string between "aaaa" and "cccc") and
(vstring between "aaaa" and "cccc") and
@ -1307,7 +1307,7 @@ select auto from t1 where
('1901-01-01 01:01:01' between date_time and date_time)
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range medium_index medium_index 3 NULL 1 Using where with pushed condition; Using filesort
1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
select auto from t1 where
("aaaa" between string and string) and
("aaaa" between vstring and vstring) and
@ -1358,7 +1358,7 @@ select auto from t1 where
(date_time not between '1901-01-01 01:01:01' and '1903-03-03 03:03:03')
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range medium_index medium_index 3 NULL 1 Using where with pushed condition; Using filesort
1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
select auto from t1 where
(string not between "aaaa" and "cccc") and
(vstring not between "aaaa" and "cccc") and
@ -1409,7 +1409,7 @@ select auto from t1 where
('1901-01-01 01:01:01' not between date_time and date_time)
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range medium_index medium_index 3 NULL 3 Using where with pushed condition; Using filesort
1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
select auto from t1 where
("aaaa" not between string and string) and
("aaaa" not between vstring and vstring) and
@ -1462,7 +1462,7 @@ time_field in('01:01:01','03:03:03') and
date_time in('1901-01-01 01:01:01','1903-03-03 03:03:03')
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range medium_index medium_index 3 NULL 2 Using where with pushed condition; Using filesort
1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
select auto from t1 where
string in("aaaa","cccc") and
vstring in("aaaa","cccc") and
@ -1514,7 +1514,7 @@ select auto from t1 where
'1901-01-01 01:01:01' in(date_time)
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref medium_index medium_index 3 const 1 Using where with pushed condition; Using filesort
1 SIMPLE t1 ref medium_index medium_index 3 const # Using where with pushed condition; Using filesort
select auto from t1 where
"aaaa" in(string) and
"aaaa" in(vstring) and
@ -1565,7 +1565,7 @@ time_field not in('01:01:01','03:03:03') and
date_time not in('1901-01-01 01:01:01','1903-03-03 03:03:03')
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range medium_index medium_index 3 NULL 6 Using where with pushed condition; Using filesort
1 SIMPLE t1 range medium_index medium_index 3 NULL # Using where with pushed condition; Using filesort
select auto from t1 where
string not in("aaaa","cccc") and
vstring not in("aaaa","cccc") and
@ -1617,7 +1617,7 @@ select auto from t1 where
'1901-01-01 01:01:01' not in(date_time)
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where with pushed condition; Using filesort
1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
select auto from t1 where
"aaaa" not in(string) and
"aaaa" not in(vstring) and
@ -1704,7 +1704,7 @@ count(*)
explain
select * from t2 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 6 Using where with pushed condition; Using filesort
1 SIMPLE t2 ALL PRIMARY NULL NULL NULL # Using where with pushed condition; Using filesort
select * from t2 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
pk1 attr1 attr2 attr3
2 2 NULL NULL
@ -1712,7 +1712,7 @@ pk1 attr1 attr2 attr3
explain
select * from t2 where attr3 is not null and attr1 > 2 order by pk1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where with pushed condition; Using filesort
1 SIMPLE t2 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
select * from t2 where attr3 is not null and attr1 > 2 order by pk1;
pk1 attr1 attr2 attr3
3 3 3 d
@ -1721,7 +1721,7 @@ pk1 attr1 attr2 attr3
explain
select * from t3 where attr2 > 9223372036854775803 and attr3 != 3 order by pk1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 ALL NULL NULL NULL NULL 6 Using where with pushed condition; Using filesort
1 SIMPLE t3 ALL NULL NULL NULL NULL # Using where with pushed condition; Using filesort
select * from t3 where attr2 > 9223372036854775803 and attr3 != 3 order by pk1;
pk1 attr1 attr2 attr3 attr4
2 2 9223372036854775804 2 c
@ -1730,15 +1730,15 @@ pk1 attr1 attr2 attr3 attr4
explain
select * from t2,t3 where t2.attr1 < 1 and t2.attr2 = t3.attr2 and t3.attr1 < 5 order by t2.pk1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where with pushed condition; Using temporary; Using filesort
1 SIMPLE t3 ALL NULL NULL NULL NULL 6 Using where with pushed condition
1 SIMPLE t2 ALL NULL NULL NULL NULL # Using where with pushed condition; Using temporary; Using filesort
1 SIMPLE t3 ALL NULL NULL NULL NULL # Using where with pushed condition
select * from t2,t3 where t2.attr1 < 1 and t2.attr2 = t3.attr2 and t3.attr1 < 5 order by t2.pk1;
pk1 attr1 attr2 attr3 pk1 attr1 attr2 attr3 attr4
0 0 0 a 0 0 0 0 a
explain
select * from t4 where attr1 < 5 and attr2 > 9223372036854775803 and attr3 != 3 order by t4.pk1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 range attr1 attr1 4 NULL 5 Using where with pushed condition; Using filesort
1 SIMPLE t4 range attr1 attr1 4 NULL # Using where with pushed condition; Using filesort
select * from t4 where attr1 < 5 and attr2 > 9223372036854775803 and attr3 != 3 order by t4.pk1;
pk1 attr1 attr2 attr3 attr4
2 2 9223372036854775804 2 c
@ -1746,8 +1746,8 @@ pk1 attr1 attr2 attr3 attr4
explain
select * from t3,t4 where t4.attr1 > 1 and t4.attr2 = t3.attr2 and t4.attr3 < 5 order by t4.pk1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 range attr1 attr1 4 NULL 4 Using where with pushed condition; Using temporary; Using filesort
1 SIMPLE t3 ALL NULL NULL NULL NULL 6 Using where
1 SIMPLE t4 range attr1 attr1 4 NULL # Using where with pushed condition; Using temporary; Using filesort
1 SIMPLE t3 ALL NULL NULL NULL NULL # Using where
select * from t3,t4 where t4.attr1 > 1 and t4.attr2 = t3.attr2 and t4.attr3 < 5 order by t4.pk1;
pk1 attr1 attr2 attr3 attr4 pk1 attr1 attr2 attr3 attr4
2 2 9223372036854775804 2 c 2 2 9223372036854775804 2 c
@ -1756,16 +1756,16 @@ pk1 attr1 attr2 attr3 attr4 pk1 attr1 attr2 attr3 attr4
explain
select auto from t1 where string = "aaaa" collate latin1_general_ci order by auto;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Using filesort
1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where; Using filesort
explain
select * from t2 where (attr1 < 2) = (attr2 < 2) order by pk1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using filesort
1 SIMPLE t2 ALL NULL NULL NULL NULL # Using where; Using filesort
explain
select * from t3 left join t4 on t4.attr2 = t3.attr2 where t4.attr1 > 1 and t4.attr3 < 5 or t4.attr1 is null order by t4.pk1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort
1 SIMPLE t4 ALL NULL NULL NULL NULL 6 Using where
1 SIMPLE t3 ALL NULL NULL NULL NULL # Using temporary; Using filesort
1 SIMPLE t4 ALL NULL NULL NULL NULL # Using where
create table t5 (a int primary key auto_increment, b tinytext not null)
engine = ndb;
insert into t5 (b) values ('jonas'), ('jensing'), ('johan');
@ -1777,7 +1777,7 @@ a b
set engine_condition_pushdown = on;
explain select * from t5 where b like '%jo%';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t5 ALL NULL NULL NULL NULL # Using where
select * from t5 where b like '%jo%' order by a;
a b
1 jonas
@ -1793,13 +1793,13 @@ auto
set engine_condition_pushdown = on;
explain select auto from t1 where date_time like '1902-02-02 %';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where
select auto from t1 where date_time like '1902-02-02 %' order by auto;
auto
2
explain select auto from t1 where date_time not like '1902-02-02 %';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where
select auto from t1 where date_time not like '1902-02-02 %' order by auto;
auto
3

View file

@ -441,7 +441,7 @@ INSERT INTO test.t1 values(1,@vc1,@d1);
INSERT INTO test.t1 values(2,@vc2,@d2);
explain SELECT * from test.t1 WHERE a1 = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t1 const PRIMARY PRIMARY 4 const #
SELECT a1,length(a2),substr(a2,1+2*900,2),length(a3),substr(a3,1+3*900,3)
FROM test.t1 WHERE a1=1 ORDER BY a1;
a1 length(a2) substr(a2,1+2*900,2) length(a3) substr(a3,1+3*900,3)

View file

@ -663,7 +663,7 @@ set autocommit=1;
show session variables like 'ndb_index_stat_%';
Variable_name Value
ndb_index_stat_cache_entries 32
ndb_index_stat_enable ON
ndb_index_stat_enable OFF
ndb_index_stat_update_freq 20
set ndb_index_stat_enable = off;
show session variables like 'ndb_index_stat_%';
@ -794,5 +794,5 @@ set ndb_index_stat_update_freq = @@global.ndb_index_stat_update_freq;
show session variables like 'ndb_index_stat_%';
Variable_name Value
ndb_index_stat_cache_entries 32
ndb_index_stat_enable ON
ndb_index_stat_enable OFF
ndb_index_stat_update_freq 20

View file

@ -8,32 +8,32 @@ insert into t1 values (1,1,1),(2,2,2),(3,3,3);
insert into t2 values (1,1,1),(2,2,2),(3,3,3), (4,4,4), (5,5,5);
explain select * from t2 where p NOT IN (select p from t1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where
2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index
1 PRIMARY t2 ALL NULL NULL NULL NULL # Using where
2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func # Using index
select * from t2 where p NOT IN (select p from t1) order by p;
p u o
4 4 4
5 5 5
explain select * from t2 where p NOT IN (select u from t1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where
2 DEPENDENT SUBQUERY t1 unique_subquery u u 4 func 1 Using index
1 PRIMARY t2 ALL NULL NULL NULL NULL # Using where
2 DEPENDENT SUBQUERY t1 unique_subquery u u 4 func # Using index
select * from t2 where p NOT IN (select u from t1) order by p;
p u o
4 4 4
5 5 5
explain select * from t2 where p NOT IN (select o from t1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where
2 DEPENDENT SUBQUERY t1 index_subquery o o 4 func 1 Using index
1 PRIMARY t2 ALL NULL NULL NULL NULL # Using where
2 DEPENDENT SUBQUERY t1 index_subquery o o 4 func # Using index
select * from t2 where p NOT IN (select o from t1) order by p;
p u o
4 4 4
5 5 5
explain select * from t2 where p NOT IN (select p+0 from t1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where
1 PRIMARY t2 ALL NULL NULL NULL NULL # Using where
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL # Using where
select * from t2 where p NOT IN (select p+0 from t1) order by p;
p u o
4 4 4

View file

@ -550,6 +550,7 @@ index(a12345678901234567890123456789a1234567890)
) engine=ndb;
show tables;
insert into t1 values (1,1),(2,1),(3,1),(4,1),(5,2),(6,1),(7,1);
--replace_column 9 #
explain select * from t1 where a12345678901234567890123456789a1234567890=2;
select * from t1 where a12345678901234567890123456789a1234567890=2;
drop table t1;

View file

@ -65,6 +65,7 @@ select length(@x0),length(@b2),length(@d2) from dual;
insert into t1 values(1,@b1,111,@d1);
insert into t1 values(2,@b2,222,@d2);
commit;
--replace_column 9 #
explain select * from t1 where a = 1;
# pk read
@ -108,6 +109,7 @@ select count(*) from t1;
replace t1 set a=1,b=@b1,c=111,d=@d1;
replace t1 set a=2,b=@b2,c=222,d=@d2;
commit;
--replace_column 9 #
explain select * from t1 where a = 1;
# pk read
@ -150,6 +152,7 @@ select count(*) from t1;
insert into t1 values(1,@b1,111,@d1);
insert into t1 values(2,@b2,222,@d2);
commit;
--replace_column 9 #
explain select * from t1 where c = 111;
# hash key read
@ -190,6 +193,7 @@ insert into t1 values(7,'b7',777,'dd7');
insert into t1 values(8,'b8',888,'dd8');
insert into t1 values(9,'b9',999,'dd9');
commit;
--replace_column 9 #
explain select * from t1;
# table scan read
@ -210,6 +214,7 @@ select count(*) from t1;
insert into t1 values(1,@b1,111,@d1);
insert into t1 values(2,@b2,222,@d2);
commit;
--replace_column 9 #
explain select * from t1;
# table scan read
@ -239,6 +244,7 @@ insert into t1 values(7,'b7',777,'dd7');
insert into t1 values(8,'b8',888,'dd8');
insert into t1 values(9,'b9',999,'dd9');
commit;
--replace_column 9 #
explain select * from t1 where c >= 100 order by a;
# range scan read
@ -260,6 +266,7 @@ select count(*) from t1;
insert into t1 values(1,@b1,111,@d1);
insert into t1 values(2,@b2,222,@d2);
commit;
--replace_column 9 #
explain select * from t1 where c >= 100 order by a;
# range scan read

View file

@ -159,8 +159,9 @@ insert into t1 values(5, 'aaa');
insert into t1 values(6, 'AAA');
# 6
select * from t1 order by p;
# plan
explain select * from t1 where a = 'zZz' order by p;
# plan too flaky
#--replace_column 9 #
#explain select * from t1 where a = 'zZz' order by p;
# 2
select * from t1 where a = 'aAa' order by p;
# 2
@ -187,8 +188,9 @@ insert into t1 values(5, 'aaa');
insert into t1 values(6, 'AAA');
# 6
select * from t1 order by p;
# plan
explain select * from t1 where a = 'zZz' order by p;
# plan too flaky
#--replace_column 9 #
#explain select * from t1 where a = 'zZz' order by p;
# 6
select * from t1 where a = 'aAa' order by p;
# 6

View file

@ -456,6 +456,7 @@ select * from t3,t4 where t4.attr1 > 1 and t4.attr2 = t3.attr2 and t4.attr3 < 5
set engine_condition_pushdown = on;
# Test all types and compare operators
--replace_column 9 #
explain
select auto from t1 where
string = "aaaa" and
@ -511,6 +512,7 @@ time_field = '01:01:01' and
date_time = '1901-01-01 01:01:01'
order by auto;
--replace_column 9 #
explain
select auto from t1 where
string != "aaaa" and
@ -566,6 +568,7 @@ time_field != '01:01:01' and
date_time != '1901-01-01 01:01:01'
order by auto;
--replace_column 9 #
explain
select auto from t1 where
string > "aaaa" and
@ -621,6 +624,7 @@ time_field > '01:01:01' and
date_time > '1901-01-01 01:01:01'
order by auto;
--replace_column 9 #
explain
select auto from t1 where
string >= "aaaa" and
@ -676,6 +680,7 @@ time_field >= '01:01:01' and
date_time >= '1901-01-01 01:01:01'
order by auto;
--replace_column 9 #
explain
select auto from t1 where
string < "dddd" and
@ -731,6 +736,7 @@ time_field < '04:04:04' and
date_time < '1904-04-04 04:04:04'
order by auto;
--replace_column 9 #
explain
select auto from t1 where
string <= "dddd" and
@ -790,6 +796,7 @@ order by auto;
create index medium_index on t1(medium);
# Test all types and compare operators
--replace_column 9 #
explain
select auto from t1 where
string = "aaaa" and
@ -845,6 +852,7 @@ time_field = '01:01:01' and
date_time = '1901-01-01 01:01:01'
order by auto;
--replace_column 9 #
explain
select auto from t1 where
string != "aaaa" and
@ -900,6 +908,7 @@ time_field != '01:01:01' and
date_time != '1901-01-01 01:01:01'
order by auto;
--replace_column 9 #
explain
select auto from t1 where
string > "aaaa" and
@ -955,6 +964,7 @@ time_field > '01:01:01' and
date_time > '1901-01-01 01:01:01'
order by auto;
--replace_column 9 #
explain
select auto from t1 where
string >= "aaaa" and
@ -1010,6 +1020,7 @@ time_field >= '01:01:01' and
date_time >= '1901-01-01 01:01:01'
order by auto;
--replace_column 9 #
explain
select auto from t1 where
string < "dddd" and
@ -1065,6 +1076,7 @@ time_field < '04:04:04' and
date_time < '1904-04-04 04:04:04'
order by auto;
--replace_column 9 #
explain
select auto from t1 where
string <= "dddd" and
@ -1121,6 +1133,7 @@ date_time <= '1904-04-04 04:04:04'
order by auto;
# Test LIKE/NOT LIKE
--replace_column 9 #
explain
select auto from t1 where
string like "b%" and
@ -1136,6 +1149,7 @@ bin like concat(0xBB, '%') and
vbin like concat(0xBB, '%')
order by auto;
--replace_column 9 #
explain
select auto from t1 where
string not like "b%" and
@ -1152,6 +1166,7 @@ vbin not like concat(0xBB, '%')
order by auto;
# BETWEEN
--replace_column 9 #
explain
select auto from t1 where
(string between "aaaa" and "cccc") and
@ -1201,6 +1216,7 @@ select auto from t1 where
(date_time between '1901-01-01 01:01:01' and '1903-03-03 03:03:03')
order by auto;
--replace_column 9 #
explain
select auto from t1 where
("aaaa" between string and string) and
@ -1251,6 +1267,7 @@ select auto from t1 where
order by auto;
# NOT BETWEEN
--replace_column 9 #
explain
select auto from t1 where
(string not between "aaaa" and "cccc") and
@ -1300,6 +1317,7 @@ select auto from t1 where
(date_time not between '1901-01-01 01:01:01' and '1903-03-03 03:03:03')
order by auto;
--replace_column 9 #
explain
select auto from t1 where
("aaaa" not between string and string) and
@ -1350,6 +1368,7 @@ select auto from t1 where
order by auto;
# IN
--replace_column 9 #
explain
select auto from t1 where
string in("aaaa","cccc") and
@ -1399,6 +1418,7 @@ time_field in('01:01:01','03:03:03') and
date_time in('1901-01-01 01:01:01','1903-03-03 03:03:03')
order by auto;
--replace_column 9 #
explain
select auto from t1 where
"aaaa" in(string) and
@ -1449,6 +1469,7 @@ select auto from t1 where
order by auto;
# NOT IN
--replace_column 9 #
explain
select auto from t1 where
string not in("aaaa","cccc") and
@ -1498,6 +1519,7 @@ time_field not in('01:01:01','03:03:03') and
date_time not in('1901-01-01 01:01:01','1903-03-03 03:03:03')
order by auto;
--replace_column 9 #
explain
select auto from t1 where
"aaaa" not in(string) and
@ -1607,35 +1629,44 @@ date_time = '1901-01-01 01:01:01';
select count(*) from t1;
# Various tests
--replace_column 9 #
explain
select * from t2 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
select * from t2 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
--replace_column 9 #
explain
select * from t2 where attr3 is not null and attr1 > 2 order by pk1;
select * from t2 where attr3 is not null and attr1 > 2 order by pk1;
--replace_column 9 #
explain
select * from t3 where attr2 > 9223372036854775803 and attr3 != 3 order by pk1;
select * from t3 where attr2 > 9223372036854775803 and attr3 != 3 order by pk1;
--replace_column 9 #
explain
select * from t2,t3 where t2.attr1 < 1 and t2.attr2 = t3.attr2 and t3.attr1 < 5 order by t2.pk1;
select * from t2,t3 where t2.attr1 < 1 and t2.attr2 = t3.attr2 and t3.attr1 < 5 order by t2.pk1;
--replace_column 9 #
explain
select * from t4 where attr1 < 5 and attr2 > 9223372036854775803 and attr3 != 3 order by t4.pk1;
select * from t4 where attr1 < 5 and attr2 > 9223372036854775803 and attr3 != 3 order by t4.pk1;
--replace_column 9 #
explain
select * from t3,t4 where t4.attr1 > 1 and t4.attr2 = t3.attr2 and t4.attr3 < 5 order by t4.pk1;
select * from t3,t4 where t4.attr1 > 1 and t4.attr2 = t3.attr2 and t4.attr3 < 5 order by t4.pk1;
# Some tests that are currently not supported and should not push condition
--replace_column 9 #
explain
select auto from t1 where string = "aaaa" collate latin1_general_ci order by auto;
--replace_column 9 #
explain
select * from t2 where (attr1 < 2) = (attr2 < 2) order by pk1;
--replace_column 9 #
explain
select * from t3 left join t4 on t4.attr2 = t3.attr2 where t4.attr1 > 1 and t4.attr3 < 5 or t4.attr1 is null order by t4.pk1;
@ -1646,6 +1677,7 @@ insert into t5 (b) values ('jonas'), ('jensing'), ('johan');
set engine_condition_pushdown = off;
select * from t5 where b like '%jo%' order by a;
set engine_condition_pushdown = on;
--replace_column 9 #
explain select * from t5 where b like '%jo%';
select * from t5 where b like '%jo%' order by a;
@ -1654,8 +1686,10 @@ set engine_condition_pushdown = off;
select auto from t1 where date_time like '1902-02-02 %' order by auto;
select auto from t1 where date_time not like '1902-02-02 %' order by auto;
set engine_condition_pushdown = on;
--replace_column 9 #
explain select auto from t1 where date_time like '1902-02-02 %';
select auto from t1 where date_time like '1902-02-02 %' order by auto;
--replace_column 9 #
explain select auto from t1 where date_time not like '1902-02-02 %';
select auto from t1 where date_time not like '1902-02-02 %' order by auto;

View file

@ -480,6 +480,7 @@ select length(@x0),length(@b2),length(@d2) from dual;
INSERT INTO test.t1 values(1,@vc1,@d1);
INSERT INTO test.t1 values(2,@vc2,@d2);
--replace_column 9 #
explain SELECT * from test.t1 WHERE a1 = 1;
SELECT a1,length(a2),substr(a2,1+2*900,2),length(a3),substr(a3,1+3*900,3)

View file

@ -18,18 +18,22 @@ insert into t1 values (1,1,1),(2,2,2),(3,3,3);
insert into t2 values (1,1,1),(2,2,2),(3,3,3), (4,4,4), (5,5,5);
# Use pk
--replace_column 9 #
explain select * from t2 where p NOT IN (select p from t1);
select * from t2 where p NOT IN (select p from t1) order by p;
# Use unique index
--replace_column 9 #
explain select * from t2 where p NOT IN (select u from t1);
select * from t2 where p NOT IN (select u from t1) order by p;
# Use ordered index
--replace_column 9 #
explain select * from t2 where p NOT IN (select o from t1);
select * from t2 where p NOT IN (select o from t1) order by p;
# Use scan
--replace_column 9 #
explain select * from t2 where p NOT IN (select p+0 from t1);
select * from t2 where p NOT IN (select p+0 from t1) order by p;

View file

@ -10491,7 +10491,7 @@ static int ndbcluster_fill_files_table(handlerton *hton,
while ((id= g_ndb_cluster_connection->get_next_node(iter)))
{
uint c= 0;
init_fill_schema_files_row(table);
NdbDictionary::Datafile df= dict->getDatafile(id, elt.name);
ndberr= dict->getNdbError();
if(ndberr.classification != NdbError::NoError)
@ -10509,76 +10509,48 @@ static int ndbcluster_fill_files_table(handlerton *hton,
ERR_RETURN(ndberr);
}
table->field[c++]->set_null(); // FILE_ID
table->field[c]->set_notnull();
table->field[c++]->store(elt.name, strlen(elt.name),
system_charset_info);
table->field[c]->set_notnull();
table->field[c++]->store("DATAFILE",8,system_charset_info);
table->field[c]->set_notnull();
table->field[c++]->store(df.getTablespace(), strlen(df.getTablespace()),
system_charset_info);
table->field[c++]->set_null(); // TABLE_CATALOG
table->field[c++]->set_null(); // TABLE_SCHEMA
table->field[c++]->set_null(); // TABLE_NAME
table->field[IS_FILES_FILE_NAME]->set_notnull();
table->field[IS_FILES_FILE_NAME]->store(elt.name, strlen(elt.name),
system_charset_info);
table->field[IS_FILES_FILE_TYPE]->set_notnull();
table->field[IS_FILES_FILE_TYPE]->store("DATAFILE",8,
system_charset_info);
table->field[IS_FILES_TABLESPACE_NAME]->set_notnull();
table->field[IS_FILES_TABLESPACE_NAME]->store(df.getTablespace(),
strlen(df.getTablespace()),
system_charset_info);
table->field[IS_FILES_LOGFILE_GROUP_NAME]->set_notnull();
table->field[IS_FILES_LOGFILE_GROUP_NAME]->
store(ts.getDefaultLogfileGroup(),
strlen(ts.getDefaultLogfileGroup()),
system_charset_info);
table->field[IS_FILES_ENGINE]->set_notnull();
table->field[IS_FILES_ENGINE]->store(ndbcluster_hton_name,
ndbcluster_hton_name_length,
system_charset_info);
// LOGFILE_GROUP_NAME
table->field[c]->set_notnull();
table->field[c++]->store(ts.getDefaultLogfileGroup(),
strlen(ts.getDefaultLogfileGroup()),
system_charset_info);
table->field[c++]->set_null(); // LOGFILE_GROUP_NUMBER
table->field[c]->set_notnull();
table->field[c++]->store(ndbcluster_hton_name,
ndbcluster_hton_name_length,
system_charset_info); // ENGINE
table->field[IS_FILES_FREE_EXTENTS]->set_notnull();
table->field[IS_FILES_FREE_EXTENTS]->store(df.getFree()
/ ts.getExtentSize());
table->field[IS_FILES_TOTAL_EXTENTS]->set_notnull();
table->field[IS_FILES_TOTAL_EXTENTS]->store(df.getSize()
/ ts.getExtentSize());
table->field[IS_FILES_EXTENT_SIZE]->set_notnull();
table->field[IS_FILES_EXTENT_SIZE]->store(ts.getExtentSize());
table->field[IS_FILES_INITIAL_SIZE]->set_notnull();
table->field[IS_FILES_INITIAL_SIZE]->store(df.getSize());
table->field[IS_FILES_MAXIMUM_SIZE]->set_notnull();
table->field[IS_FILES_MAXIMUM_SIZE]->store(df.getSize());
table->field[IS_FILES_VERSION]->set_notnull();
table->field[IS_FILES_VERSION]->store(df.getObjectVersion());
table->field[c++]->set_null(); // FULLTEXT_KEYS
table->field[c++]->set_null(); // DELETED_ROWS
table->field[c++]->set_null(); // UPDATE_COUNT
table->field[c]->set_notnull();
table->field[c++]->store(df.getFree() / ts.getExtentSize()); // FREE_EXTENTS
table->field[c]->set_notnull();
table->field[c++]->store(df.getSize() / ts.getExtentSize()); // TOTAL_EXTENTS
table->field[c]->set_notnull();
table->field[c++]->store(ts.getExtentSize()); // EXTENT_SIZE
table->field[c]->set_notnull();
table->field[c++]->store(df.getSize()); // INITIAL_SIZE
table->field[c]->set_notnull();
table->field[c++]->store(df.getSize()); // MAXIMUM_SIZE
table->field[c++]->set_null(); // AUTOEXTEND_SIZE
table->field[c++]->set_null(); // CREATION_TIME
table->field[c++]->set_null(); // LAST_UPDATE_TIME
table->field[c++]->set_null(); // LAST_ACCESS_TIME
table->field[c++]->set_null(); // RECOVER_TIME
table->field[c++]->set_null(); // TRANSACTION_COUNTER
table->field[c]->set_notnull();
table->field[c++]->store(df.getObjectVersion()); // VERSION
table->field[c]->set_notnull();
table->field[c++]->store("FIXED", 5, system_charset_info); // ROW_FORMAT
table->field[c++]->set_null(); // TABLE_ROWS
table->field[c++]->set_null(); // AVG_ROW_LENGTH
table->field[c++]->set_null(); // DATA_LENGTH
table->field[c++]->set_null(); // MAX_DATA_LENGTH
table->field[c++]->set_null(); // INDEX_LENGTH
table->field[c++]->set_null(); // DATA_FREE
table->field[c++]->set_null(); // CREATE_TIME
table->field[c++]->set_null(); // UPDATE_TIME
table->field[c++]->set_null(); // CHECK_TIME
table->field[c++]->set_null(); // CHECKSUM
table->field[c]->set_notnull();
table->field[c++]->store("NORMAL", 6, system_charset_info);
table->field[IS_FILES_ROW_FORMAT]->set_notnull();
table->field[IS_FILES_ROW_FORMAT]->store("FIXED", 5, system_charset_info);
char extra[30];
int len= my_snprintf(extra, sizeof(extra), "CLUSTER_NODE=%u", id);
table->field[c]->store(extra, len, system_charset_info);
table->field[c]->set_notnull();
table->field[IS_FILES_EXTRA]->set_notnull();
table->field[IS_FILES_EXTRA]->store(extra, len, system_charset_info);
schema_table_store_record(thd, table);
}
}
@ -10617,76 +10589,43 @@ static int ndbcluster_fill_files_table(handlerton *hton,
ERR_RETURN(ndberr);
}
int c= 0;
table->field[c++]->set_null(); // FILE_ID
table->field[c]->set_notnull();
table->field[c++]->store(elt.name, strlen(elt.name),
system_charset_info);
table->field[c]->set_notnull();
table->field[c++]->store("UNDO LOG", 8, system_charset_info);
table->field[c++]->set_null(); // TABLESPACE NAME
table->field[c++]->set_null(); // TABLE_CATALOG
table->field[c++]->set_null(); // TABLE_SCHEMA
table->field[c++]->set_null(); // TABLE_NAME
// LOGFILE_GROUP_NAME
init_fill_schema_files_row(table);
table->field[IS_FILES_FILE_NAME]->set_notnull();
table->field[IS_FILES_FILE_NAME]->store(elt.name, strlen(elt.name),
system_charset_info);
table->field[IS_FILES_FILE_TYPE]->set_notnull();
table->field[IS_FILES_FILE_TYPE]->store("UNDO LOG", 8,
system_charset_info);
NdbDictionary::ObjectId objid;
uf.getLogfileGroupId(&objid);
table->field[c]->set_notnull();
table->field[c++]->store(uf.getLogfileGroup(),
strlen(uf.getLogfileGroup()),
system_charset_info);
table->field[c]->set_notnull();
table->field[c++]->store(objid.getObjectId()); // LOGFILE_GROUP_NUMBER
table->field[c]->set_notnull();
table->field[c++]->store(ndbcluster_hton_name,
ndbcluster_hton_name_length,
system_charset_info); // ENGINE
table->field[IS_FILES_LOGFILE_GROUP_NAME]->set_notnull();
table->field[IS_FILES_LOGFILE_GROUP_NAME]->store(uf.getLogfileGroup(),
strlen(uf.getLogfileGroup()),
system_charset_info);
table->field[IS_FILES_LOGFILE_GROUP_NUMBER]->set_notnull();
table->field[IS_FILES_LOGFILE_GROUP_NUMBER]->store(objid.getObjectId());
table->field[IS_FILES_ENGINE]->set_notnull();
table->field[IS_FILES_ENGINE]->store(ndbcluster_hton_name,
ndbcluster_hton_name_length,
system_charset_info);
table->field[c++]->set_null(); // FULLTEXT_KEYS
table->field[c++]->set_null(); // DELETED_ROWS
table->field[c++]->set_null(); // UPDATE_COUNT
table->field[c++]->set_null(); // FREE_EXTENTS
table->field[c]->set_notnull();
table->field[c++]->store(uf.getSize()/4); // TOTAL_EXTENTS
table->field[c]->set_notnull();
table->field[c++]->store(4); // EXTENT_SIZE
table->field[IS_FILES_TOTAL_EXTENTS]->set_notnull();
table->field[IS_FILES_TOTAL_EXTENTS]->store(uf.getSize()/4);
table->field[IS_FILES_EXTENT_SIZE]->set_notnull();
table->field[IS_FILES_EXTENT_SIZE]->store(4);
table->field[c]->set_notnull();
table->field[c++]->store(uf.getSize()); // INITIAL_SIZE
table->field[c]->set_notnull();
table->field[c++]->store(uf.getSize()); // MAXIMUM_SIZE
table->field[c++]->set_null(); // AUTOEXTEND_SIZE
table->field[IS_FILES_INITIAL_SIZE]->set_notnull();
table->field[IS_FILES_INITIAL_SIZE]->store(uf.getSize());
table->field[IS_FILES_MAXIMUM_SIZE]->set_notnull();
table->field[IS_FILES_MAXIMUM_SIZE]->store(uf.getSize());
table->field[c++]->set_null(); // CREATION_TIME
table->field[c++]->set_null(); // LAST_UPDATE_TIME
table->field[c++]->set_null(); // LAST_ACCESS_TIME
table->field[c++]->set_null(); // RECOVER_TIME
table->field[c++]->set_null(); // TRANSACTION_COUNTER
table->field[c]->set_notnull();
table->field[c++]->store(uf.getObjectVersion()); // VERSION
table->field[c++]->set_null(); // ROW FORMAT
table->field[c++]->set_null(); // TABLE_ROWS
table->field[c++]->set_null(); // AVG_ROW_LENGTH
table->field[c++]->set_null(); // DATA_LENGTH
table->field[c++]->set_null(); // MAX_DATA_LENGTH
table->field[c++]->set_null(); // INDEX_LENGTH
table->field[c++]->set_null(); // DATA_FREE
table->field[c++]->set_null(); // CREATE_TIME
table->field[c++]->set_null(); // UPDATE_TIME
table->field[c++]->set_null(); // CHECK_TIME
table->field[c++]->set_null(); // CHECKSUM
table->field[c]->set_notnull();
table->field[c++]->store("NORMAL", 6, system_charset_info);
table->field[IS_FILES_VERSION]->set_notnull();
table->field[IS_FILES_VERSION]->store(uf.getObjectVersion());
char extra[100];
int len= my_snprintf(extra,sizeof(extra),"CLUSTER_NODE=%u;UNDO_BUFFER_SIZE=%lu",id,lfg.getUndoBufferSize());
table->field[c]->set_notnull();
table->field[c]->store(extra, len, system_charset_info);
table->field[IS_FILES_EXTRA]->set_notnull();
table->field[IS_FILES_EXTRA]->store(extra, len, system_charset_info);
schema_table_store_record(thd, table);
}
}
@ -10712,69 +10651,36 @@ static int ndbcluster_fill_files_table(handlerton *hton,
ERR_RETURN(ndberr);
}
int c= 0;
table->field[c++]->set_null(); // FILE_ID
table->field[c++]->set_null(); // name
table->field[c]->set_notnull();
table->field[c++]->store("UNDO LOG", 8, system_charset_info);
table->field[c++]->set_null(); // TABLESPACE NAME
table->field[c++]->set_null(); // TABLE_CATALOG
table->field[c++]->set_null(); // TABLE_SCHEMA
table->field[c++]->set_null(); // TABLE_NAME
init_fill_schema_files_row(table);
table->field[IS_FILES_FILE_TYPE]->set_notnull();
table->field[IS_FILES_FILE_TYPE]->store("UNDO LOG", 8,
system_charset_info);
// LOGFILE_GROUP_NAME
table->field[c]->set_notnull();
table->field[c++]->store(elt.name, strlen(elt.name),
system_charset_info);
table->field[c]->set_notnull();
table->field[c++]->store(lfg.getObjectId()); // LOGFILE_GROUP_NUMBER
table->field[c]->set_notnull();
table->field[c++]->store(ndbcluster_hton_name,
ndbcluster_hton_name_length,
system_charset_info); // ENGINE
table->field[IS_FILES_LOGFILE_GROUP_NAME]->set_notnull();
table->field[IS_FILES_LOGFILE_GROUP_NAME]->store(elt.name,
strlen(elt.name),
system_charset_info);
table->field[IS_FILES_LOGFILE_GROUP_NUMBER]->set_notnull();
table->field[IS_FILES_LOGFILE_GROUP_NUMBER]->store(lfg.getObjectId());
table->field[IS_FILES_ENGINE]->set_notnull();
table->field[IS_FILES_ENGINE]->store(ndbcluster_hton_name,
ndbcluster_hton_name_length,
system_charset_info);
table->field[c++]->set_null(); // FULLTEXT_KEYS
table->field[c++]->set_null(); // DELETED_ROWS
table->field[c++]->set_null(); // UPDATE_COUNT
table->field[c]->set_notnull();
table->field[c++]->store(lfg.getUndoFreeWords()); // FREE_EXTENTS
table->field[c++]->set_null(); //store(uf.getSize()/4); // TOTAL_EXTENTS
table->field[c]->set_notnull();
table->field[c++]->store(4); // EXTENT_SIZE
table->field[IS_FILES_FREE_EXTENTS]->set_notnull();
table->field[IS_FILES_FREE_EXTENTS]->store(lfg.getUndoFreeWords());
table->field[IS_FILES_EXTENT_SIZE]->set_notnull();
table->field[IS_FILES_EXTENT_SIZE]->store(4);
table->field[c++]->set_null();//store(uf.getSize()); // INITIAL_SIZE
table->field[c++]->set_null(); //store(uf.getSize()); // MAXIMUM_SIZE
table->field[c++]->set_null(); // AUTOEXTEND_SIZE
table->field[c++]->set_null(); // CREATION_TIME
table->field[c++]->set_null(); // LAST_UPDATE_TIME
table->field[c++]->set_null(); // LAST_ACCESS_TIME
table->field[c++]->set_null(); // RECOVER_TIME
table->field[c++]->set_null(); // TRANSACTION_COUNTER
table->field[c]->set_notnull();
table->field[c++]->store(lfg.getObjectVersion()); // VERSION
table->field[c++]->set_null(); // ROW FORMAT
table->field[c++]->set_null(); // TABLE_ROWS
table->field[c++]->set_null(); // AVG_ROW_LENGTH
table->field[c++]->set_null(); // DATA_LENGTH
table->field[c++]->set_null(); // MAX_DATA_LENGTH
table->field[c++]->set_null(); // INDEX_LENGTH
table->field[c++]->set_null(); // DATA_FREE
table->field[c++]->set_null(); // CREATE_TIME
table->field[c++]->set_null(); // UPDATE_TIME
table->field[c++]->set_null(); // CHECK_TIME
table->field[c++]->set_null(); // CHECKSUM
table->field[c]->set_notnull();
table->field[c++]->store("NORMAL", 6, system_charset_info);
table->field[IS_FILES_VERSION]->set_notnull();
table->field[IS_FILES_VERSION]->store(lfg.getObjectVersion());
char extra[100];
int len= my_snprintf(extra,sizeof(extra),"UNDO_BUFFER_SIZE=%lu",id,lfg.getUndoBufferSize());
table->field[c]->set_notnull();
table->field[c]->store(extra, len, system_charset_info);
int len= my_snprintf(extra,sizeof(extra),
"UNDO_BUFFER_SIZE=%lu",
lfg.getUndoBufferSize());
table->field[IS_FILES_EXTRA]->set_notnull();
table->field[IS_FILES_EXTRA]->store(extra, len, system_charset_info);
schema_table_store_record(thd, table);
}
DBUG_RETURN(0);

View file

@ -2007,6 +2007,45 @@ inline void kill_delayed_threads(void) {}
#endif
/* Used by handlers to store things in schema tables */
#define IS_FILES_FILE_ID 0
#define IS_FILES_FILE_NAME 1
#define IS_FILES_FILE_TYPE 2
#define IS_FILES_TABLESPACE_NAME 3
#define IS_FILES_TABLE_CATALOG 4
#define IS_FILES_TABLE_SCHEMA 5
#define IS_FILES_TABLE_NAME 6
#define IS_FILES_LOGFILE_GROUP_NAME 7
#define IS_FILES_LOGFILE_GROUP_NUMBER 8
#define IS_FILES_ENGINE 9
#define IS_FILES_FULLTEXT_KEYS 10
#define IS_FILES_DELETED_ROWS 11
#define IS_FILES_UPDATE_COUNT 12
#define IS_FILES_FREE_EXTENTS 13
#define IS_FILES_TOTAL_EXTENTS 14
#define IS_FILES_EXTENT_SIZE 15
#define IS_FILES_INITIAL_SIZE 16
#define IS_FILES_MAXIMUM_SIZE 17
#define IS_FILES_AUTOEXTEND_SIZE 18
#define IS_FILES_CREATION_TIME 19
#define IS_FILES_LAST_UPDATE_TIME 20
#define IS_FILES_LAST_ACCESS_TIME 21
#define IS_FILES_RECOVER_TIME 22
#define IS_FILES_TRANSACTION_COUNTER 23
#define IS_FILES_VERSION 24
#define IS_FILES_ROW_FORMAT 25
#define IS_FILES_TABLE_ROWS 26
#define IS_FILES_AVG_ROW_LENGTH 27
#define IS_FILES_DATA_LENGTH 28
#define IS_FILES_MAX_DATA_LENGTH 29
#define IS_FILES_INDEX_LENGTH 30
#define IS_FILES_DATA_FREE 31
#define IS_FILES_CREATE_TIME 32
#define IS_FILES_UPDATE_TIME 33
#define IS_FILES_CHECK_TIME 34
#define IS_FILES_CHECKSUM 35
#define IS_FILES_STATUS 36
#define IS_FILES_EXTRA 37
void init_fill_schema_files_row(TABLE* table);
bool schema_table_store_record(THD *thd, TABLE *table);
#endif /* MYSQL_SERVER */

View file

@ -4704,7 +4704,6 @@ enum options_mysqld
OPT_NDB_MGMD, OPT_NDB_NODEID,
OPT_NDB_DISTRIBUTION,
OPT_NDB_INDEX_STAT_ENABLE,
OPT_NDB_INDEX_STAT_CACHE_ENTRIES, OPT_NDB_INDEX_STAT_UPDATE_FREQ,
OPT_NDB_EXTRA_LOGGING,
OPT_NDB_REPORT_THRESH_BINLOG_EPOCH_SLIP,
OPT_NDB_REPORT_THRESH_BINLOG_MEM_USAGE,
@ -5414,19 +5413,7 @@ Disable with --skip-ndbcluster (will save memory).",
"Use ndb index statistics in query optimization.",
(gptr*) &global_system_variables.ndb_index_stat_enable,
(gptr*) &max_system_variables.ndb_index_stat_enable,
0, GET_BOOL, OPT_ARG, 1, 0, 1, 0, 0, 0},
{"ndb-index-stat-cache-entries", OPT_NDB_INDEX_STAT_CACHE_ENTRIES,
"Number of start/end keys to store in statistics memory cache."
" Zero means no cache and forces query of db nodes always.",
(gptr*) &global_system_variables.ndb_index_stat_cache_entries,
(gptr*) &max_system_variables.ndb_index_stat_cache_entries,
0, GET_ULONG, OPT_ARG, 32, 0, ~0L, 0, 0, 0},
{"ndb-index-stat-update-freq", OPT_NDB_INDEX_STAT_UPDATE_FREQ,
"How often, in the long run, to query db nodes instead of statistics cache."
" For example 20 means every 20th time.",
(gptr*) &global_system_variables.ndb_index_stat_update_freq,
(gptr*) &max_system_variables.ndb_index_stat_update_freq,
0, GET_ULONG, OPT_ARG, 20, 0, ~0L, 0, 0, 0},
0, GET_BOOL, OPT_ARG, 0, 0, 1, 0, 0, 0},
#endif
{"ndb-use-copying-alter-table",
OPT_NDB_USE_COPYING_ALTER_TABLE,
@ -7055,7 +7042,7 @@ static void mysql_init_variables(void)
#endif
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
have_ndbcluster=SHOW_OPTION_DISABLED;
global_system_variables.ndb_index_stat_enable=TRUE;
global_system_variables.ndb_index_stat_enable=FALSE;
max_system_variables.ndb_index_stat_enable=TRUE;
global_system_variables.ndb_index_stat_cache_entries=32;
max_system_variables.ndb_index_stat_cache_entries=~0L;

View file

@ -5642,6 +5642,16 @@ ST_FIELD_INFO files_fields_info[]=
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
};
void init_fill_schema_files_row(TABLE* table)
{
int i;
for(i=0; files_fields_info[i].field_name!=NULL; i++)
table->field[i]->set_null();
table->field[IS_FILES_STATUS]->set_notnull();
table->field[IS_FILES_STATUS]->store("NORMAL", 6, system_charset_info);
}
ST_FIELD_INFO referential_constraints_fields_info[]=
{
{"CONSTRAINT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},

View file

@ -8,7 +8,7 @@ Next DBDICT 6007
Next DBDIH 7178
Next DBTC 8038
Next CMVMI 9000
Next BACKUP 10022
Next BACKUP 10036
Next DBUTIL 11002
Next DBTUX 12008
Next SUMA 13001
@ -411,6 +411,11 @@ Backup Stuff:
10028: Abort backup by error at reception of BACKUP_FRAGMENT_CONF at master (code 305)
10029: Abort backup by error at reception of FSAPPENDCONF in slave (FileOrScanError = 5)
10030: Simulate buffer full from trigger execution => abort backup
10031: Error 331 for dictCommitTableMutex_locked
10032: backup checkscan
10033: backup checkscan
10034: define backup reply error
10035: Fail to allocate buffers
11001: Send UTIL_SEQUENCE_REF (in master)

View file

@ -2004,7 +2004,15 @@ Backup::sendDropTrig(Signal* signal, BackupRecordPtr ptr)
if (ptr.p->slaveData.dropTrig.tableId == RNIL) {
jam();
ptr.p->tables.first(tabPtr);
if(ptr.p->tables.count())
ptr.p->tables.first(tabPtr);
else
{
// Early abort, go to close files
jam();
closeFiles(signal, ptr);
return;
}
} else {
jam();
ndbrequire(findTable(ptr, tabPtr, ptr.p->slaveData.dropTrig.tableId));
@ -2105,8 +2113,11 @@ Backup::execDROP_TRIG_REF(Signal* signal)
BackupRecordPtr ptr;
c_backupPool.getPtr(ptr, ptrI);
ndbout << "ERROR DROPPING TRIGGER: " << ref->getConf()->getTriggerId();
ndbout << " Err: " << (Uint32)ref->getErrorCode() << endl << endl;
if(ref->getConf()->getTriggerId() != -1)
{
ndbout << "ERROR DROPPING TRIGGER: " << ref->getConf()->getTriggerId();
ndbout << " Err: " << (Uint32)ref->getErrorCode() << endl << endl;
}
dropTrigReply(signal, ptr);
}
@ -2538,8 +2549,9 @@ Backup::execDEFINE_BACKUP_REQ(Signal* signal)
files[i].p->filePointer = RNIL;
files[i].p->m_flags = 0;
files[i].p->errorCode = 0;
if(files[i].p->pages.seize(noOfPages[i]) == false) {
if(ERROR_INSERTED(10035) || files[i].p->pages.seize(noOfPages[i]) == false)
{
jam();
DEBUG_OUT("Failed to seize " << noOfPages[i] << " pages");
defineBackupRef(signal, ptr, DefineBackupRef::FailedToAllocateBuffers);
@ -4451,14 +4463,24 @@ Backup::closeFilesDone(Signal* signal, BackupRecordPtr ptr)
}
jam();
BackupFilePtr filePtr;
ptr.p->files.getPtr(filePtr, ptr.p->logFilePtr);
StopBackupConf* conf = (StopBackupConf*)signal->getDataPtrSend();
conf->backupId = ptr.p->backupId;
conf->backupPtr = ptr.i;
conf->noOfLogBytes = filePtr.p->operation.noOfBytes;
conf->noOfLogRecords = filePtr.p->operation.noOfRecords;
BackupFilePtr filePtr;
if(ptr.p->logFilePtr != RNIL)
{
ptr.p->files.getPtr(filePtr, ptr.p->logFilePtr);
conf->noOfLogBytes= filePtr.p->operation.noOfBytes;
conf->noOfLogRecords= filePtr.p->operation.noOfRecords;
}
else
{
conf->noOfLogBytes= 0;
conf->noOfLogRecords= 0;
}
sendSignal(ptr.p->masterRef, GSN_STOP_BACKUP_CONF, signal,
StopBackupConf::SignalLength, JBB);

View file

@ -427,6 +427,7 @@ public:
: slaveState(b, validSlaveTransitions, validSlaveTransitionsCount,1)
, tables(tp), triggers(trp), files(bp)
, masterData(b), backup(b)
, ctlFilePtr(RNIL), logFilePtr(RNIL), dataFilePtr(RNIL)
{
}

View file

@ -36,7 +36,8 @@ testPartitioning \
testBitfield \
DbCreate DbAsyncGenerator \
testSRBank \
test_event_merge
test_event_merge \
testIndexStat
EXTRA_PROGRAMS = \
test_event \
@ -87,6 +88,7 @@ DbAsyncGenerator_SOURCES = bench/mainAsyncGenerator.cpp bench/asyncGenerator.cpp
testSRBank_SOURCES = testSRBank.cpp
test_event_merge_SOURCES = test_event_merge.cpp
test_event_multi_table_SOURCES = test_event_multi_table.cpp
testIndexStat_SOURCES = testIndexStat.cpp
INCLUDES_LOC = -I$(top_srcdir)/storage/ndb/include/kernel
@ -168,3 +170,4 @@ testScan.dsp: Makefile \
@$(top_srcdir)/storage/ndb/config/win-sources $@ $(testScan_SOURCES)
@$(top_srcdir)/storage/ndb/config/win-libraries $@ LINK $(LDADD)

File diff suppressed because it is too large Load diff

View file

@ -350,7 +350,8 @@ int
FailS_codes[] = {
10025,
10027,
10033
10033,
10035
};
int
@ -362,7 +363,8 @@ FailM_codes[] = {
10027,
10028,
10031,
10033
10033,
10035
};
int