--- src/mysql_drv.c 2006-09-21 20:25:19.000000000 +0200 +++ src/mysql_drv.c.new 2007-09-21 22:12:17.092607928 +0200 @@ -2489,6 +2489,16 @@ goto FAILURE; } +#if MYSQL_VERSION_ID >= 50013 + /* enable automatic reconnect for MySQL >= 5.0.13 */ + snprintf(attrib, sizeof(attrib), "%sReconnect", prefix); + if (_ds_match_attribute(CTX->config->attributes, attrib, "true")) + { + my_bool reconnect = 1; + mysql_options(dbh, MYSQL_OPT_RECONNECT, &reconnect); + } +#endif + if (hostname[0] == '/') { if (!mysql_real_connect (dbh, NULL, user, password, db, 0, hostname,