L1 · Pyodide · sqlite3

Reproducing python/cpython#137205

Loading Pyodide runtime…

Reproduction script

import sys
import sqlite3

off = sqlite3.connect(":memory:", autocommit=False)
off.execute("PRAGMA foreign_keys = ON")
off.commit()

on = sqlite3.connect(":memory:", autocommit=True)
on.execute("PRAGMA foreign_keys = ON")

off_value = off.execute("PRAGMA foreign_keys").fetchone()[0]
on_value = on.execute("PRAGMA foreign_keys").fetchone()[0]

{
    "python_version": sys.version.split()[0],
    "sqlite_version": sqlite3.sqlite_version,
    "off_autocommit_fk": int(off_value),
    "on_autocommit_fk": int(on_value),
    "fk_disagreement": off_value != on_value,
}

Output

(running)