Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Quote SQLite table identifiers in DBI column_info PRAGMA

Fechada Para iniciantes
#1,605 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
84/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
java, perl, sqlite
Domínio
databases

Direção de pesquisa

Comece em src/main/java/org/perlonjava/runtime/perlmodule/DBI.java, em columnInfoViaPragma, e depois reproduza a falha com os testes do SQLite t/13-init.t, t/14-smart-accessors.t e t/15-sql-row.t. O trabalho está concluído quando column_info retornar metadados para uma tabela chamada order sem um erro de sintaxe do SQLite; o defeito separado relacionado a active-flag é acompanhado em #1604.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
Perl
Estrelas
64
Forks
8
Merge médio
5h 42min
PRs com merge (30d)
205

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de fglock/PerlOnJava

Todas as issues de fglock/PerlOnJava

Issues semelhantes

Mais issues de Perl

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.