Skip to content

Conversation

@JanJakes
Copy link
Member

@JanJakes JanJakes commented Jan 28, 2026

When migrating from the legacy SQLite driver to the new AST-based driver, the information schema reconstructor reads MySQL column type metadata from the _mysql_data_types_cache table. Some older versions of the legacy driver stored invalid type definitions in this table, causing migration failures.

This PR detects and handles two types of invalid data:

1. Truncated decimal definitions — Before PR #126, columns with multiple type arguments like decimal(26, 8) were incorrectly stored as decimal(26, (missing the second argument and closing parenthesis). For WooCommerce tables, the fix restores the correct decimal precision based on known WooCommerce column patterns. For other tables, these invalid definitions are discarded and the column type is inferred from SQLite.

2. Index definitions mistaken for columns — Before commit b5a9fba, index definitions like KEY timestamp (timestamp) were incorrectly parsed and stored as column KEY with type timestamp(timestamp). The fix validates that type arguments are numeric, rejecting these malformed entries and falling back to the SQLite type inference.

Fixes WordPress/wordpress-playground#3050.

@JanJakes JanJakes changed the base branch from trunk to fix-ci January 28, 2026 19:45
@JanJakes JanJakes marked this pull request as ready for review January 28, 2026 20:09
@JanJakes JanJakes requested a review from a team January 28, 2026 20:09
@JanJakes JanJakes changed the title Handle incorrectly stored MySQL metadata in the legacy to AST driver migrator Handle incorrectly stored MySQL metadata in the legacy-to-AST driver migrator Jan 28, 2026
@adamziel
Copy link
Collaborator

adamziel commented Jan 28, 2026

LGTM, thank you for fixing this!

@JanJakes JanJakes changed the base branch from fix-ci to trunk January 29, 2026 07:36
@JanJakes JanJakes merged commit c087051 into trunk Jan 29, 2026
16 checks passed
@JanJakes JanJakes deleted the fix-migration branch January 29, 2026 07:37
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.

Wordpress.org playground files altered and not working

3 participants