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

When inserting a row into a child table, invoke the authorization callback to request permission to read the parent key columns.

FossilOrigin-Name: 9842f2d5f606eb8f641ecae9fbc5368b8d7e4286
This commit is contained in:
dan
2009-10-02 14:23:41 +00:00
parent 1316700e54
commit 47a06346ff
6 changed files with 120 additions and 29 deletions

View File

@@ -732,6 +732,13 @@ void sqlite3FkCheck(
if( aiCol[i]==pTab->iPKey ){
aiCol[i] = -1;
}
#ifndef SQLITE_OMIT_AUTHORIZATION
/* Request permission to read the parent key columns. */
if( db->xAuth ){
char *zCol = pTo->aCol[pIdx ? pIdx->aiColumn[i] : pTo->iPKey].zName;
sqlite3AuthReadCol(pParse, pTo->zName, zCol, iDb, 0);
}
#endif
}
/* Take a shared-cache advisory read-lock on the parent table. Allocate