Skip to content

Fix rebuilds of legacy text and binary columns - #565

Draft
JanJakes wants to merge 1 commit into
trunkfrom
cast-rebuilt-blob-values
Draft

JanJakes wants to merge 1 commit into
trunkfrom
cast-rebuilt-blob-values

Conversation

@JanJakes

Copy link
Copy Markdown
Member

Summary

Legacy tables can contain text values in binary columns, or binary values in text columns. Copying those values into a rebuilt STRICT table fails, even when the affected column's type has not changed.

Cast copied values to the destination SQLite TEXT or BLOB type during table rebuilds. This fixes storage-type errors in ALTER TABLE, OPTIMIZE TABLE, REPAIR TABLE, and the temporal-default upgrade. It also handles changes between text and binary column types.

Regression tests cover value preservation, renamed columns, temporary tables, rollback after a failed rebuild, and legacy upgrades.

Fixes #546.

Cast copied values to TEXT or BLOB using the destination column types. Preserve bytes and NULL values when rebuilding legacy tables or changing between text and binary types.

Cover string types, renamed columns, temporary tables, rollback, and temporal-default upgrades with regression tests.

Fixes #546
@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ALTER TABLE fails when legacy BLOB columns contain TEXT values

1 participant