Postgres: =~ with a negated bracket expression does not match a line break
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 55/100
Rechercherichtung
Start by reading the =~ compilation path and the existing (?m) anchor fix mentioned in the issue. Check how the generated pattern behaves in Postgres for dots, negated bracket expressions, and Java-style escapes, then add the stated regression case to liberation-data/drivine-cypher-spec. Done when the Postgres result matches Neo4j, Oracle, and SQLite for the example.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
On Postgres, compiled Cypher's =~ runs the pattern in Postgres's partial newline-sensitive mode ((?p)), so that a dot matches no line break, as Java's does. That mode also stops a negated bracket expression from matching a line break, which Java's does:
RETURN 'a\nb' =~ 'a[^x]b'
Neo4j (Java's matches()) gives true; Postgres gives false. Oracle and SQLite give true.
No Postgres mode both keeps a dot off a line break and lets a negated bracket match one, so a fix would mean rewriting the pattern: each unescaped . outside a bracket as [^\n] (and \N-style escapes as Java reads them), with the pattern run in Postgres's default mode, and (?s) leaving the dots alone.
Found by a review of the (?m) anchor fix. A spec case ('a\nb' =~ 'a[^x]b' is true) should go into liberation-data/drivine-cypher-spec with the fix.
- 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
-
bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 86/100
awslabs/visual-asset-management-system#937 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
follow-up
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 83/100
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 2 Tagen