mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
db: fix sqlite3 code which manipulates columns.
Because it used internal routines, it didn't pass operations through the db hook! So make it use the generic routines, with the twist that they are not translated. And when we use this in a migration hook, we're actually in a transaction. This, in turn, introduces an issue: we need to be outside a transaction to "PRAGMA foreign_keys = OFF", but completing the transaction when there is a db hook actually enters the io loop, freeing the tmpctx! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
d7aa2749c3
commit
e853cdc3ff
@@ -97,4 +97,12 @@ void db_assert_no_outstanding_statements(struct db *db);
|
||||
*/
|
||||
const char **db_changes(struct db *db);
|
||||
|
||||
/**
|
||||
* Accessor for internal use.
|
||||
*
|
||||
* Like db_prepare_v2() but creates temporary noop translation, and
|
||||
* assumes not a read-only op. Use this inside db-specific backends
|
||||
* to re-use the normal db hook and replication logic.
|
||||
*/
|
||||
struct db_stmt *db_prepare_untranslated(struct db *db, const char *query);
|
||||
#endif /* LIGHTNING_DB_UTILS_H */
|
||||
|
||||
Reference in New Issue
Block a user