Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Quote SQLite table identifiers in DBI column_info PRAGMA

Đã đóng Phù hợp với người mới
#1,605 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
84/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java, perl, sqlite
Lĩnh vực
databases

Hướng nghiên cứu

Bắt đầu tại src/main/java/org/perlonjava/runtime/perlmodule/DBI.java, ở columnInfoViaPragma, sau đó tái hiện lỗi bằng các bài kiểm thử SQLite t/13-init.t, t/14-smart-accessors.t và t/15-sql-row.t. Được xem là hoàn tất khi column_info trả về siêu dữ liệu cho một bảng có tên order mà không phát sinh lỗi cú pháp SQLite; lỗi riêng liên quan đến active-flag được theo dõi trong #1604.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Perl
Star
64
Fork
7
Merge trung bình
5 giờ 11 phút
Pull request đã merge (30 ngày)
186

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của fglock/PerlOnJava

Tất cả issue của fglock/PerlOnJava

Issue tương tự

Thêm issue về Perl

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.