Crash when using jdbc extension function `REPLICATE`

Abierto
#1,268 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
java, sqlite
Área
backend, database

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Java
Estrellas
3.3k
Forks
676
Merge medio
1 d 15 h
PR fusionados (30 d)
18

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de xerial/sqlite-jdbc

Todos los issues de xerial/sqlite-jdbc

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.