Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

SQLite column_info statement is inactive, breaking ActiveRecord auto_load

已关闭 适合新手
#1,604 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
85/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
java, perl, sqlite
领域
backend, databases

调研方向

从 src/main/java/org/perlonjava/runtime/perlmodule/DBI.java 和 columnInfoViaPragma 入口点开始,然后检查 src/main/perl/lib/DBI.pm fetchall_arrayref 及其 Active 检查。运行 t/07-auto_load.t;完成意味着会返回 SQLite column_info 行,并且 first_name 和 id 访问器通过。

由索引模型根据 Issue 内容生成。

描述

area:cpan-port area:database bug

Summary

ActiveRecord::Simple 1.11 fails to discover SQLite columns on PerlOnJava because the synthetic statement handle returned by SQLite DBI.column_info is not marked active. The bundled DBI.pm implementation of fetchall_arrayref returns undef immediately for an inactive statement handle, so auto_load receives no columns and does not generate column accessors.

This causes t/07-auto_load.t to fail its first_name and id accessor assertions.

Evidence

  • CPAN random tester run: 20261002-084902-54310
  • Distribution/version: ActiveRecord-Simple 1.11
  • System Perl 5.42.2 on macOS 26.6.2 arm64: all 16 test files passed (206 tests).
  • PerlOnJava 5.44.1, build f25d551c1, Java 24.0.2 on macOS 26.6.2 arm64: t/07-auto_load.t reproducibly fails tests 2 and 3 on both JVM and interpreter backends.
  • A focused metadata check returned COLUMN_NAME rows through column_info, but fetchall_arrayref({}) yielded no rows; after auto_load, Customer->can('first_name') and Customer->can('id') were false.

Suspected cause

columnInfoViaPragma in src/main/java/org/perlonjava/runtime/perlmodule/DBI.java stores the rows in _pragma_rows, but unlike the ordinary metadata result handle it does not set the statement handle's Active flag. src/main/perl/lib/DBI.pm checks $sth->{Active} at the start of fetchall_arrayref and returns undef when false.

Expected result

The synthetic SQLite metadata statement should behave as an active DBI statement handle, and fetchall_arrayref({}) should return the column rows so auto_load can generate accessors.

The same CPAN run also found a separate SQLite identifier quoting failure for a table named order; that behavior is tracked separately.

主要语言
Perl
星标
64
派生
7
平均合并
5 小时 8 分钟
30 天内合并 PR
193

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

fglock/PerlOnJava 的其他 Issue

查看 fglock/PerlOnJava 的全部 Issue

相似的 Issue

更多 Perl Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。