Skip to content

SQLite variable limit check for migrating PR reviews #11236

@PeterSurda

Description

@PeterSurda

Description

Trying to migrate a repository from github failed when migrating pull requests is requested. I am in the process of creating a new repo to demonstrate how to reproduce the issue. I'll post an update once it's available. The error I get is
Migrate repository from xxxxxxxxx failed: too many SQL variables

I think it happens if a PR review has too many comments. SQLite has a compile time limit of arguments, defaulting to 999. I don't think the value can be increased without recompiling the library.

I tried to find the location in the code that could be causing this, and my best guess is that it's here:

if _, err := sess.NoAutoTime().Insert(review.Comments); err != nil {

As far as I can see, there is no check for the number of arguments. One row appears to have 31 columns in my case, so doing the insert in chunks of int(999/31) = 32 would fix it.

I'd try to create a PR myself but I'm not familiar with go (language, build system, tests, ...).
...

Screenshots

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions