Find a search text past 32 KB with CONTAINS on Oracle, where it raises ORA-22828
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 45/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Python
- Étoiles
- 1
- Forks
- 0
- Merge moyen
- 1 h 21 min
- PR mergées (30 j)
- 128
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de liberation-data/drivine-python
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
liberation-data/drivine-python#250 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
liberation-data/drivine-python#209 ·
Les mainteneurs répondent en général sous 1 jour
-
CI: three Oracle-only tests in test_cypher_compiled.py never run, as -k oracle doesn't select themOuverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
liberation-data/drivine-python#178 ·
Les mainteneurs répondent en général sous 1 jour
-
Read a list item past 32 KB by its place on Oracle without crashing the session over two rowsOuvertebug
Difficulté 4/5 3-5 jours Accessibilité débutants 68/100
liberation-data/drivine-python#279 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
liberation-data/drivine-python#277 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de liberation-data/drivine-python
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
pytest-dev/pytest-html#1085 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 90/100
pollen-robotics/reachy_mini#1527 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 66/100
Les mainteneurs répondent en général sous 2 jours
-
Variadic arguments that aren't objects are passed as objects (stringWithFormat_ with %d / %f)Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
A seed and its negative give the same run, so realizations of a negative seed repeat each otherOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
Les mainteneurs répondent en général sous 1 jour