Skip to content

tidb-cloud: add CREATE VIEW to DM target user GRANT example#22709

Open
alastori wants to merge 1 commit intopingcap:release-8.5from
alastori:cloud/dm-create-view-grant
Open

tidb-cloud: add CREATE VIEW to DM target user GRANT example#22709
alastori wants to merge 1 commit intopingcap:release-8.5from
alastori:cloud/dm-create-view-grant

Conversation

@alastori
Copy link
Copy Markdown
Collaborator

@alastori alastori commented Apr 7, 2026

Summary

The privilege table on line 464 of tidb-cloud/migrate-from-mysql-using-data-migration.md already lists CREATE VIEW as required (for views used by migration), but the copy-pasteable GRANT example on line 469 omits it. This causes TiDB Lightning to abort at errormanager.Init with Error 1142 for any user who follows the example literally.

This 1-line fix brings the GRANT example in line with the privilege table.

Reproduction

Standalone Lightning lab covering 8 scenarios across logical and physical modes against TiDB v8.5.5: alastori/tidb-sandbox#11

The diff in this PR is exactly the difference between scenarios L1 (fail with Error 1142) and L2 (clean exit) in the lab.

Why this hasn't been a flood of reports

Most users grant ALL PRIVILEGES to the import target user, which silently includes CREATE VIEW. The bug is only visible to users who follow the docs literally and minimize grants for security or compliance reasons.

Related

Follow-up (not in this PR)

  • The same line 469 also exists on master. If preferred, the fix should be cherry-picked or a parallel master PR opened.
  • tidb-lightning/tidb-lightning-requirements.md lines 26 and 61 (the OSS Lightning prereq doc) have the same gap and need a separate update.

Test plan

  • No code changes; documentation-only fix.
  • Reproduction confirmed in 8-scenario lab against TiDB v8.5.5 + Lightning v8.5.5.
  • L1 (docs grant verbatim): Error 1142. L2 (docs grant + CREATE VIEW): clean exit. The diff in this PR is the difference between L1 and L2.

cc @GMHDBJD as DM lead and the engineer who closed the sibling Lightning errormanager bug (pingcap/tiflow#11811)

@alastori
Copy link
Copy Markdown
Collaborator Author

alastori commented Apr 7, 2026

cc @GMHDBJD as DM lead and the engineer who closed sibling pingcap/tiflow#11811 (same Lightning errormanager.Init failure path) — please review when convenient.

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Apr 7, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign lilin90 for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added missing-translation-status This PR does not have translation status info. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 7, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation for migrating from MySQL to TiDB Cloud using Data Migration by adding the CREATE VIEW privilege to the example GRANT statement for the target database user. I have no feedback to provide.

The privilege table on line 464 of migrate-from-mysql-using-data-migration.md
already lists CREATE VIEW as required, but the copy-pasteable GRANT example on
line 469 omits it. This causes TiDB Lightning to abort at errormanager.Init
with Error 1142 for any user who follows the example literally.

The fix brings the GRANT example in line with the privilege table.
@alastori alastori force-pushed the cloud/dm-create-view-grant branch from ac15f2a to 43aa528 Compare April 8, 2026 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-translation-status This PR does not have translation status info. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant