From: Brion Vibber Date: Mon, 31 Jan 2011 19:45:19 +0000 (-0800) Subject: Fix for ticket #3020: set MySQL session time_zone variable to UTC ('+0:00') so TIMEST... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=54f7154db8146e42dfa557d3d0651fd3255ac380;p=quix0rs-gnu-social.git Fix for ticket #3020: set MySQL session time_zone variable to UTC ('+0:00') so TIMESTAMP column values are comparable against our other UTC timestamp values. MySQL stores TIMESTAMP columns as UTC, but with a local time interface. (SRSLY?!) DATETIME columns are always bare and assumed to be local time, but we keep only UTC in them. Forcing the session time_zone to UTC means we won't have to worry as much about what we're sending/receiving in there. Also will let us remove the hack in master commit a7abb2323e7d57125b9fbc903a1cecc06c27944e for session tweaks --- diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index d50b4071d1..a3c2de8e64 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -480,6 +480,10 @@ class Memcached_DataObject extends Safe_DataObject } } } + // Needed to make timestamp values usefully comparable. + if (common_config('db', 'type') == 'mysql') { + parent::_query("set time_zone='+0:00'"); + } } return $result;