Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lightning's internal table does not have PK so can't work with sql_require_primary_key=ON #57479

Closed
lance6716 opened this issue Nov 19, 2024 · 6 comments · Fixed by #57480
Closed
Labels
affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-8.5 This bug affects the 8.5.x(LTS) versions. severity/moderate type/bug The issue is confirmed as a bug.

Comments

@lance6716
Copy link
Contributor

lance6716 commented Nov 19, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

turn on sql_require_primary_key and run lightning

2. What did you expect to see? (Required)

no error

3. What did you see instead (Required)

lightning will create some internal tables, and failed with error Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting. This is because these tables have no PK

4. What is your TiDB version? (Required)

all version

@lance6716 lance6716 added the type/bug The issue is confirmed as a bug. label Nov 19, 2024
@D3Hunter
Copy link
Contributor

does DM have this issue?

@lance6716
Copy link
Contributor Author

does DM have this issue?

Yes we should also upgrade lightning dependency for DM

@D3Hunter
Copy link
Contributor

I mean does any DM's internal table has no PK?

@lance6716
Copy link
Contributor Author

DM internal tables also need to add PK, like (cp *RemoteCheckPoint) createTable. Will create issue in tiflow repo soon

@lance6716
Copy link
Contributor Author

forget to change the VIEW name, reopen.

@lance6716
Copy link
Contributor Author

seems no need to change VIEW name, because we use CREATE OR REPLACE VIEW

@ti-chi-bot ti-chi-bot bot added the affects-6.5 This bug affects the 6.5.x(LTS) versions. label Dec 3, 2024
@ti-chi-bot ti-chi-bot bot added the affects-8.5 This bug affects the 8.5.x(LTS) versions. label Dec 3, 2024
ti-chi-bot bot pushed a commit that referenced this issue Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-8.5 This bug affects the 8.5.x(LTS) versions. severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants