Find a search text past 32 KB with CONTAINS on Oracle, where it raises ORA-22828
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start at drivine/cypher/sql/oracle_cypher_compiler.py:890 in contains_text, then inspect the ported drivine4j fix and the Oracle-specific tests. Implement the CLOB handling described in the issue, including its long-search path and Oracle 23 workaround. Port the listed cross-engine cases and SQL pins; done means long search texts return the expected results across parameters, stored properties, writes, grouping and WHERE/reduce use.
由索引模型根据 Issue 内容生成。
描述
Port of liberation-data/drivine4j#312 (fix: liberation-data/drivine4j#441).
What happens now. On Oracle, once either side of CONTAINS is longer than 4,000 bytes, both sides are read as CLOBs and checked with INSTR(t, x) > 0. INSTR refuses a search text longer than 32,767 UTF-16 units and raises ORA-22828. The limit counts units, not bytes. So t CONTAINS x with x past 32 KB fails instead of answering.
The code is at drivine/cypher/sql/oracle_cypher_compiler.py:890 (contains_text) on origin/main.
What the drivine4j fix does. The VARCHAR2 arm is unchanged. The CLOB arm binds both CLOBs with bound(), inside a NO_MERGE view (the rule from #370), and then:
- if either side is null, the answer is null;
- if the search text is at most 32,767 units, it uses
SIGN(INSTR(t, x)); - if the search text is at least as long as the text, it uses
DBMS_LOB.COMPAREfor equality; - otherwise it runs a
MODEL … RULES ITERATEloop. The loop finds each place where the search's first 1,000 units occur, and confirms the whole search there withDBMS_LOB.COMPARE(t, x, LENGTH(x), at, 1).
The CASE gives a number, and that number is compared with 1 outside the subquery. This works around an Oracle 23 defect: compared inside, the MODEL subquery gives FALSE where alone it gives 1. The drivine4j constants are SEARCHED_TEXT (32,767), SEARCHED_PREFIX (1,000) and SEARCHED_PLACES.
Tests to port (CypherQueryCrossEngineTest in drivine4j):
-
"CONTAINS finds a text past 32 KB in a text of any length…". Its cases:
- 32,767 and 32,768 units, found and not found;
- long in longer;
- equal texts;
- a search longer than the text;
- a search whose first 1,000 units occur nowhere;
''and null on either side;- three-byte characters;
- surrogate pairs across the 1,000th and 32,767th unit.
Each case runs as parameters, as stored properties and in a write, three times on one session.
-
The aggregate/grouping-key test and the WHERE/reduce() test.
-
The SQL pins in
OracleContainsTextTest.
- 主要语言
- Python
- 星标
- 1
- 派生
- 0
- 平均合并
- 1 小时 21 分钟
- 30 天内合并 PR
- 128
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
liberation-data/drivine-python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
liberation-data/drivine-python#250 ·
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 88/100
liberation-data/drivine-python#209 ·
维护者通常 1 天内回复
-
CI: three Oracle-only tests in test_cypher_compiled.py never run, as -k oracle doesn't select them未关闭
难度 1/5 1 小时以内 新手友好度 88/100
liberation-data/drivine-python#178 ·
维护者通常 1 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 68/100
liberation-data/drivine-python#279 ·
维护者通常 1 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 48/100
liberation-data/drivine-python#277 ·
维护者通常 1 天内回复
查看 liberation-data/drivine-python 的全部 Issue
相似的 Issue
-
infrastructure
难度 2/5 1-3 小时 新手友好度 76/100
NatLabRockies/H2Integrate#977 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
topoteretes/cognee#6470 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
-
area:docs priority:p2 type:docs wave:9
难度 1/5 1 小时以内 新手友好度 84/100
jejjohnson/radtrax#293 ·
维护者通常 1 天内回复
-
bug core plugins
难度 2/5 1-3 小时 新手友好度 68/100
bunkerity/bunkerweb#4121 · 1 条评论 ·
维护者通常 1 天内回复