Skip to content

Commit 29cf37a

Browse files
author
magnus.blaudd@oracle.com
committed
Merge 5.5-cluster -> trunk-cluster
2 parents 13272c9 + 4ea307f commit 29cf37a

File tree

148 files changed

+1752
-726
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+1752
-726
lines changed

mysql-test/include/not_ndb_is.inc

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Check if cluster is available by selecting from is.engines
3+
# if an error about no such table occurs bail out
4+
#
5+
6+
disable_result_log;
7+
disable_query_log;
8+
9+
--error 0, 1109
10+
select @have_ndb_is:= count(*) from information_schema.plugins
11+
where plugin_name like '%ndb%'
12+
and PLUGIN_TYPE = 'INFORMATION SCHEMA';
13+
14+
15+
if ($mysql_errno){
16+
# For backward compatibility, implement old fashioned way
17+
# to check here ie. use SHOW VARIABLES LIKE "have_ndb"
18+
die Can not determine if server supports ndb without is.engines table;
19+
}
20+
21+
22+
if (`select @have_ndb_is`){
23+
skip NDB information schema table installed;
24+
}
25+
26+
enable_query_log;
27+
enable_result_log;

mysql-test/r/information_schema.result

+2-1
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,8 @@ count(*) as num1
13171317
from information_schema.tables t
13181318
inner join information_schema.columns c1
13191319
on t.table_schema = c1.table_schema AND t.table_name = c1.table_name
1320-
where t.table_schema = 'information_schema' and
1320+
where t.table_name not like 'ndb%' and
1321+
t.table_schema = 'information_schema' and
13211322
c1.ordinal_position =
13221323
(select isnull(c2.column_type) -
13231324
isnull(group_concat(c2.table_schema, '.', c2.table_name)) +

mysql-test/r/information_schema_db.result

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ drop view if exists v1,v2;
33
drop function if exists f1;
44
drop function if exists f2;
55
use INFORMATION_SCHEMA;
6-
show tables where Tables_in_information_schema NOT LIKE 'Innodb%';
6+
show tables where Tables_in_information_schema NOT LIKE 'Innodb%' and Tables_in_information_schema NOT LIKE 'ndb%';
77
Tables_in_information_schema
88
CHARACTER_SETS
99
COLLATIONS

mysql-test/suite/funcs_1/r/is_columns_is.result

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SELECT * FROM information_schema.columns
22
WHERE table_schema = 'information_schema'
3-
AND table_name <> 'profiling' AND table_name not like 'innodb_%'
3+
AND table_name <> 'profiling' AND table_name not like 'innodb_%' AND table_name not like 'ndb%'
44
ORDER BY table_schema, table_name, column_name;
55
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
66
def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
@@ -347,7 +347,7 @@ CHARACTER_SET_NAME,
347347
COLLATION_NAME
348348
FROM information_schema.columns
349349
WHERE table_schema = 'information_schema'
350-
AND table_name <> 'profiling' AND table_name not like 'innodb_%'
350+
AND table_name <> 'profiling' AND table_name not like 'innodb_%' AND table_name not like 'ndb%'
351351
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
352352
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
353353
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
@@ -359,7 +359,7 @@ CHARACTER_SET_NAME,
359359
COLLATION_NAME
360360
FROM information_schema.columns
361361
WHERE table_schema = 'information_schema'
362-
AND table_name <> 'profiling' AND table_name not like 'innodb_%'
362+
AND table_name <> 'profiling' AND table_name not like 'innodb_%' AND table_name not like 'ndb%'
363363
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
364364
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
365365
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
@@ -371,7 +371,7 @@ CHARACTER_SET_NAME,
371371
COLLATION_NAME
372372
FROM information_schema.columns
373373
WHERE table_schema = 'information_schema'
374-
AND table_name <> 'profiling' AND table_name not like 'innodb_%'
374+
AND table_name <> 'profiling' AND table_name not like 'innodb_%' AND table_name not like 'ndb%'
375375
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
376376
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
377377
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
@@ -393,7 +393,7 @@ COLLATION_NAME,
393393
COLUMN_TYPE
394394
FROM information_schema.columns
395395
WHERE table_schema = 'information_schema'
396-
AND table_name <> 'profiling' AND table_name not like 'innodb_%'
396+
AND table_name <> 'profiling' AND table_name not like 'innodb_%' AND table_name not like 'ndb%'
397397
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
398398
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
399399
3.0000 information_schema CHARACTER_SETS CHARACTER_SET_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)

mysql-test/suite/funcs_1/r/is_tables_is.result

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ AS "user_comment",
1111
'-----------------------------------------------------' AS "Separator"
1212
FROM information_schema.tables
1313
WHERE table_schema = 'information_schema'
14-
AND table_name <> 'profiling' AND table_name not like 'innodb_%'
14+
AND table_name <> 'profiling' AND table_name not like 'innodb_%' AND table_name not like 'ndb%'
1515
ORDER BY table_schema,table_name;
1616
TABLE_CATALOG def
1717
TABLE_SCHEMA information_schema
@@ -718,7 +718,7 @@ AS "user_comment",
718718
'-----------------------------------------------------' AS "Separator"
719719
FROM information_schema.tables
720720
WHERE table_schema = 'information_schema'
721-
AND table_name <> 'profiling' AND table_name not like 'innodb_%'
721+
AND table_name <> 'profiling' AND table_name not like 'innodb_%' AND table_name not like 'ndb%'
722722
ORDER BY table_schema,table_name;
723723
TABLE_CATALOG def
724724
TABLE_SCHEMA information_schema

mysql-test/suite/funcs_1/t/is_columns_is.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
--source include/not_embedded.inc
1919

2020
let $my_where = WHERE table_schema = 'information_schema'
21-
AND table_name <> 'profiling' AND table_name not like 'innodb_%';
21+
AND table_name <> 'profiling' AND table_name not like 'innodb_%' AND table_name not like 'ndb%';
2222
--source suite/funcs_1/datadict/columns.inc

mysql-test/suite/funcs_1/t/is_tables_is.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
#
1414

1515
let $my_where = WHERE table_schema = 'information_schema'
16-
AND table_name <> 'profiling' AND table_name not like 'innodb_%';
16+
AND table_name <> 'profiling' AND table_name not like 'innodb_%' AND table_name not like 'ndb%';
1717
--source suite/funcs_1/datadict/tables1.inc
1818

mysql-test/suite/ndb/include/have_clusterj.inc

+9-7
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@ my $basedir = dirname($mysql_test_dir);
2222
#
2323

2424
my $clusterj_jar = my_find_file($basedir,
25-
["storage/ndb/clusterj",
26-
"share/mysql/java", # install unix
27-
"lib/java"], # install windows
25+
[ "storage/ndb/clusterj",
26+
"share/java",
27+
"share/mysql/java",
28+
"lib/java" ],
2829
"clusterj-*.jar", NOT_REQUIRED);
2930

3031
my $clusterj_test_jar = my_find_file($basedir,
31-
["storage/ndb/clusterj/clusterj-test",
32-
"share/mysql/java", # install unix
33-
"lib/java"], # install windows
34-
"clusterj-test-*.jar", NOT_REQUIRED);
32+
[ "storage/ndb/clusterj/clusterj-test",
33+
"share/java",
34+
"share/mysql/java",
35+
"lib/java" ],
36+
"clusterj-test-*.jar", NOT_REQUIRED);
3537

3638
my $ndbclient_lib = my_find_file($basedir,
3739
["storage/ndb/src/.libs",

mysql-test/suite/ndb/r/ndb_join_pushdown.result

+47-5
Original file line numberDiff line numberDiff line change
@@ -2096,6 +2096,7 @@ insert into t1 values (1, 2);
20962096
insert into t1 values (2, 3);
20972097
insert into t1 values (3, 1);
20982098
set ndb_join_pushdown=true;
2099+
set autocommit=off;
20992100
explain extended
21002101
select *
21012102
from t1, t1 as t2
@@ -2113,12 +2114,17 @@ and t2.a = t1.b;
21132114
a b a b
21142115
1 2 2 3
21152116
3 1 1 2
2117+
@ndb_execute_count:=VARIABLE_VALUE-@ndb_init_execute_count
2118+
3
2119+
This should yield 3 executes (for now...buh)
2120+
set autocommit=on;
21162121
drop table t1;
21172122
create table t1 (a int, b int, primary key(a)) engine = ndb;
21182123
insert into t1 values (1, 2);
21192124
insert into t1 values (2, 3);
21202125
insert into t1 values (3, 1);
21212126
set ndb_join_pushdown=true;
2127+
set autocommit=off;
21222128
explain extended
21232129
select *
21242130
from t1, t1 as t2
@@ -2136,6 +2142,10 @@ and t2.a = t1.b;
21362142
a b a b
21372143
1 2 2 3
21382144
3 1 1 2
2145+
@ndb_execute_count:=VARIABLE_VALUE-@ndb_init_execute_count
2146+
1
2147+
This should yield 1 execute (but inefficient since it's based on scan)
2148+
set autocommit=on;
21392149
explain extended
21402150
select *
21412151
from t1, t1 as t2
@@ -5468,6 +5478,38 @@ select count(*) from t1 as x1 join t1 as x2 on x1.b = x2.c;
54685478
count(*)
54695479
3
54705480
drop table t1;
5481+
create table t1
5482+
(a int not null,
5483+
b int not null,
5484+
c int not null,
5485+
d int not null,
5486+
primary key(a,b,c,d)) engine=ndb partition by key (b,c);
5487+
insert into t1 values (0x4f, 0x4f, 0x4f, 0x4f);
5488+
explain select * from t1 as x1
5489+
join t1 as x2 on x1.c=0x4f and x2.a=0+x1.b and x2.b=x1.b
5490+
join t1 as x3 on x3.a=x2.d and x3.b=x1.d and x3.c=x2.c;
5491+
id select_type table type possible_keys key key_len ref rows Extra
5492+
1 SIMPLE x1 ALL NULL NULL NULL NULL 2 Using where with pushed condition
5493+
1 SIMPLE x2 ref PRIMARY PRIMARY 8 func,test.x1.b 1 Parent of 2 pushed join@1; Using where
5494+
1 SIMPLE x3 ref PRIMARY PRIMARY 12 test.x2.d,test.x1.d,test.x2.c 1 Child of 'x2' in pushed join@1
5495+
select * from t1 as x1
5496+
join t1 as x2 on x1.c=0x4f and x2.a=0+x1.b and x2.b=x1.b
5497+
join t1 as x3 on x3.a=x2.c and x3.b=x1.d and x3.c=x2.c;
5498+
a b c d a b c d a b c d
5499+
79 79 79 79 79 79 79 79 79 79 79 79
5500+
explain select * from t1 as x1
5501+
join t1 as x2 on x1.c=0x4f and x2.a=0+x1.b and x2.b=x1.b
5502+
join t1 as x3 on x3.a=x2.d and x3.b=x1.d and x3.c=0x4f;
5503+
id select_type table type possible_keys key key_len ref rows Extra
5504+
1 SIMPLE x1 ALL NULL NULL NULL NULL 2 Using where with pushed condition
5505+
1 SIMPLE x2 ref PRIMARY PRIMARY 8 func,test.x1.b 1 Parent of 2 pushed join@1; Using where
5506+
1 SIMPLE x3 ref PRIMARY PRIMARY 12 test.x2.d,test.x1.d,const 1 Child of 'x2' in pushed join@1
5507+
select * from t1 as x1
5508+
join t1 as x2 on x1.c=0x4f and x2.a=0+x1.b and x2.b=x1.b
5509+
join t1 as x3 on x3.a=x2.c and x3.b=x1.d and x3.c=0x4f;
5510+
a b c d a b c d a b c d
5511+
79 79 79 79 79 79 79 79 79 79 79 79
5512+
drop table t1;
54715513
create temporary table spj_counts_at_end
54725514
select counter_name, sum(val) as val
54735515
from ndbinfo.counters
@@ -5484,10 +5526,10 @@ and spj_counts_at_end.counter_name <> 'READS_NOT_FOUND'
54845526
and spj_counts_at_end.counter_name <> 'SCAN_ROWS_RETURNED'
54855527
and spj_counts_at_end.counter_name <> 'SCAN_BATCHES_RETURNED';
54865528
counter_name spj_counts_at_end.val - spj_counts_at_startup.val
5487-
CONST_PRUNED_RANGE_SCANS_RECEIVED 6
5529+
CONST_PRUNED_RANGE_SCANS_RECEIVED 8
54885530
LOCAL_TABLE_SCANS_SENT 250
5489-
PRUNED_RANGE_SCANS_RECEIVED 25
5490-
RANGE_SCANS_RECEIVED 726
5531+
PRUNED_RANGE_SCANS_RECEIVED 27
5532+
RANGE_SCANS_RECEIVED 730
54915533
READS_RECEIVED 58
54925534
TABLE_SCANS_RECEIVED 250
54935535
drop table spj_counts_at_startup;
@@ -5499,9 +5541,9 @@ pruned_scan_count
54995541
sorted_scan_count
55005542
35
55015543
pushed_queries_defined
5502-
401
5544+
405
55035545
pushed_queries_dropped
55045546
9
55055547
pushed_queries_executed
5506-
547
5548+
549
55075549
set ndb_join_pushdown = @save_ndb_join_pushdown;

mysql-test/suite/ndb/t/have_ndb_dist_priv.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ my $basedir = dirname($mysql_test_dir);
2121
# Check if the needed tests are available
2222
#
2323
my $sql_file = my_find_file($basedir,
24-
["storage/ndb/tools", "share/mysql/"],
24+
["storage/ndb/tools", "share/mysql/", "share" ],
2525
"ndb_dist_priv.sql", NOT_REQUIRED);
2626

2727
my $F = IO::File->new("$vardir/tmp/have_ndb_dist_priv_result.inc", "w") or die;

mysql-test/suite/ndb/t/ndb_join_pushdown.test

+63
Original file line numberDiff line numberDiff line change
@@ -1070,16 +1070,31 @@ insert into t1 values (3, 1);
10701070

10711071
set ndb_join_pushdown=true;
10721072

1073+
##
1074+
# In ps-protocol, server will adds calls to execute(Commit)
1075+
# (these are optimized away by ndbapi, since there is nothing to commit)
1076+
# and these generates a diff in execute-count
1077+
# To not have to investigate problem futher, I simply set autocommit=off
1078+
# (and back further down where we don't track execute-count any longer)
1079+
# It would probably be good to changes these tests to instead use frazers new
1080+
# ndbapi counters, and instead measure #round-trips
1081+
set autocommit=off;
1082+
10731083
explain extended
10741084
select *
10751085
from t1, t1 as t2
10761086
where t1.a in (1,3,5)
10771087
and t2.a = t1.b;
1088+
--source suite/ndb/include/ndb_init_execute_count.inc
10781089
--sorted_result
10791090
select *
10801091
from t1, t1 as t2
10811092
where t1.a in (1,3,5)
10821093
and t2.a = t1.b;
1094+
--source suite/ndb/include/ndb_execute_count.inc
1095+
--echo This should yield 3 executes (for now...buh)
1096+
1097+
set autocommit=on;
10831098

10841099
connection ddl;
10851100
drop table t1;
@@ -1095,17 +1110,31 @@ insert into t1 values (3, 1);
10951110

10961111
set ndb_join_pushdown=true;
10971112

1113+
##
1114+
# In ps-protocol, server will adds calls to execute(Commit)
1115+
# (these are optimized away by ndbapi, since there is nothing to commit)
1116+
# and these generates a diff in execute-count
1117+
# To not have to investigate problem futher, I simply set autocommit=off
1118+
# (and back further down where we don't track execute-count any longer)
1119+
# It would probably be good to changes these tests to instead use frazers new
1120+
# ndbapi counters, and instead measure #round-trips
1121+
set autocommit=off;
1122+
10981123
explain extended
10991124
select *
11001125
from t1, t1 as t2
11011126
where t1.a in (1,3,5)
11021127
and t2.a = t1.b;
1128+
--source suite/ndb/include/ndb_init_execute_count.inc
11031129
--sorted_result
11041130
select *
11051131
from t1, t1 as t2
11061132
where t1.a in (1,3,5)
11071133
and t2.a = t1.b;
1134+
--source suite/ndb/include/ndb_execute_count.inc
1135+
--echo This should yield 1 execute (but inefficient since it's based on scan)
11081136

1137+
set autocommit=on;
11091138

11101139
## Adding and 'order by ... desc' trigger the usage
11111140
## of QUICK_SELECT_DESC which somehow prepares a
@@ -3837,6 +3866,40 @@ select count(*) from t1 as x1 join t1 as x2 on x1.b = x2.c;
38373866
connection ddl;
38383867
drop table t1;
38393868

3869+
####################
3870+
# Test pruned child scans using parameter values (known regression).
3871+
####################
3872+
create table t1
3873+
(a int not null,
3874+
b int not null,
3875+
c int not null,
3876+
d int not null,
3877+
primary key(a,b,c,d)) engine=ndb partition by key (b,c);
3878+
3879+
connection spj;
3880+
insert into t1 values (0x4f, 0x4f, 0x4f, 0x4f);
3881+
3882+
# Prune key depends on parent row.
3883+
explain select * from t1 as x1
3884+
join t1 as x2 on x1.c=0x4f and x2.a=0+x1.b and x2.b=x1.b
3885+
join t1 as x3 on x3.a=x2.d and x3.b=x1.d and x3.c=x2.c;
3886+
3887+
select * from t1 as x1
3888+
join t1 as x2 on x1.c=0x4f and x2.a=0+x1.b and x2.b=x1.b
3889+
join t1 as x3 on x3.a=x2.c and x3.b=x1.d and x3.c=x2.c;
3890+
3891+
# Prune key is fixed.
3892+
explain select * from t1 as x1
3893+
join t1 as x2 on x1.c=0x4f and x2.a=0+x1.b and x2.b=x1.b
3894+
join t1 as x3 on x3.a=x2.d and x3.b=x1.d and x3.c=0x4f;
3895+
3896+
select * from t1 as x1
3897+
join t1 as x2 on x1.c=0x4f and x2.a=0+x1.b and x2.b=x1.b
3898+
join t1 as x3 on x3.a=x2.c and x3.b=x1.d and x3.c=0x4f;
3899+
3900+
connection ddl;
3901+
drop table t1;
3902+
38403903
########################################
38413904
# Verify DBSPJ counters for entire test:
38423905
# Note: These tables are 'temporary' withing 'connection spj'

mysql-test/suite/ndb_big/rqg_spj.test

+14-3
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,27 @@ create temporary table spj_counts_at_startup
2020
# Load simple.zz
2121
# -o => with "oj-extensions"
2222
--echo Calling: $LOAD_RQG -d simple.zz -o
23-
--exec $LOAD_RQG -d simple.zz -o
23+
--system $LOAD_RQG -d simple.zz -o
2424

2525
##
2626
# run spj_test.yy for 3600 seconds
2727
#
2828
# If you want to reproduce an "run"
2929
# add -s <seed value> to command below
3030
#
31-
--echo Calling: $RUN_RQG -g spj_test.yy -t 3600
32-
--exec $RUN_RQG -g spj_test.yy -t 3600
31+
# NOTE: CluB get unhappy if a testcase doesnt print for 1800 seconds
32+
# So call program several times instead
33+
# (having --exec print as it goes would also be nice...instead of
34+
# just at the end)
35+
#
36+
let $cmd = $RUN_RQG -g spj_test.yy -t 600;
37+
--echo Calling: $cmd (6 times)
38+
--system $cmd
39+
--system $cmd
40+
--system $cmd
41+
--system $cmd
42+
--system $cmd
43+
--system $cmd
3344

3445
drop database spj_myisam;
3546
drop database spj_ndb;

0 commit comments

Comments
 (0)