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

« back to all changes in this revision

Viewing changes to mysql-test/t/time_zone_func.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\time_zone_func.test #############################
2
 
#                                                                          #
3
 
# Variable Name: time_zone                                                 #
4
 
# Scope: GLOBAL, SESSION                                                   #
5
 
# Access Type: Dynamic                                                     #
6
 
# Data Type: STRING                                                        #
7
 
# Default Value: TRUE 1, FALSE 0                                           #
8
 
# Values:       FALSE 0                                                    #
9
 
#                                                                          #
10
 
#                                                                          #
11
 
# Creation Date: 2008-02-25                                                #
12
 
# Author:  Sharique Abdullah                                               #
13
 
#                                                                          #
14
 
# Description: Test Cases of Dynamic System Variable "time_zone"           #
15
 
#              that checks behavior of this variable in the following ways #
16
 
#              * Functionality based on different values                   #
17
 
#                                                                          #
18
 
# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html        #
19
 
#                                                                          #
20
 
############################################################################
21
 
 
22
 
--echo ** Setup **
23
 
--echo
24
 
#
25
 
# Setup
26
 
#
27
 
 
28
 
SET @session_time_zone = @@SESSION.time_zone;
29
 
SET @global_time_zone = @@GLOBAL.time_zone;
30
 
 
31
 
CREATE TABLE t1 (a datetime);
32
 
CREATE TABLE t2 (a timestamp);
33
 
 
34
 
--echo '#-----------------------------FN_DYNVARS_177_01--------------------#'
35
 
#
36
 
# Value DEFAULT
37
 
#
38
 
SET @@time_zone = DEFAULT;
39
 
 
40
 
SELECT @@time_zone;
41
 
--echo SYSTEM Expected
42
 
 
43
 
--echo '#-----------------------------FN_DYNVARS_177_02-------------------#'
44
 
#
45
 
# Testing difference values
46
 
#
47
 
 
48
 
SET @@time_zone = '+05:00';
49
 
 
50
 
SELECT @@time_zone;
51
 
--echo +05:00 Expected
52
 
 
53
 
SET @@time_zone = '-01:00';
54
 
 
55
 
SELECT @@time_zone;
56
 
--echo -01:00 Expected
57
 
 
58
 
SET @@time_zone = '+00:00';
59
 
 
60
 
SELECT @@time_zone;
61
 
--echo +00:00 Expected
62
 
 
63
 
SET @@time_zone = '-00:00';
64
 
 
65
 
SELECT @@time_zone;
66
 
--echo -00:00 Expected
67
 
 
68
 
--echo '#-----------------------------FN_DYNVARS_177_03----------------#'
69
 
#
70
 
# Setting possible values
71
 
#
72
 
 
73
 
SET @@time_zone = '+00:00';
74
 
 
75
 
INSERT INTO t1 VALUES('2008-03-05 16:28:00');
76
 
INSERT INTO t1 VALUES('1970-01-01 00:05:00'),('1970-01-01 01:05:00');
77
 
INSERT INTO t2 VALUES(20080305162800);
78
 
INSERT INTO t2 VALUES(19730101235900);
79
 
INSERT INTO t2 VALUES('1970-01-01 00:05:00'),('1970-01-01 01:05:00');
80
 
INSERT INTO t2 VALUES(19700101000500);
81
 
 
82
 
SELECT a,UNIX_TIMESTAMP(a) FROM t1;
83
 
SELECT a,UNIX_TIMESTAMP(a) FROM t2;
84
 
 
85
 
SET @@time_zone = 'MET';
86
 
 
87
 
SELECT a,UNIX_TIMESTAMP(a) FROM t1;
88
 
SELECT a,UNIX_TIMESTAMP(a) FROM t2;
89
 
 
90
 
SET @@time_zone = '+05:00';
91
 
 
92
 
SELECT a,UNIX_TIMESTAMP(a) FROM t1;
93
 
SELECT a,UNIX_TIMESTAMP(a) FROM t2;
94
 
 
95
 
SET @@time_zone = '+06:00';
96
 
SELECT a,UNIX_TIMESTAMP(a) FROM t1;
97
 
SELECT a,UNIX_TIMESTAMP(a) FROM t2;
98
 
 
99
 
SET @@time_zone = '+01:00';
100
 
 
101
 
SELECT a,UNIX_TIMESTAMP(a) FROM t1;
102
 
SELECT a,UNIX_TIMESTAMP(a) FROM t2;
103
 
 
104
 
SET @@time_zone = '+02:00';
105
 
 
106
 
SELECT a,UNIX_TIMESTAMP(a) FROM t1;
107
 
SELECT a,UNIX_TIMESTAMP(a) FROM t2;
108
 
 
109
 
SET @@time_zone = '+00:00';
110
 
 
111
 
SELECT a,UNIX_TIMESTAMP(a) FROM t1;
112
 
SELECT a,UNIX_TIMESTAMP(a) FROM t2;
113
 
 
114
 
SET @@time_zone = '+06:00';
115
 
 
116
 
SELECT a,UNIX_TIMESTAMP(a) FROM t1;
117
 
SELECT a,UNIX_TIMESTAMP(a) FROM t2;
118
 
 
119
 
--echo Potential Feature: upon recovery of timezone,
120
 
--echo the original value of the timestamp should be recovered.
121
 
 
122
 
--echo '#-----------------------------FN_DYNVARS_177_04--------------------#'
123
 
#
124
 
# Testing invalid values
125
 
#
126
 
--error ER_UNKNOWN_TIME_ZONE
127
 
SET @@time_zone = '6';
128
 
 
129
 
 
130
 
--echo '#-----------------------------FN_DYNVARS_177_05---------------#'
131
 
#
132
 
# Session data integrity check & GLOBAL Value check
133
 
#
134
 
 
135
 
SET GLOBAL time_zone = 'SYSTEM';
136
 
 
137
 
--echo ** Connecting con_int1 using root **
138
 
connect (con_int1,localhost,root,,);
139
 
 
140
 
--echo ** Connection con_int1 **
141
 
connection con_int1;
142
 
SELECT @@SESSION.time_zone;
143
 
--echo SYSTEM Expected
144
 
 
145
 
SET SESSION time_zone = '+05:00';
146
 
 
147
 
--echo ** Connecting con_int2 using root **
148
 
connect (con_int2,localhost,root,,);
149
 
 
150
 
--echo ** Connection con_int2 **
151
 
connection con_int2;
152
 
SELECT @@SESSION.time_zone;
153
 
--echo SYSTEM Expected
154
 
 
155
 
SET SESSION time_zone = '-10:00';
156
 
 
157
 
--echo ** Connection con_int2 **
158
 
connection con_int2;
159
 
SELECT @@SESSION.time_zone;
160
 
--echo -10:00 Expected
161
 
 
162
 
--echo ** Connection con_int1 **
163
 
connection con_int1;
164
 
SELECT @@SESSION.time_zone;
165
 
--echo +05:00 Expected
166
 
 
167
 
 
168
 
SELECT @@GLOBAL.time_zone;
169
 
--echo SYSTEM Expected
170
 
 
171
 
--echo ** Connection default **
172
 
connection default;
173
 
 
174
 
--echo Disconnecting Connections con_int1, con_int2
175
 
disconnect con_int1;
176
 
disconnect con_int2;
177
 
 
178
 
 
179
 
#
180
 
# Cleanup
181
 
#
182
 
 
183
 
 
184
 
SET @@SESSION.time_zone = @session_time_zone;
185
 
SET @@GLOBAL.time_zone = @global_time_zone;
186
 
 
187
 
DROP TABLE t1;
188
 
DROP TABLE t2;