[Maria-developers] Patch for Windows problem with setting TZ

2010-01-16 Thread Kristian Nielsen
Hi,

Alex Budovski has done some work to debug why some tests (binlog tests in
particular) are failing on Windows, and found that this is because
mysql-test-run.pl set the TZ variable. This interacts poorly with the Windows
Operating System.

It's actually only a few test cases that need to set TZ. Here is a quick patch
that avoids the need to set TZ except for tests that specifically requests it
(with the already existing --timezone=XXX mechanism in -master.opt).

Opinions?

 - Kristian.

=== modified file 'mysql-test/include/ps_conv.inc'
--- mysql-test/include/ps_conv.inc	2007-07-04 09:20:53 +
+++ mysql-test/include/ps_conv.inc	2010-01-16 11:40:42 +
@@ -30,6 +30,9 @@
 --disable_warnings
 drop table if exists t5 ;
 --enable_warnings
+--disable_query_log
+SET TIME_ZONE= '+03:00';
+--enable_query_log
 set @arg01= 8;
 set @arg02= 8.0;
 set @arg03= 80.000e-1;

=== modified file 'mysql-test/mysql-test-run.pl'
--- mysql-test/mysql-test-run.pl	2010-01-06 21:27:53 +
+++ mysql-test/mysql-test-run.pl	2010-01-16 11:53:58 +
@@ -3425,7 +3425,7 @@ sub restart_forced_by_test
 # Return timezone value of tinfo or default value
 sub timezone {
   my ($tinfo)= @_;
-  return $tinfo->{timezone} || "GMT-3";
+  return $tinfo->{timezone} || "DEFAULT";
 }
 
 
@@ -3455,7 +3455,9 @@ sub run_testcase ($$) {
   # Init variables that can change between each test case
   # ---
   my $timezone= timezone($tinfo);
-  $ENV{'TZ'}= $timezone;
+  if ($timezone ne 'DEFAULT') {
+$ENV{'TZ'}= $timezone;
+  }
   mtr_verbose("Setting timezone: $timezone");
 
   if ( ! using_extern() )

=== modified file 'mysql-test/suite/binlog/r/binlog_unsafe.result'
--- mysql-test/suite/binlog/r/binlog_unsafe.result	2010-01-15 15:27:55 +
+++ mysql-test/suite/binlog/r/binlog_unsafe.result	2010-01-16 11:36:09 +
@@ -380,6 +380,7 @@ INSERT INTO t1 VALUES (VERSION());
 Warnings:
 Note	1592	Statement may not be safe to log in statement format.
 DELETE FROM t1;
+SET TIME_ZONE= '+03:00';
 SET TIMESTAMP=100;
 INSERT INTO t1 VALUES
 (CURDATE()),

=== modified file 'mysql-test/suite/binlog/t/binlog_unsafe.test'
--- mysql-test/suite/binlog/t/binlog_unsafe.test	2010-01-15 15:27:55 +
+++ mysql-test/suite/binlog/t/binlog_unsafe.test	2010-01-16 11:35:52 +
@@ -422,6 +422,7 @@ DELETE FROM t1;
 # following following functions depend on the TIMESTAMP variable and
 # don't generate a warning.
 
+SET TIME_ZONE= '+03:00';
 SET TIMESTAMP=100;
 INSERT INTO t1 VALUES
   (CURDATE()),

=== modified file 'mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result'
--- mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result	2008-11-04 17:07:14 +
+++ mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result	2010-01-16 11:33:22 +
@@ -18,6 +18,7 @@ Server_id	Host	Port	Rpl_recovery_rank	Ma
 drop table t1;
 stop slave;
 create table t2(id int auto_increment primary key, created datetime);
+SET TIME_ZONE= '+03:00';
 set timestamp=12345;
 insert into t2 set created=now();
 select * from t2;

=== modified file 'mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test'
--- mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test	2007-06-27 12:28:02 +
+++ mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test	2010-01-16 11:32:56 +
@@ -23,6 +23,7 @@ connection master;
 # Test replication of timestamp
 
 create table t2(id int auto_increment primary key, created datetime);
+SET TIME_ZONE= '+03:00';
 set timestamp=12345;
 insert into t2 set created=now();
 select * from t2;

=== added file 'mysql-test/t/mysqlbinlog2-master.opt'
--- mysql-test/t/mysqlbinlog2-master.opt	1970-01-01 00:00:00 +
+++ mysql-test/t/mysqlbinlog2-master.opt	2010-01-16 12:00:07 +
@@ -0,0 +1 @@
+--timezone=GMT-3

___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


[Maria-developers] Patch for Windows problem with setting TZ

2010-01-17 Thread Michael Widenius

Hi!

> "Kristian" == Kristian Nielsen  writes:

Kristian> Hi, Alex Budovski has done some work to debug why some tests
Kristian> (binlog tests in particular) are failing on Windows, and
Kristian> found that this is because mysql-test-run.pl set the TZ
Kristian> variable. This interacts poorly with the Windows Operating
Kristian> System.

Kristian> It's actually only a few test cases that need to set
Kristian> TZ. Here is a quick patch that avoids the need to set TZ
Kristian> except for tests that specifically requests it (with the
Kristian> already existing --timezone=XXX mechanism in -master.opt).

I think the patch is ok and should make things a bit safer, so ok to
push.

Regards,
Monty

___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Maria-developers] Patch for Windows problem with setting TZ

2010-01-16 Thread Sergei Golubchik
Hi, Kristian!

On Jan 16, Kristian Nielsen wrote:
> Hi,
> 
> Alex Budovski has done some work to debug why some tests (binlog tests in
> particular) are failing on Windows, and found that this is because
> mysql-test-run.pl set the TZ variable. This interacts poorly with the Windows
> Operating System.
> 
> It's actually only a few test cases that need to set TZ. Here is a quick patch
> that avoids the need to set TZ except for tests that specifically requests it
> (with the already existing --timezone=XXX mechanism in -master.opt).
> 
> Opinions?

Why we didn't have this problem with MySQL in pushbuild ? 

Regards,
Sergei

___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Maria-developers] Patch for Windows problem with setting TZ

2010-01-16 Thread Kristian Nielsen
Sergei Golubchik  writes:

>> Alex Budovski has done some work to debug why some tests (binlog tests in
>> particular) are failing on Windows, and found that this is because
>> mysql-test-run.pl set the TZ variable. This interacts poorly with the Windows
>> Operating System.
>> 
>> It's actually only a few test cases that need to set TZ. Here is a quick 
>> patch
>> that avoids the need to set TZ except for tests that specifically requests it
>> (with the already existing --timezone=XXX mechanism in -master.opt).
>> 
>> Opinions?
>
> Why we didn't have this problem with MySQL in pushbuild ? 

Yeah, that's what I asked myself as well?

I remember that for long we did not run replication tests on Windows (because
they had tons of failures), maybe binlog tests also. But I kind of thought
that was fixed some time ago, don't remember for sure though.

Or maybe the Pushbuild Windows hosts were set to the +03:00 time zone.

Can't think of any better reason atm.

 - Kristian.

___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Maria-developers] Patch for Windows problem with setting TZ

2010-01-16 Thread Kristian Nielsen
Kristian Nielsen  writes:

>> Why we didn't have this problem with MySQL in pushbuild ? 
>
> Yeah, that's what I asked myself as well?

Or maybe it shows only on some Windows systems. I remember Igor and Sergey saw
binlog test failures on one Windows system and not on another.

 - Kristian.

___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Maria-developers] Patch for Windows problem with setting TZ

2010-01-19 Thread Kristian Nielsen
Sergei Golubchik  writes:

> On Jan 16, Kristian Nielsen wrote:

>> It's actually only a few test cases that need to set TZ. Here is a quick 
>> patch
>> that avoids the need to set TZ except for tests that specifically requests it
>> (with the already existing --timezone=XXX mechanism in -master.opt).

> Why we didn't have this problem with MySQL in pushbuild ? 

With the help of Alex Budovski I think I now have the answer:

The binlog failures happen because when the TZ variable is changed to +03:00
on boxes with USA time zone (or similar), PURGE BEFORE DATE statements picks
up the wrong files, apparently TZ only affects some parts of the system
(localtime()), not others (file dates). But on boxes with European times
zones, that particular TZ change happens to not affect those statements...

And in fact Igor in USA previously got binlog failures while boxes in Buildbot
and at MySQL without the failures were in European time zones...

I will push my fix after full tests.

 - Kristian.

___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Maria-developers] Patch for Windows problem with setting TZ

2010-01-26 Thread Kristian Nielsen
Kristian Nielsen  writes:

> The binlog failures happen because when the TZ variable is changed to +03:00
> on boxes with USA time zone (or similar), PURGE BEFORE DATE statements picks
> up the wrong files, apparently TZ only affects some parts of the system
> (localtime()), not others (file dates). But on boxes with European times
> zones, that particular TZ change happens to not affect those statements...
>
> And in fact Igor in USA previously got binlog failures while boxes in Buildbot
> and at MySQL without the failures were in European time zones...
>
> I will push my fix after full tests.

I got a lot of random test failures with this patch unfortunately.

I'm speculating that this is somehow related to settings from one test
affecting another now that TZ is no longer set before every test. I need to
investigate more though.

 - Kristian.

___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp