Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

DBI parse_dsn accepts malformed DSNs without the dbi prefix

Aperta
#1,390 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
perl
Ambito
backend

Direzione di ricerca

Inizia eseguendo t/02_basic.t e confrontando il comportamento incluso di DBI->parse_dsn con quello di DBI standard, concentrandoti sul caso malformato "bi:mysql:database=mytbl". La modifica è completata quando il prefisso dbi: mancante viene rifiutato e DBIx::DSN::Resolver->resolv croaks su entrambi i backend di esecuzione.

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

Descrizione

area:cpan-port area:runtime bug

Summary

The bundled DBI->parse_dsn accepts malformed DSNs that do not begin with the required dbi: prefix. This causes DBIx::DSN::Resolver to silently return an invalid DSN instead of throwing an error.

Affected distribution

  • Distribution: DBIx-DSN-Resolver
  • Version: 0.09
  • CPAN run: 20260915-125610-17469
  • PerlOnJava commit: 30095483379e4aa76540da1330f8f407bc145151

Reproduction

use DBIx::DSN::Resolver;

my $resolver = DBIx::DSN::Resolver->new;
eval { $resolver->resolv('bi:mysql:database=mytbl') };
die "expected an error\n" unless $@;

The same behavior is covered by the upstream test t/02_basic.t, line 34:

eval {
    $r->resolv("bi:mysql:database=mytbl"),
};
ok($@);

Expected behavior

The malformed bi: DSN should be rejected by DBI->parse_dsn, causing DBIx::DSN::Resolver->resolv to croak.

Actual behavior

PerlOnJava accepts the malformed DSN and returns it unchanged:

value=bi:mysql:database=mytbl err=[]

The failure is reproducible on both execution backends:

  • JVM backend: t/02_basic.t fails at test 6 (line 34).
  • Interpreter backend: the focused reproduction also returns the invalid DSN without an error.

Comparison with system Perl

System Perl passes the complete upstream suite:

t/00_compile.t .. ok
t/02_basic.t .... ok
t/03_dsn.t ...... ok
Result: PASS

The archived PerlOnJava CPAN run reports 1 failed subtest out of 18, with the other test files passing. The failure is independent of DNS/network availability because it concerns the malformed DSN without a hostname.

Suggested investigation

Compare the bundled PerlOnJava implementation of DBI->parse_dsn with standard DBI behavior. It should reject DSNs that do not match the required dbi:<driver>:<driver_dsn> form, rather than treating bi: as a valid scheme and allowing DBIx::DSN::Resolver to return the original string.

Labels

bug, area:cpan-port, area:runtime

Lingua principale
Perl
Stelle
64
Fork
6
Merge medio
4h 29m
PR unite (30g)
185

Preparare l'ambiente

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.