1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +03:00

Fix the sqlite_dbpage virtual table so that it starts a write transaction

on all attached schemas.

FossilOrigin-Name: 642a0b4752743216271e4f855a465515ef7f6a985f280251e18d67e3d5fb694b
This commit is contained in:
drh
2022-03-09 14:22:28 +00:00
parent b528a5a04e
commit 46dc631a32
5 changed files with 31 additions and 10 deletions

View File

@@ -3764,7 +3764,6 @@ int sqlite3_vtab_rhs_value(
return rc;
}
/*
** Return true if ORDER BY clause may be handled as DISTINCT.
*/
@@ -3776,6 +3775,22 @@ int sqlite3_vtab_distinct(sqlite3_index_info *pIdxInfo){
return pHidden->eDistinct;
}
#if (defined(SQLITE_ENABLE_DBPAGE_VTAB) || defined(SQLITE_TEST)) \
&& !defined(SQLITE_OMIT_VIRTUALTABLE)
/*
** Cause the prepared statement that is associated with a call to
** xBestIndex to open write transactions on all attached schemas.
** This is used by the (built-in) sqlite_dbpage virtual table.
*/
void sqlite3VtabWriteAll(sqlite3_index_info *pIdxInfo){
HiddenIndexInfo *pHidden = (HiddenIndexInfo*)&pIdxInfo[1];
Parse *pParse = pHidden->pParse;
Parse *pTopLevel = sqlite3ParseToplevel(pParse);
pTopLevel->cookieMask =
pTopLevel->writeMask = (((u64)1) << pParse->db->nDb) - 1;
}
#endif
/*
** Add all WhereLoop objects for a table of the join identified by
** pBuilder->pNew->iTab. That table is guaranteed to be a virtual table.