Skip Menu |

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 79825
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: Nobody in particular
Requestors: sewi [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: 4.013



Subject: Trigger Callback on auto_reconnect
Applications run into timezone problems when using mysql_auto_reconnect with mySQL "SET time_zone": http://www.pal-blog.de/entwicklung/mysql/2012/mysql-mysql_auto_reconnect- timezone-issues.html A Callback trigger (either a new one or the DBI connect Callback) would be great to re-set options like the time_zone.
From: chrishammond [...] ymail.com
On Mon Sep 24 02:04:45 2012, SEWI wrote: Show quoted text
> Applications run into timezone problems when using
mysql_auto_reconnect Show quoted text
mysql_auto_reconnect- Show quoted text
> timezone-issues.html > > A Callback trigger (either a new one or the DBI connect Callback)
would Show quoted text
> be great to re-set options like the time_zone.
add this (available since DBD::mysql 4.013) to your connect() options hash and it'll automagically get executed whenever libmysqlclient connects (or autoreconnects) under the covers of DBD::mysql: { ... mysql_init_command => 'SET time_zone="Europe/Helsinki"', mysql_auto_reconnect => 1, ... }
Am Mi 31. Okt 2012, 19:21:23, chrishammond schrieb: Show quoted text
> add this (available since DBD::mysql 4.013) to your connect() options > hash and it'll automagically get executed whenever libmysqlclient > connects (or autoreconnects) under the covers of DBD::mysql: > > { ... > mysql_init_command => 'SET time_zone="Europe/Helsinki"', > mysql_auto_reconnect => 1, > ... } >
Doesn't help. The init_command fixes the time_zone problem, but there are many other session variables, etc. which can't be set in a single command. That's why init_command is no solution to the problem. A callback would be able to full restore the state of the connection, init_command doesn't.