DBI do() handling incorrectly prepares MySQL SET statements under PerlOnJava
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- backend, database, testing-qa
Research direction
Start with DBI.pm around line 113 and inspect how DBI::db::do dispatches when t/standard.t redefines it. Run t/standard.t and t/syntax.t under PerlOnJava, then compare the SQLite-backed path with system Perl. Done means the override is honored and focused regression coverage passes without sending MySQL SET syntax to SQLite.
Written by the indexing model from the issue text.
Description
Summary
DBIx::Connector::Retry::MySQL v1.0.1 fails under PerlOnJava because a DBI do() call for a MySQL SET SESSION statement is executed against the default in-memory SQLite connection and reaches SQLite prepare handling. SQLite rejects the MySQL SET syntax, causing the retry tests to fail.
Reproduction
Distribution: DBIx-Connector-Retry-MySQL v1.0.1
CPAN run: 20260913-205737-64746
Failing tests: t/standard.t and t/syntax.t
The distribution tests intentionally use an in-memory SQLite database when DBITEST_DSN is unset. In t/standard.t, the test suite redefines DBI::db::do so that SET statements return a successful 0E0 value; the database operation is not intended to require a live MySQL server.
PerlOnJava result:
t/standard.t ........... 10/14 subtests failed
t/syntax.t ............. 1/3 subtests failed
Failed 2/4 test programs. 11/19 subtests failed.
The repeated exception is:
DBI prepare failed: near "SET": syntax error at jar:PERL5LIB/DBI.pm line 113.
The exception propagates through DBIx::Connector::Retry::MySQL::_set_retry_session_timeouts while it executes SET SESSION timeout commands. The failures then cascade into incorrect retry durations, attempt counters, and exception matching.
Oracle
The same distribution and dependency versions pass completely under system Perl in the same run:
t/standard.t ........... ok
t/syntax.t ............. ok
All tests successful.
Files=4, Tests=19
The system-Perl test run also confirms that no MySQL service is required for the default test path. It uses SQLite and the test override for DBI::db::do.
Expected behavior
PerlOnJava should honor the DBI::db::do dispatch used by the test suite, allowing the SET SESSION statements to be handled by the test override, or otherwise provide compatible behavior for this DBI operation without sending MySQL SET syntax to SQLite prepare.
Investigation requested
Investigate DBI method dispatch and do()/prepare() behavior in the PerlOnJava DBI implementation, especially when a Perl test redefines DBI::db::do. Add focused regression coverage for a DBI::db::do override and for the SQLite-backed DBIx::Connector::Retry::MySQL test path.
- Dominant language
- Perl
- Stars
- 64
- Forks
- 6
- Avg merge
- 5h 25m
- Merged PRs (30d)
- 157
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fglock/PerlOnJava
-
area:cpan-port area:unicode bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
fglock/PerlOnJava#1341 ·
-
area:cpan-port bug
Difficulty 4/5 3-5 days Newbie friendliness 44/100
fglock/PerlOnJava#1459 ·
-
area:cpan-port bug
Difficulty 3/5 1-2 days Newbie friendliness 72/100
fglock/PerlOnJava#1457 ·
-
bug high-impact
Difficulty 3/5 1-2 days Newbie friendliness 67/100
fglock/PerlOnJava#1456 · 1 comment ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 72/100
fglock/PerlOnJava#1455 ·
All issues in fglock/PerlOnJava
Similar issues
-
1.severity: security
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
api7/lua-resty-saml#63 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100