Oracle: a compiled read of a property past 32 KB over two or more rows crashes the session
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with drivine/cypher/sql/oracle_cypher_compiler.py at property_of, then inspect _property in drivine/cypher/sql/sql_cypher_compiler.py and the existing Oracle compiler tests. Reproduce the two-row, 40 KB property read on Oracle and compare the compiled SQL with the safe extended-JSON form described in the issue. Done means porting the named drivine4j test cases and confirming the session stays open across all three statements.
由索引模型根据 Issue 内容生成。
描述
Port of liberation-data/drivine4j#255.
On Oracle, a compiled Cypher read of a node property longer than about 32 KB, over two or more rows, crashes the server session. The client sees DPY-4011 (the database closed the connection), on the read or on the next statement on that connection.
await pm.query(spec("CREATE (:CyWrite {id: 1}), (:CyWrite {id: 2})"))
await pm.query(spec("MATCH (n:CyWrite) SET n.a = $a", {"a": "x" * 40_000}))
await pm.query(spec("MATCH (n:CyWrite) RETURN n.a ORDER BY n.id")) # DPY-4011, here or on the next statement
Probed on origin/main (Oracle Free 23.26, gvenzl/oracle-free:23-faststart), each statement new text on one connection: it crashed in 2 of 2 runs.
Where. RETURN n.a compiles to JSON_QUERY(n1.props, '$.a' RETURNING JSON): property_of at drivine/cypher/sql/oracle_cypher_compiler.py:184, called for a node's and a relationship's property in _property at drivine/cypher/sql/sql_cypher_compiler.py:2780 and :2782.
The server bug. JSON_QUERY(<JSON column>, path RETURNING JSON) of a scalar text past 32 KB, for each of two rows, crashes the session (ORA-07445 ksmem_malloc, ORA-00600 [17114]/[17147]). In SQL*Plus with no client library: plain SELECT JSON_QUERY(props, '$.a' RETURNING JSON) FROM t over two rows crashed 4/4, and so did dot notation t.props.a, JSON_SERIALIZE(JSON_QUERY(...)), JSON_ARRAY(..., JSON_QUERY(...)) and JSON_VALUE over it. Safe (0/4 each): JSON(JSON_QUERY(props, '$.a' RETURNING CLOB)) and the extended-JSON read below, also inside JSON_ARRAY and through a subquery. A 40 KB array of short texts read RETURNING JSON did not crash. RETURNING CLOB writes a whole double 2.0 as 2, so it can't be used for every value.
The fix in drivine4j. A property that is itself an item of a RETURN or a WITH (returned or passed on) is read through its text, as extended JSON, so a whole double stays a double:
JSON(JSON_QUERY(JSON_SERIALIZE(JSON_TRANSFORM(props, KEEP '$.a') RETURNING CLOB EXTENDED), '$.a' RETURNING CLOB) EXTENDED).
It reads props once. A guard that kept short values on the plain read (CASE WHEN JSON_VALUE(props, '$.a.length()') > 8000 THEN … ELSE JSON_QUERY(…) END, or a COALESCE) was crash-safe but returned wrong rows: Oracle dropped another table's label test where a select-list expression read props twice (reproduced in SQL*Plus, MATCH (p:Person {name: 'Laurence'})-[r]->(k:Person) WITH p, r, k.name AS first ... returned a Movie). Reads elsewhere (WHERE, sort keys that aren't items, a property nested in a larger item such as [n.a] or n {.a}) are unchanged, and so is a read beside a variable-length walk, where Oracle has closed the session over more involved reads of the row.
Tests to port. drivine4j's CypherWriteOracleTest "a property past 32 KB read on two nodes leaves the session open" (one connection, three rounds of new statement text: RETURN n.a ORDER BY n.id, WITH n.id AS id, n.a AS a ... RETURN [id, a], then a count to check the session), OracleItemPropertyTest (compiled SQL), and the spec case "A property past 32 KB read on two nodes" (writes.yaml).
- 主要语言
- Python
- 星标
- 1
- 派生
- 0
- 平均合并
- 1 小时 16 分钟
- 30 天内合并 PR
- 74
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
liberation-data/drivine-python 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
liberation-data/drivine-python#154 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
liberation-data/drivine-python#152 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
liberation-data/drivine-python#150 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
liberation-data/drivine-python#138 ·
维护者通常 1 天内回复
-
Cypher on SQL stores: all(), any(), none() and single() are two-valued where the predicate is null未关闭
难度 4/5 3-5 天 新手友好度 55/100
liberation-data/drivine-python#159 ·
维护者通常 1 天内回复
查看 liberation-data/drivine-python 的全部 Issue
相似的 Issue
-
README.zh-CN/ja/es still hard-code 501 test counts after README.md went count-free可能已有人在做 @Aaqibhafeezkhan 今天认领。 未关闭beginner documentation good first issue
难度 2/5 1-3 小时 新手友好度 75/100
BistaDinesh03/critique#164 · 1 条评论 ·
维护者通常 1 天内回复
-
bug IO
难度 2/5 1-3 小时 新手友好度 65/100
MrNeRF/LichtFeld-Studio#3824 ·
维护者通常 1 天内回复
-
bug confirmed issue
难度 2/5 1-3 小时 新手友好度 72/100
open-webui/open-webui#33200 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
-
The changelog workflow excludes otelbot but not dependabot, so every Dependabot pull request fails the changelog check可能已有人在做 @ocelotl 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 82/100
open-telemetry/opentelemetry-python#5825 ·
维护者通常 2 天内回复