Find a search text past 32 KB with CONTAINS on Oracle, where it raises ORA-22828
メンテナーはふだん 1 日以内に返信
関連するプルリクエストがすでにマージされています。
- #284 @jasperblues による — マージ済み
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
調査の方向性
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時間 29分
- マージ済み PR(30日)
- 136
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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日 初心者へのやさしさ 55/100
liberation-data/drivine-python#297 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
liberation-data/drivine-python#295 ·
メンテナーはふだん 1 日以内に返信
liberation-data/drivine-python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
pydantic/pydantic-ai#12091 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
CSS enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
pychess/pychess-variants#2448 ·
メンテナーはふだん 1 日以内に返信
-
Bump locked PyTensor so Apple clang 21 does not pass -ld64対応中かも @drbenvincent が今日担当しました。 オープンbug dev ops
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 2 日以内に返信
-
ai_p2 bug comp-datalake
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
ClickHouse/ClickHouse#128306 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信