Crash when using jdbc extension function `REPLICATE`

オープン
#1,268 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java, sqlite
領域
backend, database

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Java
スター
3.3k
フォーク
676
平均マージ
1日 15時間
マージ済み PR(30日)
18

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

xerial/sqlite-jdbc のほかの issue

xerial/sqlite-jdbc の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。