DBI do() handling incorrectly prepares MySQL SET statements under PerlOnJava

Aperta
#1,371 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java, mysql, perl, sqlite

Direzione di ricerca

Inizia da DBI.pm intorno alla riga 113 e verifica come DBI::db::do esegue il dispatch quando t/standard.t lo ridefinisce. Esegui t/standard.t e t/syntax.t sotto PerlOnJava, quindi confronta il percorso basato su SQLite con il Perl di sistema. Il lavoro è completato quando l'override viene rispettato e la copertura di regressione mirata passa senza inviare sintassi SET di MySQL a SQLite.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:backend area:cpan-port area:runtime bug

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.

Lingua principale
Perl
Stelle
64
Fork
6
Merge medio
5h 25m
PR unite (30g)
157

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fglock/PerlOnJava

Tutte le issue di fglock/PerlOnJava

Issue simili

Altre issue su Perl

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.