Skip to content

Fix method redefinition warnings in threads on Perl >= 5.16 #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 16, 2013
Merged

Fix method redefinition warnings in threads on Perl >= 5.16 #21

merged 1 commit into from
Oct 16, 2013

Conversation

ilmari
Copy link
Contributor

@ilmari ilmari commented Oct 15, 2013

$drh gets cleared on CLONE, but the driver methods persist.
Due to a bug, this didn't warn until Perl 5.16

$ perl -Mthreads -MDBI -MDBD::mysql -we 'DBI->setup_driver("DBD::mysql");' \
  -e 'DBD::mysql->driver; threads->create(sub { DBD::mysql->driver })->join'
Subroutine DBI::db::mysql_fd redefined at ${archlib}/DBI.pm line 1393.
Subroutine DBI::db::mysql_async_result redefined at ${archlib}/DBI.pm line 1393.
Subroutine DBI::db::mysql_async_ready redefined at ${archlib}/DBI.pm line 1393.
Subroutine DBI::st::mysql_async_result redefined at ${archlib}/DBI.pm line 1393.
Subroutine DBI::st::mysql_async_ready redefined at ${archlib}/DBI.pm line 1393.

$drh gets cleared on CLONE, but the driver methods persist.
Due to a bug, this didn't warn until Perl 5.16

$ perl -Mthreads -MDBI -MDBD::mysql -we 'DBI->setup_driver("DBD::mysql");' \
  -e 'DBD::mysql->driver; threads->create(sub { DBD::mysql->driver })->join'
Subroutine DBI::db::mysql_fd redefined at ${archlib}/DBI.pm line 1393.
Subroutine DBI::db::mysql_async_result redefined at ${archlib}/DBI.pm line 1393.
Subroutine DBI::db::mysql_async_ready redefined at ${archlib}/DBI.pm line 1393.
Subroutine DBI::st::mysql_async_result redefined at ${archlib}/DBI.pm line 1393.
Subroutine DBI::st::mysql_async_ready redefined at ${archlib}/DBI.pm line 1393.
CaptTofu added a commit that referenced this pull request Oct 16, 2013
Fix method redefinition warnings in threads on Perl >= 5.16
@CaptTofu CaptTofu merged commit c27c943 into perl5-dbi:master Oct 16, 2013
@ilmari ilmari deleted the thread-driver-warning branch October 16, 2013 14:31
@iHeadRu iHeadRu mentioned this pull request Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants