Merge lp:~stefanor/ibid/pg-tz-417184 into lp:~ibid-core/ibid/old-trunk-pack-0.92

Proposed by Stefano Rivera
Status: Merged
Approved by: Jonathan Hitchcock
Approved revision: 739
Merged at revision: 742
Proposed branch: lp:~stefanor/ibid/pg-tz-417184
Merge into: lp:~ibid-core/ibid/old-trunk-pack-0.92
Diff against target: None lines
To merge this branch: bzr merge lp:~stefanor/ibid/pg-tz-417184
Reviewer Review Type Date Requested Status
Jonathan Hitchcock Approve
Michael Gorven Approve
Review via email: mp+10880@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Gorven (mgorven) wrote :

Wow, databases suck.
 review approve

review: Approve
Revision history for this message
Jonathan Hitchcock (vhata) wrote :

What he said.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ibid/core.py'
--- ibid/core.py 2009-07-15 22:28:01 +0000
+++ ibid/core.py 2009-08-29 21:22:27 +0000
@@ -305,11 +305,19 @@
305 c.execute("SET storage_engine=%s;" % mysql_engine)305 c.execute("SET storage_engine=%s;" % mysql_engine)
306 c.execute("SET time_zone='+0:00';")306 c.execute("SET time_zone='+0:00';")
307 c.close()307 c.close()
308
309 engine.pool.add_listener(MySQLModeListener())308 engine.pool.add_listener(MySQLModeListener())
310309
311 engine.dialect.use_ansiquotes = True310 engine.dialect.use_ansiquotes = True
312311
312 elif uri.startswith('postgres://'):
313 class PGSQLModeListener(object):
314 def connect(self, dbapi_con, con_record):
315 c = dbapi_con.cursor()
316 c.execute("SET TIME ZONE UTC")
317 c.close()
318
319 engine.pool.add_listener(PGSQLModeListener())
320
313 self[name] = scoped_session(sessionmaker(bind=engine))321 self[name] = scoped_session(sessionmaker(bind=engine))
314322
315 self.log.info(u"Loaded %s database", name)323 self.log.info(u"Loaded %s database", name)

Subscribers

People subscribed via source and target branches