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

sqlite: move first read into a transaction #18339

Merged
merged 1 commit into from
Apr 26, 2023

Commits on Apr 25, 2023

  1. sqlite: move first read into a transaction

    According to an old upstream issue [1]: "If the first statement after
    BEGIN DEFERRED is a SELECT, then a read transaction is started.
    Subsequent write statements will upgrade the transaction to a write
    transaction if possible, or return SQLITE_BUSY."
    
    So let's move the first SELECT under the same transaction as the table
    initialization.
    
    [NO NEW TESTS NEEDED] as it's a hard to cause race.
    
    [1] mattn/go-sqlite3#274 (comment)
    
    Fixes: containers#17859
    Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
    vrothberg committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    bbe9d61 View commit details
    Browse the repository at this point in the history