Issue Details (XML | Word | Printable)

Key: MDL-12024
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Eloy Lafuente (stronk7)
Reporter: Francois Marier
Votes: 0
Watchers: 3
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

New Olson timezone files require dst_time and std_time fields of size 6 instead of 5

Created: 05/Nov/07 02:37 PM   Updated: 01/Jan/08 12:41 AM
Return to search
Component/s: Database SQL/XMLDB
Affects Version/s: 1.8.3, 1.9, 2.0
Fix Version/s: 1.8.4, 1.9, 2.0

File Attachments: 1. Text File timezone_fields_18STABLE.patch (4 kB)
2. Text File timezone_fields_19STABLE.patch (4 kB)
3. Text File timezone_fields_CVSHEAD.patch (4 kB)

Environment: Linux 2.6.22, Ubuntu 7.10, Postgres 8.1
Issue Links:
Duplicate
 
Relates
 

Database: PostgreSQL
Participants: Eloy Lafuente (stronk7), Francois Marier, Martin Dougiamas and Petr Skoda
Security Level: None
Resolved date: 01/Jan/08
Affected Branches: MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE
Fixed Branches: MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE


 Description  « Hide
These patches upgrade dst_time and std_time fields in timezone to varchar(6)

These fields were varchar(5) and that's too small to upgrade using the latest Olson data (which contains the new daylight saving rules for New Zealand for example).

The patches apply cleanly against:

  - MOODLE_18_STABLE
  - MOODLE_19_STABLE
  - CVSHEAD

Francois

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Eloy Lafuente (stronk7) added a comment - 04/Dec/07 12:06 AM
Ops,

sorry by the delay!

Just looked patches and...err... uhm... the upgrade.php scripts aren't correct. They are using the old (deprecated) table_column() that isn't cross-db at all. Should use new ddl stuff exclusively, like the proposed by the XMLDB editor.

Ciao


Eloy Lafuente (stronk7) added a comment - 10/Dec/07 03:07 AM
Hi Francois,

are you going to perform this... or should I do it ? (no problem with any alternative)

TIA and ciao


Francois Marier added a comment - 10/Dec/07 07:55 AM
After discussing this with MattC and Eloy, there is another problem that we need to watch out for:
  • the timezone.txt file distributed by moodle.org needs to be truncated to 5 characters, otherwise updates with older versions will fail

So the simplest solution would be to rename the file to "timezone2.txt" and to keep the old file around for backwards compatibility.

A better solution would be to use mod_rewrite to generate timezone.txt dynamically. With this solution, a version number could optionally be passed and a 6-character timezone file would be returned for the new Moodle versions. We could keep truncating the olson data to 5 characters to provide some kind of support for older Moodle installs.

And as Matt was saying: "if the timezone file on moodle.org was to be re-generated automatically from the latest olson DB file too it would save someone having to remember to updated it (or deal with bugs about it being out of date)"


Francois Marier added a comment - 10/Dec/07 08:11 AM
From Skype discussion, Eloy lists the next steps:
1) Move HEAD timezones.txt back to 17_STABLE timezones.txt (if are different right now).
2) Keep < 1.8 working against that file in download.moodle.org/timezones
3) Apply the patch to 18. 19 and HEAD, pointing to new URL
4) Make new URL to server HEAD timezones.
5) update HEAD timezones to new records (having 6cc entries)

Eloy Lafuente (stronk7) added a comment - 10/Dec/07 08:25 AM
I'll try to implement this tomorrow if nobody has anything against it. Ciao

Eloy Lafuente (stronk7) added a comment - 15/Dec/07 09:07 AM
First part done:

Now 18_STABLE, 19_STABLE and HEAD have varchar(6) in those timezone fields.

Now the second part. What I've planned is:

1) Backport current HEAD timezones.txt to 16_STABLE and 17_STABLE
2) Make the current URL: http://download.moodle.org/timezones to return 17_STABLE timezones

(with these 2 points it's guaranteed that moodle versions < 1.8 will always use old varchar(5) olson files)

3) Create one new URL: http://download.moodle.org/timezones_info to return HEAD timezones.
4) Point 18_STABLE, 19_STABLE and HEAD to that new location

(with these 2 points, all moodle versions >= 1.8 will use the new varchar(6) olson files, so we'll be able to update them).

An alternative to this separated URLs is to use a common one, but using some parameter. But I think it's clear to keep them separated.

Any comment / idea... ?

I'll wait a few days until receiving some feedback from MD. After all, those URLs are pointing to his servers, hehe.

Ciao


Martin Dougiamas added a comment - 20/Dec/07 03:10 PM
Yes, better to make a new location I think.

I would just suggest calling it /lib/timezone.txt and http://download.moodle.org/timezone/ instead.


Petr Skoda added a comment - 31/Dec/07 06:32 AM
binary downloads working again in 19dev...

Eloy Lafuente (stronk7) added a comment - 01/Jan/08 12:41 AM
Done. Now:

Moodle <= 17_STABLE is using the old "timezones" locations.
Moodle >= 18_STABLE is using the new "timezone" locations.

Timezones information updated from ftp://elsie.nci.nih.gov/pub/ (2007j data), with zones from africa, antarctica,
asia, australasia, europe, northamerica and southamerica (1976 rules).

Closing...ciao