Debian Codegraph @

mysql-test/suite/ndb_big/bug37983.test

raw
1 source suite.inc;
2 source include/have_ndb.inc;
3 result_format 2;
4
5 select version();
6
7 CREATE TABLE `t1` (
8 `c1` int(11) NOT NULL,
9 `c3` text,
10 PRIMARY KEY (`c1`) USING BTREE
11 ) ENGINE=ndbcluster DEFAULT CHARSET=utf8;
12
13 ## Load table...
14 disable_query_log;
15 let $i=1000;
16 while ($i)
17 {
18 let $batch = 400; # Number of values to INSERT per batch
19 let $separator = ;
20 let $sql = INSERT t1 (c1, c3) VALUES;
21 while($batch)
22 {
23 let $sql=$sql$separator($i*1000+$batch, REPEAT('ks87', 512*RAND()));
24 dec $batch;
25 let $separator = ,;
26 }
27
28 source run_query_with_retry.inc;
29
30 dec $i;
31 }
32 enable_query_log;
33
34 ## Check number of records in table..
35 let $count = `select count(*) from t1`;
36 if (!`select $count = 400000`)
37 {
38 echo got: $count, expected: 400000;
39 die Wrong number of records loaded into table;
40 }
41 echo Table has $count number of records;
42
43 # Measure the time to run the query three times
44 source start_timer.inc;
45 # This is currently a very bad query for MySQL Cluster since
46 # each record has to be fetched into the mysql in order
47 # to see if it fulfills the where clause
48 select count(*) from t1 where length(c3) < 256;
49 select count(*) from t1 where length(c3) < 256;
50 select count(*) from t1 where length(c3) < 256;
51 source end_timer.inc;
52
53 drop table t1;
54
55 ## Test suceeded
56 exit;