~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/suite/innodb/t/innodb-analyze.test

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Test that mysqld does not crash when running ANALYZE TABLE with
 
3
# different values of the parameter innodb_stats_sample_pages.
 
4
#
 
5
 
 
6
-- source include/have_innodb.inc
 
7
-- source suite/innodb/include/have_innodb_plugin.inc
 
8
 
 
9
# we care only that the following SQL commands do not produce errors
 
10
# and do not crash the server
 
11
-- disable_query_log
 
12
-- disable_result_log
 
13
-- enable_warnings
 
14
 
 
15
SET GLOBAL innodb_stats_sample_pages=0;
 
16
 
 
17
# check that the value has been adjusted to 1
 
18
-- enable_result_log
 
19
SHOW VARIABLES LIKE 'innodb_stats_sample_pages';
 
20
-- disable_result_log
 
21
 
 
22
CREATE TABLE innodb_analyze (
 
23
        a INT,
 
24
        b INT,
 
25
        KEY(a),
 
26
        KEY(b,a)
 
27
) ENGINE=InnoDB;
 
28
 
 
29
# test with empty table
 
30
 
 
31
ANALYZE TABLE innodb_analyze;
 
32
 
 
33
SET GLOBAL innodb_stats_sample_pages=2;
 
34
ANALYZE TABLE innodb_analyze;
 
35
 
 
36
SET GLOBAL innodb_stats_sample_pages=4;
 
37
ANALYZE TABLE innodb_analyze;
 
38
 
 
39
SET GLOBAL innodb_stats_sample_pages=8;
 
40
ANALYZE TABLE innodb_analyze;
 
41
 
 
42
SET GLOBAL innodb_stats_sample_pages=16;
 
43
ANALYZE TABLE innodb_analyze;
 
44
 
 
45
INSERT INTO innodb_analyze VALUES
 
46
(1,1), (1,1), (1,2), (1,3), (1,4), (1,5),
 
47
(8,1), (8,8), (8,2), (7,1), (1,4), (3,5);
 
48
 
 
49
SET GLOBAL innodb_stats_sample_pages=1;
 
50
ANALYZE TABLE innodb_analyze;
 
51
 
 
52
SET GLOBAL innodb_stats_sample_pages=2;
 
53
ANALYZE TABLE innodb_analyze;
 
54
 
 
55
SET GLOBAL innodb_stats_sample_pages=4;
 
56
ANALYZE TABLE innodb_analyze;
 
57
 
 
58
SET GLOBAL innodb_stats_sample_pages=8;
 
59
ANALYZE TABLE innodb_analyze;
 
60
 
 
61
SET GLOBAL innodb_stats_sample_pages=16;
 
62
ANALYZE TABLE innodb_analyze;
 
63
 
 
64
DROP TABLE innodb_analyze;
 
65
 
 
66
SET GLOBAL innodb_stats_sample_pages=DEFAULT;