File: ndb_index_stat_enable.inc

package info (click to toggle)
percona-xtrabackup 2.2.3-2.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 293,260 kB
  • ctags: 146,881
  • sloc: cpp: 1,051,960; ansic: 570,217; java: 54,595; perl: 53,495; pascal: 44,194; sh: 27,826; yacc: 15,314; python: 12,142; xml: 7,848; sql: 4,125; makefile: 1,459; awk: 785; lex: 758
file content (39 lines) | stat: -rw-r--r-- 1,204 bytes parent folder | download
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
# turn ndb_index_stat_enable ON or OFF
# caller sets @is_enable 0/1
# based on global variable, local follows global
# do nothing if value is already correct
# setting OFF drops stats tables to avoid MTR diff

let is_enable_on = `select @is_enable and not @@global.ndb_index_stat_enable`;
let is_enable_off = `select not @is_enable and @@global.ndb_index_stat_enable`;
set @is_enable = NULL;

--echo # is_enable_on=$is_enable_on is_enable_off=$is_enable_off

--echo # ndb_index_stat_enable - before
show global variables like 'ndb_index_stat_enable';
show local variables like 'ndb_index_stat_enable';

if ($is_enable_on)
{
  # first global
  eval set @@global.ndb_index_stat_enable = 1;
  eval set @@local.ndb_index_stat_enable = 1;

  # stats thread creates stats tables
}

if ($is_enable_off)
{
  # first local
  eval set @@local.ndb_index_stat_enable = 0;
  eval set @@global.ndb_index_stat_enable = 0;

  # stats thread does not (and must not) drop stats tables
  eval drop table mysql.ndb_index_stat_sample;
  eval drop table mysql.ndb_index_stat_head;
}

--echo # ndb_index_stat_enable - after
show global variables like 'ndb_index_stat_enable';
show local variables like 'ndb_index_stat_enable';