sql_date_format() method for SQLite has an incorrect default format

RESOLVED FIXED in Bugzilla 4.2

Status

()

Bugzilla
Database
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: Frédéric Buclin, Assigned: Frédéric Buclin)

Tracking

4.2.7
Bugzilla 4.2
Bug Flags:
approval +
approval4.4 +
approval4.2 +

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
editusers.cgi calls $dbh->sql_date_format('profiles_activity.profiles_when') to display changes of a user account (see action eq "activity"). When no format is passed to this method, it falls back to "%Y.%m.%d %H:%M:%s", but on SQLite, %s means "seconds since 1970-01-01", see http://www.sqlite.org/lang_datefunc.html. What we want is %S.

This means that "2013.11.13 13:53:25" is displayed as "2013.11.13 13:53:1384350805".

This could potentially cause more trouble, e.g. when passed to DateTime as the string would be unparsable or return a date object with wrong data in it.
(Assignee)

Comment 1

4 years ago
Created attachment 831535 [details] [diff] [review]
patch, v1
Assignee: database → LpSolit
Status: NEW → ASSIGNED
Attachment #831535 - Flags: review?(glob)
(Assignee)

Comment 2

4 years ago
Note that SQLite support has been added in Bugzilla 4.2, see bug 337776.
Comment on attachment 831535 [details] [diff] [review]
patch, v1

r=glob
Attachment #831535 - Flags: review?(glob) → review+
Flags: approval4.4+
Flags: approval4.2+
Flags: approval+
(Assignee)

Comment 4

4 years ago
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/DB/Sqlite.pm
Committed revision 8811.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.4/
modified Bugzilla/DB/Sqlite.pm
Committed revision 8637.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.2/
modified Bugzilla/DB/Sqlite.pm
Committed revision 8238.
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Depends on: 337776
Resolution: --- → FIXED
(Assignee)

Comment 5

3 years ago
Added to relnotes for 4.4.2.
You need to log in before you can comment on or make changes to this bug.