test(ddl): cover generated columns and expression defaults - #1058
Draft
aparajon wants to merge 1 commit into
Draft
test(ddl): cover generated columns and expression defaults#1058aparajon wants to merge 1 commit into
aparajon wants to merge 1 commit into
Conversation
The differ had no coverage for the two column shapes MySQL reports back with parentheses of its own: generated columns and parenthesized DEFAULT expressions. Both are compared as parsed expressions rather than text, so a converged table plans no work whichever spelling the schema file uses, while a changed expression, a STORED/VIRTUAL switch, and an expression default that is not DEFAULT CURRENT_TIMESTAMP each still plan an ALTER. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
aparajon
force-pushed
the
armand/ddl-canonicalization-tests
branch
from
August 17, 2026 03:42
9f08ffc to
0cf1fcb
Compare
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.
Follow-up to the Spirit bump. The differ had no coverage for the two column shapes MySQL reports back with parentheses of its own — generated columns and parenthesized
DEFAULTexpressions — which is exactly the area the new parser touched.The tests pin that both are compared as parsed expressions rather than as text, so a converged table plans no work whichever spelling its schema file uses, while a changed expression, a
STORED/VIRTUALswitch, and an expression default that is notDEFAULT CURRENT_TIMESTAMPeach still plan anALTER. The source-side fixture is verbatimSHOW CREATE TABLEoutput from MySQL 8.0, so the round trip is the real one a plan performs and not an idealized form.Two behavior differences the coverage records, both improvements:
DEFAULTexpression wrapped in nested parentheses now parses. It used to be rejected outright, even though MySQL emits that form itself, which made any table using one unplannable.DEFAULT (now())andDEFAULT CURRENT_TIMESTAMPare now distinguished. MySQL reports each back exactly as declared, so collapsing them let a schema file drift from its table with no plan ever showing it.Based on the Spirit bump branch rather than
main, since the behavior only holds with the newer parser.This PR was written by Claude Code (claude-opus-5).