test(dm): add DDL option regression coverage#12685
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Code Review
This pull request introduces new unit tests to verify the parsing and tracking of DDLs with specific CREATE TABLE options, such as 'transactional=0', 'PAGE_CHECKSUM=1', and 'AUTOEXTEND_SIZE=4M'. Feedback was provided to address a potential loop variable capture issue in the parallel subtests of 'TestParserSpecificCreateTableOptions' to prevent race conditions in Go versions prior to 1.22.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| for _, sql := range cases { | ||
| t.Run(sql, func(t *testing.T) { |
There was a problem hiding this comment.
In Go versions prior to 1.22, referencing the loop variable sql directly inside a parallel subtest (t.Parallel()) causes all subtests to run using the value of the loop variable from the last iteration. To prevent this race condition and ensure all test cases are executed correctly, capture the loop variable sql locally within the loop.
| for _, sql := range cases { | |
| t.Run(sql, func(t *testing.T) { | |
| for _, sql := range cases { | |
| sql := sql | |
| t.Run(sql, func(t *testing.T) { |
What problem does this PR solve?
Issue Number: close #12429
DM should continue to accept upstream CREATE TABLE DDLs that include MariaDB-specific table options such as
PAGE_CHECKSUMandTRANSACTIONAL, and MySQL-specific table options such asAUTOEXTEND_SIZE.On current
upstream/master, the reported DDL statements are already accepted by the TiDB parser dependency, so the original parser/schema-tracker failure is not reproducible anymore. This PR adds focused regression coverage in DM to prevent this compatibility behavior from regressing.What is changed and how it works?
TRANSACTIONAL=0PAGE_CHECKSUM=1 TRANSACTIONAL=0AUTOEXTEND_SIZE=4MCheck List
Tests
Commands run:
Questions
Will it cause performance regression or break compatibility?
No. This PR only adds regression tests and does not change runtime behavior.
Do you need to update user documentation, design documentation or monitoring documentation?
No. This PR only adds regression test coverage for existing compatible behavior.
Release note