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

Quote SQLite table identifiers in DBI column_info PRAGMA

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

从 src/main/java/org/perlonjava/runtime/perlmodule/DBI.java 中的 columnInfoViaPragma 开始,然后使用 SQLite 测试 t/13-init.t、t/14-smart-accessors.t 和 t/15-sql-row.t 重现该失败。完成标准是:column_info 为名为 order 的表返回元数据,且不出现 SQLite 语法错误;单独的 active-flag 缺陷在 #1604 中跟踪。

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

描述

area:cpan-port area:database bug

Summary

PerlOnJava's SQLite-specific DBI.column_info constructs PRAGMA table_info($table) without quoting the table identifier. A table named order therefore produces PRAGMA table_info(order), which SQLite rejects because order is a reserved word.

ActiveRecord::Simple 1.11 creates and introspects an order table in its SQLite tests. The metadata call fails, and its caller then attempts fetchall_arrayref on the undefined result, aborting t/13-init.t, t/14-smart-accessors.t, and t/15-sql-row.t before those tests emit TAP.

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: the SQLite metadata error reproduces on both JVM and interpreter backends.
  • Diagnostic: DBI column_info failed: near "order": syntax error, followed by an attempt to call fetchall_arrayref on an undefined value.

Suspected cause

columnInfoViaPragma in src/main/java/org/perlonjava/runtime/perlmodule/DBI.java concatenates the table name directly into PRAGMA table_info(...). It should use SQLite-safe identifier quoting (or another metadata approach that safely handles reserved names).

Expected result

column_info should return metadata for valid SQLite table names, including reserved words such as order, without SQL syntax errors.

A separate missing-active-flag defect in the synthetic column_info statement handle breaks accessor discovery and is tracked in #1604.

主要语言
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 摘要。