DBI parse_dsn accepts malformed DSNs without the dbi prefix
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
首先运行 t/02_basic.t,并将捆绑的 DBI->parse_dsn 行为与标准 DBI 进行比较,重点关注格式错误的 "bi:mysql:database=mytbl" 情况。当缺少 dbi: 前缀时被拒绝,并且 DBIx::DSN::Resolver->resolv 在两个执行后端上都 croaks 时,修改就完成了。
由索引模型根据 Issue 内容生成。
描述
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.tfails 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
- 主要语言
- Perl
- 星标
- 64
- 派生
- 7
- 平均合并
- 4 小时 29 分钟
- 30 天内合并 PR
- 176
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
fglock/PerlOnJava 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
fglock/PerlOnJava#1579 ·
维护者通常 1 天内回复
-
area:cpan-port area:unicode bug
难度 2/5 1-3 小时 新手友好度 88/100
fglock/PerlOnJava#1341 ·
维护者通常 1 天内回复
-
area:platform area:runtime bug
难度 4/5 3-5 天 新手友好度 45/100
fglock/PerlOnJava#1635 ·
维护者通常 1 天内回复
-
area:cpan-port area:runtime bug
难度 5/5 一周以上 新手友好度 25/100
fglock/PerlOnJava#1634 ·
维护者通常 1 天内回复
-
area:cpan-port bug
难度 3/5 1-2 天 新手友好度 72/100
fglock/PerlOnJava#1633 ·
维护者通常 1 天内回复
查看 fglock/PerlOnJava 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
linux-test-project/lcov#552 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
szTheory/exifcleaner#383 ·
维护者通常 1 天内回复
-
1.severity: security
难度 2/5 1-3 小时 新手友好度 62/100
NixOS/nixpkgs#569828 · 1 个 reaction ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 3 天内回复
-
bug OS Images
难度 2/5 1-3 小时 新手友好度 72/100
stfc/cloud-image-builders#233 · 1 条评论 ·
维护者通常 1 天内回复