~percona-core/percona-server/5.5

« back to all changes in this revision

Viewing changes to Percona-Server/mysql-test/t/percona_bug1218330.test

  • Committer: Laurynas Biveinis
  • Date: 2013-09-06 13:24:59 UTC
  • mfrom: (558.8.3 5.5)
  • Revision ID: laurynas.biveinis@percona.com-20130906132459-jfaquw8dbwluzbsl
MergeĀ lp:~akopytov/percona-server/ahi-fixes-5.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
############################################################################
 
2
# Bug #1218330: Adaptive hash index memory is incorrectly calculated in SHOW
 
3
#               ENGINE INNODB STATUS and I_S
 
4
############################################################################
 
5
 
 
6
--source include/have_innodb.inc
 
7
 
 
8
let $adaptive_hash_mem_1=`SELECT VARIABLE_VALUE FROM
 
9
    INFORMATION_SCHEMA.GLOBAL_STATUS WHERE
 
10
    VARIABLE_NAME='Innodb_mem_adaptive_hash'`;
 
11
 
 
12
CREATE TABLE t1 (
 
13
       a INT PRIMARY KEY, b INT,
 
14
       c CHAR(200),
 
15
       UNIQUE INDEX b(b)) ENGINE=InnoDB;
 
16
 
 
17
INSERT INTO t1 VALUES (1, 1, REPEAT("a", 200));
 
18
 
 
19
--disable_query_log
 
20
 
 
21
--let $i=200
 
22
--disable_result_log
 
23
while ($i)
 
24
{
 
25
        SELECT a FROM t1 WHERE a=1;
 
26
        SELECT b FROM t1 WHERE b=1;
 
27
        --dec $i
 
28
}
 
29
--enable_result_log
 
30
 
 
31
let $adaptive_hash_mem_2=`SELECT VARIABLE_VALUE FROM
 
32
    INFORMATION_SCHEMA.GLOBAL_STATUS WHERE
 
33
    VARIABLE_NAME='Innodb_mem_adaptive_hash'`;
 
34
 
 
35
# The original implementation would should identical values in
 
36
# adaptive_hash_mem_1 and adaptive_hash_mem_2
 
37
 
 
38
--eval SELECT $adaptive_hash_mem_1 != $adaptive_hash_mem_2 as should_be_1
 
39
 
 
40
--enable_query_log
 
41
 
 
42
DROP TABLE t1;