Repository navigation
Test the labels of a node a MATCH finds after a grouping WITH by their text on Oracle, which crashed the session building its cursor (#418) - #424
Merged
Conversation
…r text on Oracle, which crashed the session building its cursor (#418) Port of liberation-data/drivine4j#606. On Oracle 23.26 a labelled node a MATCH finds after a WITH that aggregates or is DISTINCT (or any WITH after one) could crash the session when tested against the multivalue label index (ORA-00600 [QJSNMV_GET_MVI_MD:2]). A new store hook, grouped_labels, writes such a test: has_labels on every store but Oracle, where it is holds_label's INSTR form. OPTIONAL MATCH and shortestPath laterals inherit the flag, and a WHERE n:Label on a node found after the grouping uses it too. Closes #418
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #418. Port of liberation-data/drivine4j#606 (drivine4j#601). In TS this is drivine#623 and drivine#627.
Cause
On Oracle 23.26, a labelled node that a
MATCHfinds after aWITHthat groups its rows is tested against the multivalue JSON index over labels. A groupingWITHis one that aggregates or isDISTINCT, or anyWITHafter one. Oracle can crash the session building that statement's cursor:[QJSNMV_GET_MVI_MD:2]in the alert log;[qjsnmvFindOpt()+16]after a rolled-back delete.The Cypher spec case "Maps and lists holding relationships compare by identity" hits it, on its
:Movienode.The fix
_Select.after_groupingis set in_with_havingfor a groupingWITH, and for anyWITHafter one. OPTIONAL MATCH and shortestPath laterals inherit it from the select around them, as in drivine4j's review.grouped_labelsis a new store hook. Its base writeshas_labels. Oracle's writes each label inholds_label's INSTR text form, which the index can't answer.WHERE n:Labelon a node newly found after it, which is tracked in_grouped.WITHpassed on, the nodes before theWITH, and every other read keep the index.The compiled SQL
1,684 steps of the Cypher spec (queries, writes, temporal and refusals), main against this branch:
:Movietest moves fromJSON_EXISTSto the INSTR form. With that form mapped back, both are byte-identical to main's SQL.tests/golden/statements.jsonis unchanged.Tests
tests/unit/test_cypher_grouped_labels.pyports drivine4j'sGroupedLabelsTest, which covers drivine#623's cases, and adds a SQLite case. It has 20 cases:WITH, and each label of a node with two labels;WHERE m:Movie) and shortestPath laterals;WHERE m:Movieon a node found after the grouping;WITH, andWITH … ORDER BY … LIMIT;WITHpassed on, and the nodes before it;docs/04-statements.mdgains the Oracle note that drivine4j adds to itsdocs/09-supported-engines.md.Gate
unasync --check: clean.ORACLE_TESTS=true … pytest -k oracle: 2,397 passed.