Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

=~ with (?x) and a pattern that ends in a # comment fails on Postgres and SQLite, and is false on Oracle

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

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

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

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
57/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
postgresql, python, sqlite
領域
databases

調査の方向性

Read the Cypher compilation path that wraps =~ patterns and handles flags, then check the database-specific behavior described for Postgres, SQLite, and Oracle. Reproduce the supplied (?x) example and add the stated spec case to liberation-data/drivine-cypher-spec. Done means the case returns true across the affected stores, including Oracle's handling of # comments.

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

説明

In compiled Cypher, =~ wraps the pattern in a group of its own and appends the closing parenthesis and the end anchor on the same line: \A( … )\Z on Postgres, \A( … )\z on Oracle, ^(?: … )\z on SQLite. Under (?x), a # starts a comment that runs to the end of the line, so a pattern that ends in a comment comments out what was appended:

RETURN 'ab' =~ '(?x)ab # c'
Store Gives
Neo4j (Java's matches()) true
Postgres error: invalid regular expression: parentheses () not balanced
SQLite error: Unclosed group (Java's PatternSyntaxException)
Oracle false: its x ignores whitespace but takes # literally

'(?x)a b' (no comment) already gives true on Postgres and Oracle.

A fix would put a line break before what is appended when the flags hold x, which ends the comment and, under x, is otherwise ignored. Oracle would also need its # comments taken out, as its x doesn't read them. A spec case ('ab' =~ '(?x)ab # c' is true) should go into liberation-data/drivine-cypher-spec with the fix.

Checked directly on Postgres 17, Oracle Free 23 and Java 25.

主要言語
Python
スター
1
フォーク
0
平均マージ
1時間 21分
マージ済み PR(30日)
128

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

liberation-data/drivine-python のほかの issue

liberation-data/drivine-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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