Add CI workflow forcing prepared_statements: false#2635
Merged
Conversation
Adds an env-driven hook in spec/spec_helper.rb and a workflow_dispatch-triggered job (CRuby 4.0 + JRuby 10.1.0.0) that runs the existing spec suite under ORACLE_ENHANCED_PREPARED_STATEMENTS_FALSE=1, mirroring rails/rails' MYSQL_PREPARED_STATEMENTS env-var convention but inverted (force false instead of force true) since the AbstractAdapter default applicable to this adapter is already true. The matching ORACLE_ENHANCED_PREPARED_STATEMENTS=1 (force true) hook that rsim#2623 added and rsim#2627 reverted is intentionally not re-introduced here: that arm collapsed once the cursor_sharing default stopped depending on prepared_statements (rsim#2626), and a CI grid duplicating the AbstractAdapter default no longer earns its keep. The false arm, on the other hand, is a distinct code path that has accumulated bugs (rsim#272, rsim#2477/rsim#2485 for CLOB/BLOB, and rsim#2634 for NCLOB) precisely because nothing in CI was running it. Once green this should be promoted to schedule: cron for daily runs (separate follow-up). Refs rsim#2622, rsim#2634. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced Apr 28, 2026
yahonda
added a commit
to yahonda/oracle-enhanced
that referenced
this pull request
Apr 28, 2026
…s is false record_lobs_for_create (added in rsim#2485) excluded readonly_attributes from the create-time @changed_lob_columns set. attr_readonly is meant to forbid post-creation updates, not the initial create itself, so filtering on create skipped the after_create write_lobs step and left the row with the EMPTY_CLOB() / EMPTY_BLOB() placeholder instead of the supplied value. The bug only surfaces on prepared_statements: false connections; the prepared_statements: true path binds LOB data directly via OCI temp LOB during INSERT and never relies on the after_create callback. The pre-existing readonly LOB specs already encode the correct expectation: OracleEnhancedAdapter handling of CLOB columns should respect attr_readonly setting for CLOB column OracleEnhancedAdapter handling of NCLOB columns should respect attr_readonly setting for NCLOB column They pass on prepared_statements: true (today's default) and now also pass on prepared_statements: false (covered in CI by rsim#2635). Adds matching regression specs inside the existing "with prepared_statements disabled" describe blocks of text_spec.rb and national_character_text_spec.rb. Verified on master without this fix: only those two new specs fail (2 failures, 0 others). Closes rsim#2636. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds:
ORACLE_ENHANCED_PREPARED_STATEMENTS_FALSEenv-var hook inspec/spec_helper.rbthat, when set, forcesprepared_statements: falseintoCONNECTION_PARAMSand prints a startup banner..github/workflows/test_prepared_statements_false.yml(CRuby 4.0 + JRuby 10.1.0.0,gvenzl/oracle-free:latest) that sets the env var and runs the full RSpec suite.Why
The `prepared_statements: false` arm has accumulated multiple bugs over the years precisely because nothing in CI exercised it:
ORA-00904: "EMPTY_NCLOB"on UPDATEprepared_statements: false(which happens when config.active_record.query_log_tags_enabled = true) #2477 / Fix CLOB/BLOB insertion when prepared_statements is false #2485 (2026-02) — CLOB/BLOB inserts fail onprepared_statements: false; partially fixed but did not extend to NCLOBORA-00904: "EMPTY_NCLOB"becauseOracleEnhanced::Quoting#quotereturned the literal"empty_nclob()"(Oracle has noEMPTY_NCLOB()function). Surfaced only because we hard-codedprepared_statements: falsefor an unrelated measurement.prepared_statements: falseis reachable from the default Rails 8+ development environment (any app withconfig.active_record.query_log_tags_enabled = trueflipsActiveRecord.disable_prepared_statements), so the arm is real for real users — it just has no CI floor.The matching
ORACLE_ENHANCED_PREPARED_STATEMENTS=1(force true) hook that #2623 added and #2627 reverted is intentionally not reintroduced here: that arm collapsed once the cursor_sharing default stopped depending onprepared_statements(#2626), and CI duplicating the AbstractAdapter default did not earn its keep. Thefalsearm is a distinct code path that does.Expected initial CI result on this branch
Failing, with the failures concentrated in the NCLOB describe block in
spec/active_record/oracle_enhanced/type/national_character_text_spec.rb:That is exactly the bug #2634 fixes. The expectation is:
quoting.rbfix fromempty_nclob()toempty_clob()plus a regression spec).workflow_dispatchtoschedule: cron "0 0 * * *"in a follow-up.So this PR is intentionally held until #2634 lands.
Test plan
schedule.Refs #2622, #2634.