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

issue with Bulk Insert in Planetscale: Argument Mismatch Error When Scaling Up #932

Open
Imran-imtiaz48 opened this issue Jun 27, 2024 · 1 comment

Comments

@Imran-imtiaz48
Copy link

I'm encountering an issue in one of my write-heavy applications when writing into Planetscale (MySQL). I'm getting the error: sql: expected 28556 arguments, got 290700. Interestingly, the inserts work correctly when the number of rows is smaller.

Is there a known issue with scaling up inserts, such as an upper boundary where this breaks?

I'm using bulk insert with tx.NamedExec() and passing in a struct slice (no pointers). The struct has around 15 fields. If anyone has ideas about the root cause (whether it's database/sql, github.com/go-sql-driver/mysql, Planetscale limitations, or a missing MySQL setting), I would appreciate any suggestions.

@Kangaroux
Copy link

Kangaroux commented Jun 30, 2024

Can you post a code sample? A mismatch likely indicates an error in the logic rather than a limit that's being exceeded. I've experienced something similar in Django with a bad JOIN that caused a column mismatch.

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

No branches or pull requests

2 participants