summaryrefslogtreecommitdiffstats
path: root/storage/rocksdb/mysql-test/rocksdb/t/no_merge_sort.test
blob: ccef7182c11d27000d763c97bb823d74828b9758 (plain)
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
--source include/have_rocksdb.inc

# For Issue#117 MyRocks does merge sort with small data sets

let $datadir = `SELECT @@datadir`;

--disable_query_log
let $i= 0;
while ($i < 30) {
  DROP TABLE IF EXISTS ti_nk;

  CREATE TABLE `ti_nk` (
    `a` int(11) DEFAULT NULL,
    `b` int(11) DEFAULT NULL,
    `c` varchar(36) COLLATE latin1_bin NOT NULL,
    PRIMARY KEY (`c`)
  );
  let $j = 0;
  while ($j < 200) {
    eval insert into ti_nk values ($j, $j, md5($j));
    inc $j;
  }

  select variable_value into @s from information_schema.global_status where variable_name='Sort_merge_passes';
  eval SELECT a, b, c FROM ti_nk ORDER BY a,b,c INTO OUTFILE '$datadir/select.out';
  --remove_file $datadir/select.out
  select case when variable_value-@s = 0 then 'true' else 'false' end as skip_merge_sort from information_schema.global_status where variable_name='Sort_merge_passes';
  inc $i;
}
--enable_query_log

DROP TABLE ti_nk;