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

Duplicated records in mysql.bind_info after restoring from a full backup #46527

Closed
benmaoer opened this issue Aug 30, 2023 · 1 comment · Fixed by #48946
Closed

Duplicated records in mysql.bind_info after restoring from a full backup #46527

benmaoer opened this issue Aug 30, 2023 · 1 comment · Fixed by #48946
Labels

Comments

@benmaoer
Copy link

Bug Report

1. Minimal reproduce step (Required)

Restore mysql.bind_info from backup

tiup br restore full --pd "127.0.0.1:2379"  --storage "s3://us-west-2-demo-bucket-backup/full/snapshot-20230830?access-key=xxxx&secret-access-key=xxxx" --filter 'mysql.bind_info'  --with-sys-table --log-file restore.log

Check the SQL binding info

mysql> select * from mysql.bind_info where original_sql = 'builtin_pseudo_sql_for_bind_lock'; 

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

mysql> select * from bind_info where original_sql = 'builtin_pseudo_sql_for_bind_lock'\G
*************************** 1. row ***************************
original_sql: builtin_pseudo_sql_for_bind_lock
    bind_sql: builtin_pseudo_sql_for_bind_lock
  default_db: mysql
      status: builtin
 create_time: 0000-00-00 00:00:00.000
 update_time: 0000-00-00 00:00:00.000
     charset:
   collation:
      source: builtin
  sql_digest: NULL
 plan_digest: NULL
*************************** 2. row ***************************
original_sql: builtin_pseudo_sql_for_bind_lock
    bind_sql: builtin_pseudo_sql_for_bind_lock
  default_db: mysql
      status: builtin
 create_time: 0000-00-00 00:00:00.000
 update_time: 0000-00-00 00:00:00.000
     charset:
   collation:
      source: builtin
  sql_digest: NULL
 plan_digest: NULL
2 rows in set (0.01 sec)

3. What did you see instead (Required)

mysql> select * from bind_info where original_sql = 'builtin_pseudo_sql_for_bind_lock'\G
*************************** 1. row ***************************
original_sql: builtin_pseudo_sql_for_bind_lock
    bind_sql: builtin_pseudo_sql_for_bind_lock
  default_db: mysql
      status: builtin
 create_time: 0000-00-00 00:00:00.000
 update_time: 0000-00-00 00:00:00.000
     charset:
   collation:
      source: builtin
  sql_digest: NULL
 plan_digest: NULL
1 row in set (0.00 sec)

4. What is your TiDB version? (Required)

| Release Version: v7.3.0
Edition: Community
Git Commit Hash: 40b72e7a9a4fc9670d4c5d974dd503a3c6097471
Git Branch: heads/refs/tags/v7.3.0
UTC Build Time: 2023-08-08 09:27:28
GoVersion: go1.20.7
Race Enabled: false
Check Table Before Drop: false
Store: tikv |
@benmaoer benmaoer added the type/bug The issue is confirmed as a bug. label Aug 30, 2023
@benmaoer benmaoer changed the title Exists duplicated record in mysql.bind_info after restoring from a full backup Duplicated records in mysql.bind_info after restoring from a full backup Aug 30, 2023
@qw4990
Copy link
Contributor

qw4990 commented Nov 22, 2023

After discussing with BR members, we decided to use admin reload global bindings to solve this issue. The BR will execute admin flush global bindings automatically to force the optimizer to reload all bindings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants