1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
|
-- source include/have_ndb.inc
# Test is using error insert, check that binaries support it
--source have_ndb_error_insert.inc
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "all error 0" >> $NDB_TOOLS_OUTPUT
# make ndb nodes die if correct tc is not selected
--echo #
--echo # Test tc select with 2-way joins with unique lookups
--echo #
create table t1 (a int key, b int) engine ndb;
create table t2 (a int, b int, c int, d int, primary key(a,b), unique(d)) engine ndb partition by key(a);
--disable_query_log
--disable_result_log
let $i= 100;
let $j= 1;
while ($i)
{
--eval insert into t1 values ("$i","$j")
--eval insert into t2 values ("$i","$j",9999,"$j")
dec $i;
inc $j;
}
--enable_query_log
--enable_result_log
--echo #
--echo # 2-way join tc selection in pk
--echo #
--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "all error 8072" >> $NDB_TOOLS_OUTPUT
--replace_column 9 #
explain select t2.c from t1,t2 where t1.a=50 and t2.a=t1.a and t2.b=t1.b;
--disable_query_log
--disable_result_log
let $i= 100;
while ($i)
{
--eval select t2.c from t1,t2 where t1.a="$i" and t2.a=t1.a and t2.b=t1.b
dec $i;
}
--enable_query_log
--enable_result_log
--echo #
--echo # 2-way join tc selection in unique key
--echo #
--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "all error 8071" >> $NDB_TOOLS_OUTPUT
--replace_column 9 #
explain select t1.b from t1,t2 where t2.d=50 and t1.a=t2.a;
--disable_query_log
--disable_result_log
let $i= 100;
while ($i)
{
--eval select t1.b from t1,t2 where t2.d="$i" and t1.a=t2.a
dec $i;
}
--enable_query_log
--enable_result_log
# cleanup
--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "all error 0" >> $NDB_TOOLS_OUTPUT
drop table t1,t2;
--echo #
--echo # Test tc select with 2-way joins with scan followed by unique lookup
--echo #
create table t1 (a int, b int, primary key(a,b)) engine ndb partition by key (a);
create table t2 (a int, b int, c int, primary key(a,b)) engine ndb partition by key (a);
--disable_query_log
--disable_result_log
let $i= 100;
let $j= 1;
while ($i)
{
--eval insert into t1 values ("$i","$j")
--eval insert into t2 values ("$i",9999,"$j")
dec $i;
inc $j;
}
--enable_query_log
--enable_result_log
--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "all error 8071" >> $NDB_TOOLS_OUTPUT
--replace_column 9 #
explain select t2.c from t1,t2 where t1.a=50 and t2.a=t1.a and t2.b=t1.b;
--disable_query_log
--disable_result_log
let $i= 100;
while ($i)
{
--eval select t2.c from t1,t2 where t1.a="$i" and t2.a=t1.a and t2.b=t1.b
dec $i;
}
--enable_query_log
--enable_result_log
# cleanup
--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "all error 0" >> $NDB_TOOLS_OUTPUT
drop table t1,t2;
--let $type1= int
--let $type2= varchar(22)
--source suite/ndb/t/ndb_dbug_tc_select_1.inc
--let $type1= varchar(1024)
--let $type2= int
--source suite/ndb/t/ndb_dbug_tc_select_1.inc
--let $type1= varchar(32)
--let $type2= varchar(257)
--source suite/ndb/t/ndb_dbug_tc_select_1.inc
--let $type1= int
--let $type2= int
--let $type3= int
--source suite/ndb/t/ndb_dbug_tc_select_2.inc
--let $type1= int
--let $type2= char(22)
--let $type3= char(12)
--source suite/ndb/t/ndb_dbug_tc_select_2.inc
--let $type1= varchar(32)
--let $type2= int
--let $type3= varchar(257)
--source suite/ndb/t/ndb_dbug_tc_select_2.inc
--let $type1= int
--let $type2= int
--let $type3= int
--let $type4= int
--source suite/ndb/t/ndb_dbug_tc_select_3.inc
--let $type1= int
--let $type2= varchar(22)
--let $type3= char(12)
--let $type4= varchar(257)
--source suite/ndb/t/ndb_dbug_tc_select_3.inc
--let $type1= varchar(1024)
--let $type2= char(22)
--let $type3= varchar(257)
--let $type4= char(12)
--source suite/ndb/t/ndb_dbug_tc_select_3.inc
|