Debian Codegraph @

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

raw
1 -- source include/have_ndb.inc
2
3 create table t1(
4 a int primary key
5 ) engine=ndbcluster;
6
7 insert into t1 values
8 (00),(01),(02),(03),(04),(05),(06),(07),(08),(09),
9 (10),(11),(12),(13),(14),(15),(16),(17),(18),(19),
10 (20),(21),(22),(23),(24),(25),(26),(27),(28),(29),
11 (30),(31),(32),(33),(34),(35),(36),(37),(38),(39),
12 (40),(41),(42),(43),(44),(45),(46),(47),(48),(49),
13 (50),(51),(52),(53),(54),(55),(56),(57),(58),(59),
14 (60),(61),(62),(63),(64),(65),(66),(67),(68),(69),
15 (70),(71),(72),(73),(74),(75),(76),(77),(78),(79),
16 (80),(81),(82),(83),(84),(85),(86),(87),(88),(89),
17 (90),(91),(92),(93),(94),(95),(96),(97),(98),(99);
18
19 --echo
20 --echo # expected result 0 roundtrips - read stats from share
21 --source suite/ndb/include/ndb_init_execute_count.inc
22 explain select * from t1 where a < 100;
23 --source suite/ndb/include/ndb_execute_count.inc
24
25 insert into t1 select a+100 from t1;
26
27 --echo
28 --echo # expected result 0 roundtrips - read stats from share
29 --source suite/ndb/include/ndb_init_execute_count.inc
30 explain select * from t1 where a < 100;
31 --source suite/ndb/include/ndb_execute_count.inc
32
33 delete from t1 where a >= 100;
34
35 --echo
36 --echo # expected result 0 roundtrips - read stats from share
37 --source suite/ndb/include/ndb_init_execute_count.inc
38 explain select * from t1 where a < 100;
39 --source suite/ndb/include/ndb_execute_count.inc
40
41 begin;
42 insert into t1 select a+100 from t1;
43 commit;
44
45 --echo
46 --echo # expected result 0 roundtrips - read stats from share
47 --source suite/ndb/include/ndb_init_execute_count.inc
48 explain select * from t1 where a < 100;
49 --source suite/ndb/include/ndb_execute_count.inc
50
51 begin;
52 delete from t1 where a >= 100;
53 commit;
54
55 --echo
56 --echo # expected result 0 roundtrips - read stats from share
57 --source suite/ndb/include/ndb_init_execute_count.inc
58 explain select * from t1 where a < 100;
59 --source suite/ndb/include/ndb_execute_count.inc
60
61 begin;
62 insert into t1 select a+100 from t1;
63 rollback;
64
65 --echo
66 --echo # expected result 0 roundtrips - read stats from share
67 --source suite/ndb/include/ndb_init_execute_count.inc
68 explain select * from t1 where a < 100;
69 --source suite/ndb/include/ndb_execute_count.inc
70
71 begin;
72 delete from t1 where a <= 100;
73 rollback;
74
75 --echo
76 --echo # expected result 0 roundtrips - read stats from share
77 --source suite/ndb/include/ndb_init_execute_count.inc
78 explain select * from t1 where a < 100;
79 --source suite/ndb/include/ndb_execute_count.inc
80
81 --error ER_DUP_KEY
82 insert into t1 select a from t1;
83
84 --echo
85 --echo # expected result 0 roundtrips - read stats from share
86 --source suite/ndb/include/ndb_init_execute_count.inc
87 explain select * from t1 where a < 100;
88 --source suite/ndb/include/ndb_execute_count.inc
89
90 begin;
91 --error ER_DUP_KEY
92 insert into t1 select a from t1;
93
94 --echo
95 --echo # expected result 0 roundtrips - read stats from share
96 --source suite/ndb/include/ndb_init_execute_count.inc
97 explain select * from t1 where a < 100;
98 --source suite/ndb/include/ndb_execute_count.inc
99
100 drop table t1;