Crash when using jdbc extension function `REPLICATE`

Aperta
#1,268 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
java, sqlite
Ambito
backend, database

Direzione di ricerca

Start with the reproducer in the issue and run it against sqlite-jdbc 3.49.1.0 on the reported Ubuntu x86_64 environment; the crash occurs in a query using REPLICATE with a RIGHT JOIN. Trace the JDBC extension function and native SQLite call paths to find where SIGSEGV occurs. Done means the reproducer returns a result or raises an exception instead of crashing.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

troubleshooting

Describe the bug
A fatal error has been detected by the Java Runtime Environment. SQLite exits with SIGSEGV. SQLite originally does not support REPLICATE, so I suppose there might be some issue in sqlite-jdbc.

To Reproduce

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Reproduce {
    public static void main(String[] args) {
        try (Connection connection = DriverManager.getConnection("jdbc:sqlite::memory:");) {
            Statement statement = connection.createStatement();
            statement.executeUpdate("CREATE TABLE  t0(c0 FLOAT, c1 INT DEFAULT (ABS(-1)), PRIMARY KEY(c0))");
            statement.executeUpdate("INSERT INTO t0(c1, c0) VALUES (582293937, '^?V%'), ('73056190', '^')");
            
            ResultSet rs = statement.executeQuery(
                    "SELECT * FROM t0 RIGHT  JOIN  (SELECT 2025567911 AS col0 FROM t0 WHERE ((0.57721)<(t0.c0))) AS sub0  ON REPLICATE(sub0.col0, t0.c1)");
            while (rs.next()) {
                // read the result set
            }
        } catch (SQLException e) {
            e.printStackTrace(System.err);
        }
    }
}

then

javac Reproduce.java
java -classpath ".:sqlite-jdbc-3.49.1.0.jar" Reproduce

Expected behavior
Raise an exception or return a result.

Logs
If applicable, provide logs.

Environment (please complete the following information):

  • OS: Ubuntu 22.04
  • CPU architecture: x86_64
  • sqlite-jdbc version 3.49.1.0

Additional context
Add any other context about the problem here.

Lingua principale
Java
Stelle
3.3k
Fork
676
Merge medio
1g 15h
PR unite (30g)
18

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di xerial/sqlite-jdbc

Tutte le issue di xerial/sqlite-jdbc

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.