~mathiaz/ubuntu/lucid/mysql-dfsg-5.1/zap-bug-552053

« back to all changes in this revision

Viewing changes to mysql-test/t/myisam_stats_method_basic.test

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-06-25 12:55:45 UTC
  • mfrom: (1.1.2 upstream) (0.1.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20090625125545-m8ogs96zzsri74xe
Tags: 5.1.34-1ubuntu1
* Merge from debian experimental (and 5.0 from main), remaining changes:
  - debian/mysql-server-5.1.config:
    + ask for MySQL root password at priority high instead of medium so
      that the password prompt is seen on a default install. (LP: #319843)
    + don't ask for root password when upgrading from a 5.0 install.
  - debian/control:
    + Make libmysqlclient16-dev a transitional package depending on
      libmysqlclient-dev.
    + Make libmysqlclient-dev conflict with libmysqlclient15-dev.
    + Don't build mysql-server, mysql-client, mysql-common and
      libmysqlclient15-dev binary packages since they're still provided
      by mysql-dfsg-5.0.
    + Make mysql-{client,server}-5.1 packages conflict and
      replace mysql-{client,server}-5.0, but not provide
      mysql-{client,server}.
    + Depend on a specific version of mysql-common rather than the src
      version of mysql-dfsg-5.1 since mysql-common is currently part of
      mysql-dfsg-5.0.
    + Lower mailx from a Recommends to a Suggests to avoid pulling in
      a full MTA on all installs of mysql-server. (LP: #259477)
  - debian/rules:
    + added -fno-strict-aliasing to CFLAGS to get around mysql testsuite
      build failures.
    + install mysql-test and sql-bench to /usr/share/mysql/ rather than
      /usr/.
  - debian/additions/debian-start.inc.sh: support ANSI mode (LP: #310211)
  - Add AppArmor profile:
    - debian/apparmor-profile: apparmor profile.
    - debian/rules, debian/mysql-server-5.0.files: install apparmor profile.
    - debian/mysql-server-5.0.dirs: add etc/apparmor.d/force-complain
    - debian/mysql-server-5.0.postrm: remove symlink in force-complain/ on
      purge.
    - debian/mysql-server-5.1.README.Debian: add apparmor documentation.
    - debian/additions/my.cnf: Add warning about apparmor. (LP: #201799)
    - debian/mysql-server-5.1.postinst: reload apparmor profiles.
  - debian/additions/my.cnf: remove language option. Error message files are
    located in a different directory in MySQL 5.0. Setting the language
    option to use /usr/share/mysql/english breaks 5.0. Both 5.0 and 5.1
    use a default value that works. (LP: #316974)
  - debian/mysql-server-5.1.mysql.init:
    + Clearly indicate that we do not support running multiple instances
      of mysqld by duplicating the init script.
      (closes: #314785, #324834, #435165, #444216)
    + Properly parameterize all existing references to the mysql config
      file (/etc/mysql/my.cnf).
  - debian/mysql-server-5.0.postinst: Clear out the second password
    when setting up mysql. (LP: #344816)
  - mysql-server-core-5.1 package for files needed by Akonadi:
    + debian/control: create mysql-server-core-5.1 package.
    + debian/mysql-server-core-5.1.files, debian/mysql-server-5.1.files:
      move core mysqld files to mysql-server-core-5.1 package.
  - Don't package sql-bench and mysql-test file.
* Dropped changes:
  - debian/patches/92_ssl_test_cert.dpatch: certificate expiration in
    test suite (LP: #323755). Included upstream.
* Dropped from 5.0:
  - apparmor profile:
    - debian/control: Recommends apparmor >= 2.1+1075-0ubuntu6. All version
      of apparmor-profile (>hardy) are higher than this version.
    - debian/mysql-server-5.0.preinst: create symlink for force-complain/
      on pre-feisty upgrades, upgrades where apparmor-profiles profile is
      unchanged (ie non-enforcing) and upgrades where the profile
      doesn't exist. Support for pre-hardy upgrades is no longer needed.
* debian/mysql-server-5.1.postinst: fix debian-sys-maint user creation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
############## mysql-test\t\myisam_stats_method_basic.test ####################
2
 
#                                                                             #
3
 
# Variable Name: myisam_stats_method                                          #
4
 
# Scope: GLOBAL | SESSION                                                     #
5
 
# Access Type: Dynamic                                                        #
6
 
# Data Type: enumeration                                                      #
7
 
# Default Value: nulls_equal                                                  #
8
 
# Valid Values: nulls_equal, nulls_unequal                                    #
9
 
#                                                                             #
10
 
#                                                                             #
11
 
# Creation Date: 2008-02-07                                                   #
12
 
# Author:  Rizwan                                                             #
13
 
#                                                                             #
14
 
# Description: Test Cases of Dynamic System Variable myisam_stats_method      #
15
 
#              that checks the behavior of this variable in the following ways#
16
 
#              * Default Value                                                #
17
 
#              * Valid & Invalid values                                       #
18
 
#              * Scope & Access method                                        #
19
 
#              * Data Integrity                                               #
20
 
#                                                                             #
21
 
# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
22
 
#  server-system-variables.html                                               #
23
 
#                                                                             #
24
 
###############################################################################
25
 
 
26
 
--source include/load_sysvars.inc
27
 
 
28
 
######################################################################## 
29
 
#                    START OF myisam_stats_method TESTS                #
30
 
######################################################################## 
31
 
 
32
 
 
33
 
########################################################################### 
34
 
#     Saving initial value of myisam_stats_method in a temporary variable #
35
 
########################################################################### 
36
 
 
37
 
SET @global_start_value = @@global.myisam_stats_method;
38
 
SELECT @global_start_value;
39
 
 
40
 
SET @session_start_value = @@session.myisam_stats_method;
41
 
SELECT @session_start_value;
42
 
 
43
 
--echo '#--------------------FN_DYNVARS_097_01------------------------#'
44
 
######################################################################## 
45
 
#                    Display the DEFAULT value of myisam_stats_method  #
46
 
######################################################################## 
47
 
 
48
 
SET @@global.myisam_stats_method = nulls_equal;
49
 
SET @@global.myisam_stats_method = DEFAULT;
50
 
SELECT @@global.myisam_stats_method;
51
 
 
52
 
SET @@session.myisam_stats_method = nulls_equal;
53
 
SET @@session.myisam_stats_method = DEFAULT;
54
 
SELECT @@session.myisam_stats_method;
55
 
 
56
 
 
57
 
--echo '#---------------------FN_DYNVARS_097_02-------------------------#'
58
 
######################################################### 
59
 
#      Check if NULL or empty value is accepeted        #
60
 
######################################################### 
61
 
 
62
 
--Error ER_WRONG_VALUE_FOR_VAR
63
 
SET @@global.myisam_stats_method = NULL;
64
 
 
65
 
--Error ER_WRONG_VALUE_FOR_VAR
66
 
SET @@global.myisam_stats_method = '';
67
 
 
68
 
--Error ER_WRONG_VALUE_FOR_VAR
69
 
SET @@session.myisam_stats_method = NULL;
70
 
 
71
 
--Error ER_WRONG_VALUE_FOR_VAR
72
 
SET @@session.myisam_stats_method = '';
73
 
 
74
 
--echo '#--------------------FN_DYNVARS_097_03------------------------#'
75
 
######################################################################## 
76
 
#          Change the value of myisam_stats_method to a valid value    #
77
 
######################################################################## 
78
 
 
79
 
SET @@global.myisam_stats_method = 'nulls_equal';
80
 
SELECT @@global.myisam_stats_method;
81
 
 
82
 
SET @@global.myisam_stats_method = 'nulls_unequal';
83
 
SELECT @@global.myisam_stats_method;
84
 
 
85
 
SET @@global.myisam_stats_method = 'nulls_ignored';
86
 
SELECT @@global.myisam_stats_method;
87
 
 
88
 
--echo 'Bug: Value of nulls_ignored is not documented. Its ordinal value is 2'
89
 
 
90
 
SET @@session.myisam_stats_method = 'nulls_equal';
91
 
SELECT @@session.myisam_stats_method;
92
 
 
93
 
SET @@session.myisam_stats_method = 'nulls_unequal';
94
 
SELECT @@session.myisam_stats_method;
95
 
 
96
 
SET @@session.myisam_stats_method = 'nulls_ignored';
97
 
SELECT @@session.myisam_stats_method;
98
 
 
99
 
 
100
 
--echo '#--------------------FN_DYNVARS_097_04-------------------------#'
101
 
########################################################################### 
102
 
#           Change the value of myisam_stats_method to invalid value      #
103
 
########################################################################### 
104
 
 
105
 
 
106
 
--Error ER_WRONG_VALUE_FOR_VAR
107
 
SET @@global.myisam_stats_method = -1;
108
 
--Error ER_WRONG_VALUE_FOR_VAR
109
 
SET @@global.myisam_stats_method = unequal;
110
 
--Error ER_WRONG_VALUE_FOR_VAR
111
 
SET @@global.myisam_stats_method = ENABLED;
112
 
--Error ER_WRONG_VALUE_FOR_VAR
113
 
SET @@global.myisam_stats_method = 'equal';
114
 
--Error ER_WRONG_VALUE_FOR_VAR
115
 
SET @@global.myisam_stats_method = 'null_equal';
116
 
 
117
 
--Error ER_WRONG_VALUE_FOR_VAR
118
 
SET @@global.myisam_stats_method = ' ';
119
 
 
120
 
 
121
 
--echo '#-------------------FN_DYNVARS_097_05----------------------------#'
122
 
######################################################################### 
123
 
#     Check if the value in session Table matches value in variable     #
124
 
#########################################################################
125
 
 
126
 
SELECT @@session.myisam_stats_method = VARIABLE_VALUE 
127
 
FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
128
 
WHERE VARIABLE_NAME='myisam_stats_method';
129
 
 
130
 
--echo '#----------------------FN_DYNVARS_097_06------------------------#'
131
 
######################################################################### 
132
 
#     Check if the value in GLOBAL Table matches value in variable      #
133
 
#########################################################################
134
 
 
135
 
SELECT @@global.myisam_stats_method = VARIABLE_VALUE 
136
 
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
137
 
WHERE VARIABLE_NAME='myisam_stats_method';
138
 
 
139
 
 
140
 
--echo '#---------------------FN_DYNVARS_097_07-------------------------#'
141
 
################################################################### 
142
 
#        Check if numbers can be used on variable                 #
143
 
################################################################### 
144
 
 
145
 
# test if variable accepts 0,1,2
146
 
SET @@global.myisam_stats_method = 0;
147
 
SELECT @@global.myisam_stats_method;
148
 
 
149
 
SET @@global.myisam_stats_method = 1;
150
 
SELECT @@global.myisam_stats_method;
151
 
 
152
 
SET @@global.myisam_stats_method = 2;
153
 
SELECT @@global.myisam_stats_method;
154
 
 
155
 
# use of decimal values
156
 
 
157
 
SET @@global.myisam_stats_method = 0.4;
158
 
SELECT @@global.myisam_stats_method;
159
 
 
160
 
SET @@global.myisam_stats_method = 1.0;
161
 
SELECT @@global.myisam_stats_method;
162
 
 
163
 
SET @@global.myisam_stats_method = 1.1;
164
 
SELECT @@global.myisam_stats_method;
165
 
 
166
 
SET @@global.myisam_stats_method = 1.5;
167
 
SELECT @@global.myisam_stats_method;
168
 
 
169
 
SET @@global.myisam_stats_method = 2.49;
170
 
SELECT @@global.myisam_stats_method;
171
 
 
172
 
SET @@session.myisam_stats_method = 0.5;
173
 
SELECT @@session.myisam_stats_method;
174
 
 
175
 
SET @@session.myisam_stats_method = 1.6;
176
 
SELECT @@session.myisam_stats_method;
177
 
 
178
 
 
179
 
--echo 'Bug# 34877: Decimal values can be used within the range [0.0-2.5). Values';
180
 
--echo 'are rounded to 0,1,2 as evident from outcome.';
181
 
 
182
 
--Error ER_WRONG_VALUE_FOR_VAR
183
 
SET @@global.myisam_stats_method = 3;
184
 
 
185
 
 
186
 
--echo '#---------------------FN_DYNVARS_097_08----------------------#'
187
 
################################################################### 
188
 
#      Check if TRUE and FALSE values can be used on variable     #
189
 
################################################################### 
190
 
 
191
 
SET @@global.myisam_stats_method = TRUE;
192
 
SELECT @@global.myisam_stats_method;
193
 
SET @@global.myisam_stats_method = FALSE;
194
 
SELECT @@global.myisam_stats_method;
195
 
 
196
 
--echo '#---------------------FN_DYNVARS_097_09----------------------#'
197
 
#########################################################################  
198
 
# Check if myisam_stats_method can be accessed with and without @@ sign #
199
 
#########################################################################
200
 
 
201
 
SET myisam_stats_method = 'nulls_equal';
202
 
 
203
 
--Error ER_PARSE_ERROR
204
 
SET session.myisam_stats_method = 'nulls_equal';
205
 
--Error ER_PARSE_ERROR
206
 
SET global.myisam_stats_method = 'nulls_equal';
207
 
 
208
 
SET session myisam_stats_method = 'nulls_equal';
209
 
SELECT @@myisam_stats_method;
210
 
 
211
 
SET global myisam_stats_method = 'nulls_equal';
212
 
SELECT @@global.myisam_stats_method;
213
 
 
214
 
##############################  
215
 
#   Restore initial value    #
216
 
##############################
217
 
 
218
 
SET @@global.myisam_stats_method = @global_start_value;
219
 
SELECT @@global.myisam_stats_method;
220
 
 
221
 
SET @@session.myisam_stats_method = @session_start_value;
222
 
SELECT @@session.myisam_stats_method;
223
 
 
224
 
######################################################################## 
225
 
#                    END OF myisam_stats_method TESTS                  #
226
 
########################################################################