brianmario/mysql2 — pull request #501 by marcinbunsch (2014-04-03 08:20:45+00:00)
Title: Allow setting the init command on the connection.

When reconnect is enabled, it is handled within libmysqlclient.

In such case, if a connection sets any session variables after connecting,
they will be lost after the reconnection.

I've prepared a fix which exposes the init_command option in libmysqlclient. It only allows setting of a single command, but since you only set it once, it seems like a good solution (when you create an Mysql2::Client object, because this option must be set after init and before connect).