Navigation Menu

Skip to content

Commit

Permalink
Merge branch 'master' of github.com:CaptTofu/DBD-mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptTofu committed Apr 12, 2013
2 parents 9b87735 + 2d4c820 commit 4a44739
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
22 changes: 22 additions & 0 deletions dbdimp.c
Expand Up @@ -1704,6 +1704,28 @@ MYSQL *mysql_dr_connect(
mysql_options(sock, MYSQL_OPT_CONNECT_TIMEOUT,
(const char *)&to);
}
if ((svp = hv_fetch(hv, "mysql_write_timeout", 19, FALSE))
&& *svp && SvTRUE(*svp))
{
int to = SvIV(*svp);
if (DBIc_TRACE_LEVEL(imp_xxh) >= 2)
PerlIO_printf(DBIc_LOGPIO(imp_xxh),
"imp_dbh->mysql_dr_connect: Setting" \
" write timeout (%d).\n",to);
mysql_options(sock, MYSQL_OPT_WRITE_TIMEOUT,
(const char *)&to);
}
if ((svp = hv_fetch(hv, "mysql_read_timeout", 18, FALSE))
&& *svp && SvTRUE(*svp))
{
int to = SvIV(*svp);
if (DBIc_TRACE_LEVEL(imp_xxh) >= 2)
PerlIO_printf(DBIc_LOGPIO(imp_xxh),
"imp_dbh->mysql_dr_connect: Setting" \
" read timeout (%d).\n",to);
mysql_options(sock, MYSQL_OPT_READ_TIMEOUT,
(const char *)&to);
}
if ((svp = hv_fetch(hv, "mysql_read_default_file", 23, FALSE)) &&
*svp && SvTRUE(*svp))
{
Expand Down
12 changes: 12 additions & 0 deletions lib/DBD/mysql.pm
Expand Up @@ -1011,6 +1011,18 @@ If your DSN contains the option "mysql_connect_timeout=##", the connect
request to the server will timeout if it has not been successful after
the given number of seconds.
=item mysql_write_timeout
If your DSN contains the option "mysql_write_timeout=##", the write
operation to the server will timeout if it has not been successful after
the given number of seconds.
=item mysql_read_timeout
If your DSN contains the option "mysql_read_timeout=##", the read
operation to the server will timeout if it has not been successful after
the given number of seconds.
=item mysql_init_command
If your DSN contains the option "mysql_init_command_timeout=##", then
Expand Down

0 comments on commit 4a44739

Please sign in to comment.