Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#21629 closed Cleanup/optimization (fixed)

Provide better pointers to mysql_tzinfo_to_sql for MySQL users

Reported by: Aymeric Augustin Owned by: nobody
Component: Documentation Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The exception "ValueError: Database returned an invalid value in QuerySet.dates(). Are time zone definitions and pytz installed?" is quite hard to diagnose when users omitted to run mysql_tzinfo_to_sql.

Technically it says the right thing (time zone definitions aren't installed) but it's hard to locate the information, as it isn't in the MySQL installation docs nor in the time zone docs. I just spent a few minutes searching it in the docs, and I wrote these docs!

I suggest adding it to the time zone FAQ and to the MySQL installation instructions (at least).

Attachments (1)

21629.diff (1.3 KB ) - added by Tim Graham 11 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 by anonymous, 11 years ago

I've changed USE_TZ = TRUE by USE_TZ = False for solved this problem

comment:2 by loic84, 11 years ago

FWIW I've slightly improved this error message on master: [32e75803].

comment:3 by Aymeric Augustin, 11 years ago

The anonymous has done exactly what this errors message is designed to prevent.

Documentation improvements are absolutely needed.

comment:4 by loic84, 11 years ago

I agree that docs are needed, with a link to the relevant mysql docs. Do the other db require a similar treatment? I fixed the error message a while ago after hitting the problem with the test suite. Maybe the error message commit should be backported to stable as well?

Version 0, edited 11 years ago by loic84 (next)

comment:5 by Tim Graham, 11 years ago

Triage Stage: UnreviewedAccepted

comment:6 by Tim Graham, 11 years ago

Has patch: set

I backported the error message improvement and here's a draft patch.

by Tim Graham, 11 years ago

Attachment: 21629.diff added

comment:7 by Simon Charette, 11 years ago

Triage Stage: AcceptedReady for checkin

lgtm

comment:8 by Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: newclosed

In d8d83777ebbe15af7587a24698435555ba3bb842:

Fixed #21629 -- Added instructions for loading MySQL time zone definitions.

Thanks Aymeric for the suggestion.

comment:9 by Tim Graham <timograham@…>, 11 years ago

In 62f282a265ae7f8d051f7ce79788cfc1a84d1a24:

[1.6.x] Fixed #21629 -- Added instructions for loading MySQL time zone definitions.

Thanks Aymeric for the suggestion.

Backport of d8d83777eb from master

Note: See TracTickets for help on using tickets.
Back to Top