test(db): validate manual workaround for string to text conversion on…#61915
Draft
moodyjmz wants to merge 4 commits into
Draft
test(db): validate manual workaround for string to text conversion on…#61915moodyjmz wants to merge 4 commits into
moodyjmz wants to merge 4 commits into
Conversation
… Oracle Two Oracle-only tests (skipped elsewhere) executing against the CI Oracle 18 and 23 containers: - testStringToTextConversionWorkaroundOnOracle runs the manual add-copy-drop-rename SQL sequence verbatim, including the DBMS_LOB.COMPARE verification gate and the NOT NULL restore, asserts the data survives byte-for-byte (incl. multibyte), and asserts the resulting column introspects as text so the type guard of Version34000Date20260318095645 no-ops on a re-run of occ upgrade. - testChangeStringToTextEmptyTableFailsOnOracle documents that ORA-22858 fires independently of the column's contents, ruling out emptying the table as a workaround. Scratch branch for empirical validation only, not intended for merge in this form. Assisted-by: ClaudeCode:claude-fable-5 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: James Manuel <moodyjmz@users.noreply.github.com>
On Oracle, Doctrine's listTableColumns() keys columns by their quoted name, so the plain 'argument' lookup returned null. Go through OC\DB\SchemaWrapper instead, which is also the interface the real migration type guard uses. Assisted-by: ClaudeCode:claude-fable-5 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: James Manuel <moodyjmz@users.noreply.github.com>
Embeds the PL/SQL block of the customer-facing SQL*Plus script verbatim and validates it on the CI Oracle containers: - abort before any change when the backup is not confirmed - fresh conversion: gate-before-commit copy, column swap, NOT NULL restore, data intact byte-for-byte, type guard no-op via SchemaWrapper - idempotent re-run (already-converted state is a clean no-op) - resume of a run interrupted between DROP COLUMN and RENAME Assisted-by: ClaudeCode:claude-fable-5 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: James Manuel <moodyjmz@users.noreply.github.com>
Fixes from a cold review of the customer script:
- empty input at the backup prompt no longer bypasses the abort
(TRIM('') is NULL, NULL NOT IN (...) is UNKNOWN): ACCEPT gets a
DEFAULT 'no' and the check wraps the value in NVL
- a run interrupted between RENAME and the NOT NULL restore is now
repaired on re-run instead of reported as done (restore_not_null
runs in the already-converted branch)
- the redo branch only drops an argument2 column of type CLOB; any
other type aborts as an unexpected state
- the copy column is made NOT NULL before the original is dropped, so
a straggling writer fails loudly instead of losing a row's argument
- verification gate covers the argument-NULL/argument2-NOT-NULL
asymmetry; DEFAULT '' is restored on the rebuilt column
The script now lives in tests/data/ and the test reads the PL/SQL
block from it, so CI validates the literal shipped artifact instead
of a manually-synced copy. New coverage: empty-input abort, foreign
argument2 refusal, NOT NULL repair on re-run.
Assisted-by: ClaudeCode:claude-fable-5
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: James Manuel <moodyjmz@users.noreply.github.com>
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.
… Oracle
Two Oracle-only tests (skipped elsewhere) executing against the CI Oracle 18 and 23 containers:
testStringToTextConversionWorkaroundOnOracle runs the manual add-copy-drop-rename SQL sequence verbatim, including the DBMS_LOB.COMPARE verification gate and the NOT NULL restore, asserts the data survives byte-for-byte (incl. multibyte), and asserts the resulting column introspects as text so the type guard of Version34000Date20260318095645 no-ops on a re-run of occ upgrade.
testChangeStringToTextEmptyTableFailsOnOracle documents that ORA-22858 fires independently of the column's contents, ruling out emptying the table as a workaround.
Scratch branch for empirical validation only, not intended for merge in this form.
Assisted-by: ClaudeCode:claude-fable-5
Summary
TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)