Skip to content

Conversation

@n2em
Copy link

@n2em n2em commented Nov 14, 2025

bug fix for #469

…large dump files

Signed-off-by: chenen <itfunx@hotmail.com>
@n2em n2em force-pushed the bugfix/restore/token-too-long branch from 6008f71 to 9250cc1 Compare November 14, 2025 14:00
@deitch
Copy link
Collaborator

deitch commented Nov 16, 2025

I guess #469 was not totally fixed?

What is the root cause? Looking at the code here, it looks to me like you just recreated what scanner does? So why does this work?

@n2em
Copy link
Author

n2em commented Nov 16, 2025

The core issue lead to this bug is the const value of defaultMaxAllowedPacket, it just hard code to 4194304, if the line of SQL statements exceed this limitation, the bufio.Scanner will throw exception: token too long. In our case, the dump file size is about 7GB, and the max records in single table is about 50M, it just broken when restore with version 1.3.0, with this commit , the restore works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants