Bug #59570 in_multicolumn_calendar_unique_constraint_ignore fails with wrong TZ
Submitted: 17 Jan 2011 21:22 Modified: 15 Oct 2012 13:41
Reporter: Thomas Jones-Low Email Updates:
Status: Closed Impact on me:
None 
Category:Tests: Server Severity:S3 (Non-critical)
Version:5.5.8 OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Tags: mtr

[17 Jan 2011 21:22] Thomas Jones-Low
Description:
If my system timezone is set to other than UTC +3, the engines/funcs/in_multicolumn_calendar_unique_constraint_ignore test (and other calendar tests) fail 

$ ./mtr --extern socket=/tmp/mysql.sock --suite=engines/funcs in_multicolumn_calendar_unique_constraint_ignore
Logging: f
MySQL Version 5.5.8
Checking supported features...
 - skipping ndbcluster
 - skipping SSL, mysqld not compiled with SSL
Collecting tests...
vardir: /usr/local/mysql-5.5.8/mysql-test/var
Using server port 42052

==============================================================================

TEST                                      RESULT   TIME (ms)
------------------------------------------------------------

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009

engines/funcs.in_multicolumn_calendar_unique_constraint_ignore [ fail ]
        Test ended at 2011-01-17 15:43:17

--- /usr/local/mysql-5.5.8/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_ignore.result	2010-12-03 20:58:25.000000000 +0300
+++ /usr/local/mysql-5.5.8/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_ignore.reject	2011-01-17 23:43:17.612065346 +0300
@@ -62,10 +62,10 @@
 INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01'));
 SELECT * FROM t1;
 c1	c2	c3
-09:09:33	09:09:33	09:09:33
-09:09:33	09:09:33	10:10:34
-09:09:33	10:10:34	09:09:33
-10:10:34	09:09:33	09:09:33
+01:09:33	01:09:33	01:09:33
+01:09:33	01:09:33	02:10:34
+01:09:33	02:10:34	01:09:33
+02:10:34	01:09:33	01:09:33
 DROP TABLE t1;
 CREATE TABLE t1(c1 YEAR NULL, c2 YEAR NULL, c3 YEAR NULL, UNIQUE(c1,c2,c3));
 INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,1999);
@@ -91,10 +91,10 @@
 INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01'));
 SELECT * FROM t1;
 c1	c2	c3
-2007-02-13 09:09:33	2007-02-13 09:09:33	2007-02-13 09:09:33
-2007-02-13 09:09:33	2007-02-13 09:09:33	2007-02-14 10:10:34
-2007-02-13 09:09:33	2007-02-14 10:10:34	2007-02-13 09:09:33
-2007-02-14 10:10:34	2007-02-13 09:09:33	2007-02-13 09:09:33
+2007-02-13 01:09:33	2007-02-13 01:09:33	2007-02-13 01:09:33
+2007-02-13 01:09:33	2007-02-13 01:09:33	2007-02-14 02:10:34
+2007-02-13 01:09:33	2007-02-14 02:10:34	2007-02-13 01:09:33
+2007-02-14 02:10:34	2007-02-13 01:09:33	2007-02-13 01:09:33
 DROP TABLE t1;
 CREATE TABLE t1(c1 YEAR NULL, c2 YEAR NULL, c3 YEAR NULL, UNIQUE(c1,c2,c3));
 INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,1999);
@@ -120,10 +120,10 @@
 INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01'));
 SELECT * FROM t1;
 c1	c2	c3
-2007-02-13 09:09:33	2007-02-13 09:09:33	2007-02-13 09:09:33
-2007-02-13 09:09:33	2007-02-13 09:09:33	2007-02-14 10:10:34
-2007-02-13 09:09:33	2007-02-14 10:10:34	2007-02-13 09:09:33
-2007-02-14 10:10:34	2007-02-13 09:09:33	2007-02-13 09:09:33
+2007-02-13 01:09:33	2007-02-13 01:09:33	2007-02-13 01:09:33
+2007-02-13 01:09:33	2007-02-13 01:09:33	2007-02-14 02:10:34
+2007-02-13 01:09:33	2007-02-14 02:10:34	2007-02-13 01:09:33
+2007-02-14 02:10:34	2007-02-13 01:09:33	2007-02-13 01:09:33
 DROP TABLE t1;
 CREATE TABLE t1(c1 YEAR NULL, c2 YEAR NULL, c3 YEAR NULL, UNIQUE(c1,c2,c3));
 INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,1999);

mysqltest: Result content mismatch

 - saving '/usr/local/mysql-5.5.8/mysql-test/var/log/engines/funcs.in_multicolumn_calendar_unique_constraint_ignore/' to '/usr/local/mysql-5.5.8/mysql-test/var/log/funcs.in_multicolumn_calendar_unique_constraint_ignore/'
------------------------------------------------------------
The servers were restarted 0 times
Spent 0.000 of 2 seconds executing testcases

Completed: Failed 1/1 tests, 0.00% were successful.

Failing test(s): engines/funcs.in_multicolumn_calendar_unique_constraint_ignore

The log files in var/log may give you some hint of what went wrong.

If you want to report this error, please read first the documentation
at http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html

mysql-test-run: *** ERROR: there were failing test cases

How to repeat:
./mtr --suite=engines/funcs in_multicolumn_calendar_unique_constraint_ignore

Suggested fix:
Set the timezone correctly in the test to match the expected results.
[20 Jan 2011 11:53] Sveta Smirnova
Thank you for the report.

Verified as described.

Also db_alter_character_set  from the same suite has similar problem:

 def    information_schema      utf8    utf8_general_ci NULL
-def    mtr     latin1  latin1_swedish_ci       NULL

etc.
[21 Jan 2011 10:05] Vinay Fisrekar
Following 10 calender test failed with listed bug.
engines/funcs.de_calendar_range engines/funcs.in_calendar_2_unique_constraints_duplicate_update engines/funcs.in_calendar_pk_constraint_duplicate_update engines/funcs.in_calendar_pk_constraint_error engines/funcs.in_calendar_pk_constraint_ignore engines/funcs.in_calendar_unique_constraint_duplicate_update engines/funcs.in_calendar_unique_constraint_error engines/funcs.in_calendar_unique_constraint_ignore engines/funcs.in_multicolumn_calendar_pk_constraint_duplicate_update engines/funcs.in_multicolumn_calendar_pk_constraint_error

Thomas Jones-Low ,
As suggested in bug comment, we will need to set correct timezone in test files.
Result matches by adding following timezone setting in test file
set time_zone="+03:00";

Sveta Smirnova ,
Not sure "db_alter_character_set" is failing due to this bug because it queries and alter "INFORMATION_SCHEMA.SCHEMATA" table.
[27 Jan 2011 11:27] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/129737

3571 Vinay Fisrekar	2011-01-27
      BUG#59570 in_multicolumn_calendar_unique_constraint_ignore fails with wrong TZ
      
      Added correct timezone setting to match result.
[15 Oct 2012 13:41] Erlend Dahl
Fixed in 5.1.60.