зеркало из https://github.com/mozilla/gecko-dev.git
38a1672309
Previously, `mozIStorageConnection#transactionInProgress` returned true only if a transaction was started via `beginTransaction()`. This meant that manually executing `BEGIN`, as `Sqlite.jsm` and the Rust bindings do, wouldn't accurately report if a transaction was in progress. Similarly, the flag wasn't accurate in cases where SQLite automatically rolled back a transaction. Fortunately, SQLite provides the `sqlite3_get_autocommit()` function, which we can use to determine if a transaction is open or not. This commit refactors the `transactionInProgress` getter, along with all `Connection` methods that depend on it, to use the SQLite API instead of managing that state on the connection. `mozStorageTransaction` and `Sqlite.jsm` still use their own flags to decide whether to commit their transactions, for reasons explained in the IDL comment. This commit also moves `transactionInProgress` to `mozIStorageAsyncConnection`, so that `Sqlite.jsm` can use it, and exposes it to Rust. Differential Revision: https://phabricator.services.mozilla.com/D63732 --HG-- extra : moz-landing-system : lando |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |