Fix init script decoding with configurable charsets - #12082
dlwhdgus0810 wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (9)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change adds configurable charset handling for JDBC initialization scripts. UTF-8 remains the default. ChangesInitialization script charset support
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant JdbcDatabaseContainer
participant ScriptUtils
participant DatabaseDelegate
JdbcDatabaseContainer->>ScriptUtils: Pass configured charset and script path
ScriptUtils->>ScriptUtils: Read and decode the script
ScriptUtils->>DatabaseDelegate: Execute decoded SQL statements
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The charset configuration preserves UTF-8 defaults and propagates the configured charset to container initialization scripts. No actionable merge risk is identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 27.27% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 22 functions across 4 files. (5 skipped: 5 unsupported.)
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 |
Windows-1252 initialization scripts are decoded as UTF-8, corrupting accented characters before SQL reaches the database. Add an explicit
Charsetoverload toScriptUtils.runInitScriptandJdbcDatabaseContainer.withInitScriptCharsetso callers can select the script encoding. Existing calls continue to use UTF-8.The container setting applies to all scripts configured through
withInitScriptorwithInitScripts. JDBC URLTC_INITSCRIPTremains UTF-8, as documented. This changes file decoding, not the database character set.Regression coverage uses a Windows-1252 fixture containing
éand UTF-8 controls. The Windows-1252 case failed on the original implementation. All 62 database-commons and JDBC tests pass, along with both modulechecktasks (Checkstyle, Spotless, Javadoc, and API compatibility). Docker-backed Oracle integration was not run.Fixes #8776.
Summary by CodeRabbit
New Features
Documentation