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

« back to all changes in this revision

Viewing changes to mysql-test/t/auto_increment_offset_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\auto_increment_offset_basic.test ###################
2
 
#                                                                              #
3
 
# Variable Name: auto_increment_offset                                         #
4
 
# Scope: GLOBAL & SESSION                                                      #
5
 
# Access Type: Dynamic                                                         #
6
 
# Data Type: Numeric                                                           #
7
 
# Default Value: 1                                                             #
8
 
# Range: 1 - 65536                                                             #
9
 
#                                                                              #
10
 
#                                                                              #
11
 
# Creation Date: 2008-02-07                                                    #
12
 
# Author:  Salman Rawala                                                       #
13
 
#                                                                              #
14
 
# Description: Test Cases of Dynamic System Variable "auto_increment_offset"   #
15
 
#              that checks 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#option_mysqld_auto-increment-offset            #
23
 
#                                                                              #
24
 
################################################################################
25
 
 
26
 
--source include/load_sysvars.inc
27
 
 
28
 
#####################################################################
29
 
#           START OF auto_increment_offset TESTS                    #
30
 
#####################################################################
31
 
 
32
 
#############################################################
33
 
#                 Save initial value                        #
34
 
#############################################################
35
 
 
36
 
SET @start_global_value = @@global.auto_increment_offset;
37
 
SELECT @start_global_value;
38
 
SET @start_session_value = @@session.auto_increment_offset;
39
 
SELECT @start_session_value;
40
 
 
41
 
 
42
 
--echo '#--------------------FN_DYNVARS_002_01-------------------------#'
43
 
#####################################################################
44
 
#     Display the DEFAULT value of auto_increment_offset            #
45
 
#####################################################################
46
 
 
47
 
SET @@global.auto_increment_offset = 100;
48
 
SET @@global.auto_increment_offset = DEFAULT;
49
 
SELECT @@global.auto_increment_offset;
50
 
 
51
 
SET @@session.auto_increment_offset = 200;
52
 
SET @@session.auto_increment_offset = DEFAULT;
53
 
SELECT @@session.auto_increment_offset;
54
 
 
55
 
 
56
 
--echo '#--------------------FN_DYNVARS_002_02-------------------------#'
57
 
#####################################################################
58
 
#     Check the DEFAULT value of auto_increment_offset              #
59
 
#####################################################################
60
 
 
61
 
SET @@global.auto_increment_offset = @start_global_value;
62
 
SELECT @@global.auto_increment_offset = 1;
63
 
SET @@session.auto_increment_offset = @start_session_value;
64
 
SELECT @@session.auto_increment_offset = 1;
65
 
 
66
 
 
67
 
--echo '#--------------------FN_DYNVARS_002_03-------------------------#'
68
 
###############################################################################
69
 
# Change the value of auto_increment_offset to a valid value for GLOBAL Scope #
70
 
###############################################################################
71
 
 
72
 
SET @@global.auto_increment_offset = 1;
73
 
SELECT @@global.auto_increment_offset;
74
 
SET @@global.auto_increment_offset = 60020;
75
 
SELECT @@global.auto_increment_offset;
76
 
SET @@global.auto_increment_offset = 65535;
77
 
SELECT @@global.auto_increment_offset;
78
 
 
79
 
 
80
 
--echo '#--------------------FN_DYNVARS_002_04-------------------------#'
81
 
###############################################################################
82
 
# Change the value of auto_increment_offset to a valid value for SESSION Scope#
83
 
###############################################################################
84
 
 
85
 
SET @@session.auto_increment_offset = 1;
86
 
SELECT @@session.auto_increment_offset;
87
 
SET @@session.auto_increment_offset = 50050;
88
 
SELECT @@session.auto_increment_offset;
89
 
SET @@session.auto_increment_offset = 65535;
90
 
SELECT @@session.auto_increment_offset;
91
 
 
92
 
 
93
 
--echo '#------------------FN_DYNVARS_002_05-----------------------#'
94
 
#################################################################
95
 
# Change the value of auto_increment_offset to an invalid value #
96
 
#################################################################
97
 
# for global scope
98
 
SET @@global.auto_increment_offset = 0;
99
 
SELECT @@global.auto_increment_offset;
100
 
SET @@global.auto_increment_offset = -1024;
101
 
SELECT @@global.auto_increment_offset;
102
 
SET @@global.auto_increment_offset = 65536;
103
 
SELECT @@global.auto_increment_offset;
104
 
--Error ER_WRONG_TYPE_FOR_VAR
105
 
SET @@global.auto_increment_offset = ON;
106
 
SELECT @@global.auto_increment_offset;
107
 
--Error ER_WRONG_TYPE_FOR_VAR
108
 
SET @@global.auto_increment_offset = OFF;
109
 
SELECT @@global.auto_increment_offset;
110
 
--Error ER_WRONG_TYPE_FOR_VAR
111
 
SET @@global.auto_increment_offset = test;
112
 
SELECT @@global.auto_increment_offset;
113
 
# for session scope
114
 
SET @@session.auto_increment_offset = 0;
115
 
SELECT @@session.auto_increment_offset;
116
 
SET @@session.auto_increment_offset = -2;
117
 
SELECT @@session.auto_increment_offset;
118
 
SET @@session.auto_increment_offset = 65550;
119
 
SELECT @@session.auto_increment_offset;
120
 
echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
121
 
 
122
 
--Error ER_WRONG_TYPE_FOR_VAR
123
 
SET @@session.auto_increment_offset = ON;
124
 
SELECT @@session.auto_increment_offset;
125
 
--Error ER_WRONG_TYPE_FOR_VAR
126
 
SET @@session.auto_increment_offset = OFF;
127
 
SELECT @@session.auto_increment_offset;
128
 
--Error ER_WRONG_TYPE_FOR_VAR
129
 
SET @@session.auto_increment_offset = test;
130
 
SELECT @@session.auto_increment_offset;
131
 
 
132
 
 
133
 
 
134
 
--echo '#------------------FN_DYNVARS_002_06-----------------------#'
135
 
####################################################################
136
 
#   Check if the value in GLOBAL Table matches value in variable   #
137
 
####################################################################
138
 
 
139
 
SELECT @@global.auto_increment_offset = VARIABLE_VALUE 
140
 
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
141
 
WHERE VARIABLE_NAME='auto_increment_offset';
142
 
 
143
 
 
144
 
--echo '#------------------FN_DYNVARS_002_07-----------------------#'
145
 
####################################################################
146
 
#  Check if the value in SESSION Table matches value in variable   #
147
 
####################################################################
148
 
 
149
 
SELECT @@session.auto_increment_offset = VARIABLE_VALUE 
150
 
FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
151
 
WHERE VARIABLE_NAME='auto_increment_offset';
152
 
 
153
 
 
154
 
--echo '#------------------FN_DYNVARS_002_08-----------------------#'
155
 
####################################################################
156
 
#     Check if TRUE and FALSE values can be used on variable       #
157
 
####################################################################
158
 
 
159
 
SET @@global.auto_increment_offset = TRUE;
160
 
SELECT @@global.auto_increment_offset;
161
 
SET @@global.auto_increment_offset = FALSE;
162
 
SELECT @@global.auto_increment_offset;
163
 
 
164
 
 
165
 
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
166
 
###############################################################################
167
 
#  Check if global and session variables are independant of each other        #
168
 
###############################################################################
169
 
 
170
 
SET @@global.auto_increment_offset = 10;
171
 
SET @@session.auto_increment_offset = 11;
172
 
SELECT @@auto_increment_offset = @@global.auto_increment_offset;
173
 
 
174
 
 
175
 
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
176
 
##############################################################################
177
 
#    Check if accessing variable with SESSION,LOCAL and without SCOPE points #
178
 
#    to same session variable                                                #
179
 
##############################################################################
180
 
 
181
 
SET @@auto_increment_offset = 100;
182
 
SELECT @@auto_increment_offset = @@local.auto_increment_offset;
183
 
SELECT @@local.auto_increment_offset = @@session.auto_increment_offset;
184
 
 
185
 
 
186
 
--echo '#---------------------FN_DYNVARS_001_11----------------------#'
187
 
###############################################################################
188
 
#   Check if auto_increment_offset can be accessed with and without @@ sign   #
189
 
###############################################################################
190
 
 
191
 
SET auto_increment_offset = 1;
192
 
SELECT @@auto_increment_offset;
193
 
--Error ER_UNKNOWN_TABLE
194
 
SELECT local.auto_increment_offset;
195
 
--Error ER_UNKNOWN_TABLE
196
 
SELECT session.auto_increment_offset;
197
 
--Error ER_BAD_FIELD_ERROR
198
 
SELECT auto_increment_offset = @@session.auto_increment_offset;
199
 
 
200
 
 
201
 
####################################
202
 
#     Restore initial value        #
203
 
####################################
204
 
 
205
 
SET @@global.auto_increment_offset = @start_global_value;
206
 
SELECT @@global.auto_increment_offset;
207
 
SET @@session.auto_increment_offset = @start_session_value;
208
 
SELECT @@session.auto_increment_offset;
209
 
 
210
 
 
211
 
###################################################
212
 
#          END OF auto_increment_offset TESTS     #
213
 
###################################################
214