=~ with (?x) and a pattern that ends in a # comment fails on Postgres and SQLite, and is false on Oracle
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 57/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 1
- Forks
- 0
- Ø Merge
- 1 Std. 21 Min.
- Gemergte PRs (30 T.)
- 128
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus liberation-data/drivine-python
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
liberation-data/drivine-python#250 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
liberation-data/drivine-python#209 ·
Maintainer antworten meist innerhalb von 1 Tag
-
CI: three Oracle-only tests in test_cypher_compiled.py never run, as -k oracle doesn't select themOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
liberation-data/drivine-python#178 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
liberation-data/drivine-python#280 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 68/100
liberation-data/drivine-python#279 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in liberation-data/drivine-python
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
pytest-dev/pytest-html#1085 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
pollen-robotics/reachy_mini#1527 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 66/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
A seed and its negative give the same run, so realizations of a negative seed repeat each otherOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
Maintainer antworten meist innerhalb von 1 Tag