contrib/ivorysql_ora: refuse non-UTF8 test encodings up front - #1958
contrib/ivorysql_ora: refuse non-UTF8 test encodings up front#1958muzimu217 wants to merge 1 commit into
Conversation
The five oracle-check failures reported under ENCODING=LATIN1 are not product bugs: every one of them is the correct behaviour for a single-byte database. The expected results encode UTF8-specific facts (character counts under CHAR length semantics, chr() codepoints that only exist in Unicode, UTF8-only normalization such as COMPOSE and DECOMPOSE, and utl_url escape output for whole character sets), so a non-UTF8 run cannot pass without rewriting the tests in ways that would remove exactly the multibyte coverage they exist for. The suite already pins ENCODING = UTF8 by default; make an explicit non-UTF8 override fail fast with a clear message instead of surfacing as five seemingly unrelated failures. Fixes IvorySQL#1883 Signed-off-by: muzimu217 <muzimu217@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe Oracle regression Makefile now pins the test database encoding to UTF8 and rejects non-UTF8 overrides for the ChangesOracle regression encoding
Priority: ➖ Normal Estimated code review effort: 1 (Trivial) | ~5 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Oracle regression runs now consistently use UTF8 and clearly reject unsupported encoding overrides, preventing encoding-dependent test failures without affecting other targets. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks for the PR! |
Fixes #1883.
Root cause
The five failures are not product bugs — every one of them is correct behaviour for a single-byte test database. The expected results encode UTF8-specific facts:
ora_charactertruncates multibyte literals against VARCHAR2 byte limits (lengthb(cast('中文' AS varchar2(5 byte))) = 3); on LATIN1 a byte is a character, so the truncation point legitimately differs.ora_character_datatype_functionscheckslength/lengthccharacter counts,chr()codepoints that only exist in Unicode (chr(769),chr(2392),chr(119070)→ "requested character too large"), UTF8-only normalization (compose/decompose→ "Unicode normalization can only be performed if server encoding is UTF8"),unistr()andto_multi_byte(), plus psql column alignment that depends on character counts.ora_misc_functionsexercises compose/decompose the same way.datatype_and_func_bugsinserts '测试' intochar(3 char); under LATIN1 the literal is six characters, so "value too long" is the correct answer.utl_urlescapes multibyte input and converts between character sets, so its multibyte expectations are UTF8-bound by nature (and a LATIN1 → GB18030 conversion does not exist in PostgreSQL).A single-byte Oracle database could not store these literals either, so there is no LATIN1 behaviour to pin down: the tests are about multibyte semantics, and those only exist under UTF8.
Fix
Since the suite is inherently UTF8-bound, make that requirement explicit at the suite level instead of letting a non-UTF8 run surface as five seemingly unrelated failures.
contrib/ivorysql_ora/Makefilealready pinsENCODING = UTF8by default; this adds a guard so an explicit non-UTF8 override fails up front with a clear message rather than running (and failing) the suite:Targets that do not run the regression suite (
all,install, ...) are unaffected.Verification
oracle-checkon a clean tree (Linux aarch64):make -C contrib/ivorysql_ora oracle-check ENCODING=LATIN1LC_ALL=en_US.UTF-8 make -C contrib/ivorysql_ora oracle-checkLC_ALL=C make -C contrib/ivorysql_ora oracle-checkSummary by CodeRabbit