List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:February 20 2007 11:50pm
Subject:Re: MySQL Daylight Savings Time Patch
View as plain text  
At 4:40 PM -0600 2/20/07, Ryan Stille wrote:
>Is there an easy way to test to see if MySQL already has the proper 
>tables loaded?
>
>-Ryan

Yes, reload them. :-)  After that, they're current!

If you really want a non-reload test, you can do something like this
(Credits: This example comes from Peter Gulutzan)

Find out the time zone id for the region:

mysql> select * from mysql.time_zone_name
     -> where Name = 'America/Edmonton';
+------------------------+--------------+
| Name                   | Time_zone_id |
+------------------------+--------------+
| America/Edmonton       |          100 |
+------------------------+--------------+
1 row in set (0.97 sec)

Find out the transition dates for that zone in this year:

mysql> select * from time_zone_transition
     -> where Time_zone_id =
     -> and Transition_time between 1167634800 and 1199170799
     -> order by Time_zone_id,Transition_time;
+--------------+-----------------+--------------------+
| Time_zone_id | Transition_time | Transition_type_id |
+--------------+-----------------+--------------------+
|          100 |      1175418000 |                  1 |
|          100 |      1193558400 |                  2 |
+--------------+-----------------+--------------------+
2 rows in set (0.00 sec)

Find out what '1175418000' and '1193558400' mean:

mysql> select from_unixtime(1175418000);
+---------------------------+
| from_unixtime(1175418000) |
+---------------------------+
| 2007-04-01 03:00:00       |
+---------------------------+
1 row in set (0.00 sec)

mysql> select from_unixtime(1193558400);
+---------------------------+
| from_unixtime(1193558400) |
+---------------------------+
| 2007-10-28 01:00:00       |
+---------------------------+
1 row in set (0.00 sec)

Diagnosis: this database thinks the switch is on April 1,
which is wrong. Cure: update your operating system files,
check the "MySQL Server Time Zone Support" section of
the manual, and update the table.


So, as you can see, it's probably easier just to reload the files.


>
>Paul DuBois wrote:
>>At 4:17 PM -0600 2/20/07, Paul DuBois wrote:
>>>At 4:36 PM -0500 2/20/07, Sun, Jennifer wrote:
>>>>Any answers for the question below ?
>>>>
>>>>Is there a DST patch for MySql 4.0.20?   Thanks.
>>>>
>>>>-----Original Message-----
>>>>From: dpgirago@stripped [mailto:dpgirago@stripped]
>>>>Sent: Friday, February 09, 2007 9:30 AM
>>>>To: mysql@stripped
>>>>Subject: MySQL Daylight Savings Time Patch
>>>>
>>>>Is there a DST patch for MySQL 4.0.x series?
>>>>
>>>>I've been getting scary emails from our sys and net admins about
>>>>impending
>>>>doom.
>>>>
>>>>Thanks,
>>>>
>>>>David
>>>
>>>Before MySQL 4.1.3, the server gets its time zone from the operating system
>>>at startup.  The time zone can be specified explicitly by setting the TZ
>>>TZ environment variable setting, or by using the --timezone option to the
>>>mysqld_safe server startup script.
>>>
>>>Assuming that the server host itself has had its operating system updated
>>>to handle the new Daylight Saving Time rules, that should be all that's
>>>necessary for MySQL to know the correct time.
>>
>>I should mention also:
>>
>>For those of you running 4.1.3 or later, to get your MySQL server to
>>know about the new DST rules, you should make sure your OS is updated
>>with the new zoneinfo files, and then reload those files into MySQL
>>with mysql_tzinfo_to_sql.  See:
>>
>>http://dev.mysql.com/doc/mysql/en/time-zone-support.html
>>
>>Particularly the Note in the middle of the page and the last few paragraphs.
>>
>>You may have previously loaded your system's zoneinfo files into MySQL,
>>but when those zoneinfo files are updated, the changes do not automatically
>>propagate to MySQL's time zone tables.  You must reload the tables to update
>>them.
>>
>
>
>
>--
>MySQL General Mailing List
>For list archives: http://lists.mysql.com/mysql
>To unsubscribe:    http://lists.mysql.com/mysql?unsub=1


-- 
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
Thread
MySQL Daylight Savings Time Patchdpgirago9 Feb
  • RE: MySQL Daylight Savings Time PatchJennifer Sun20 Feb
    • Re: MySQL Daylight Savings Time PatchChris White20 Feb
      • Re: MySQL Daylight Savings Time PatchDan Buettner20 Feb
        • RE: MySQL Daylight Savings Time PatchJennifer Sun20 Feb
  • Re: MySQL Daylight Savings Time PatchAaron Cannon21 Feb
  • Re: MySQL Daylight Savings Time Patch - easy checkMike Blezien24 Feb
    • Re: MySQL Daylight Savings Time Patch - easy checkRyan Stille24 Feb
  • Re: MySQL Daylight Savings Time Patch - easy checkMike Blezien24 Feb
RE: MySQL Daylight Savings Time PatchPaul DuBois20 Feb
  • RE: MySQL Daylight Savings Time PatchPaul DuBois20 Feb
    • Re: MySQL Daylight Savings Time PatchRyan Stille20 Feb
      • Re: MySQL Daylight Savings Time PatchPaul DuBois20 Feb
        • Re: MySQL Daylight Savings Time PatchRyan Stille24 Feb
          • Re: MySQL Daylight Savings Time PatchRyan Stille24 Feb
          • Re: MySQL Daylight Savings Time Patch - easy checkRyan Stille24 Feb
            • Re: MySQL Daylight Savings Time Patch - easy check(Terry Riley)25 Feb
            • RE: MySQL Daylight Savings Time Patch - easy checkJerry Schwartz28 Feb
              • Re: MySQL Daylight Savings Time Patch - easy checkRyan Stille28 Feb
                • Re: MySQL Daylight Savings Time Patch - easy checkWilliam R. Mussatto28 Feb
                  • Re: MySQL Daylight Savings Time Patch - easy checkNĂ©stor1 Mar
                    • Re: MySQL Daylight Savings Time Patch - easy checkRyan Stille1 Mar
                • RE: MySQL Daylight Savings Time Patch - easy checkJerry Schwartz1 Mar
                • RE: MySQL Daylight Savings Time Patch - easy checkJerry Schwartz1 Mar
  • RE: MySQL Daylight Savings Time PatchJerry Schwartz21 Feb
RE: MySQL Daylight Savings Time PatchPaul DuBois20 Feb
  • RE: MySQL Daylight Savings Time PatchJerry Schwartz21 Feb