Skip to content

test(db): validate manual workaround for string to text conversion on…#61915

Draft
moodyjmz wants to merge 4 commits into
masterfrom
test/oracle-ora22858-workaround-validation
Draft

test(db): validate manual workaround for string to text conversion on…#61915
moodyjmz wants to merge 4 commits into
masterfrom
test/oracle-ora22858-workaround-validation

Conversation

@moodyjmz

@moodyjmz moodyjmz commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

… 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

  • Resolves: #

Summary

TODO

  • ...

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

… 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>
@moodyjmz moodyjmz self-assigned this Jul 8, 2026
@moodyjmz moodyjmz requested a review from a team as a code owner July 8, 2026 13:26
@moodyjmz moodyjmz requested review from Altahrim, ArtificialOwl, leftybournes and salmart-dev and removed request for a team July 8, 2026 13:26
@moodyjmz moodyjmz marked this pull request as draft July 8, 2026 13:26
moodyjmz and others added 3 commits July 8, 2026 16:03
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants