MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / idxAuthCallback

Function idxAuthCallback

modules/dasSQLITE/sqlite/shell.c:11456–11492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11454}
11455
11456static int idxAuthCallback(
11457 void *pCtx,
11458 int eOp,
11459 const char *z3,
11460 const char *z4,
11461 const char *zDb,
11462 const char *zTrigger
11463){
11464 int rc = SQLITE_OK;
11465 (void)z4;
11466 (void)zTrigger;
11467 if( eOp==SQLITE_INSERT || eOp==SQLITE_UPDATE || eOp==SQLITE_DELETE ){
11468 if( sqlite3_stricmp(zDb, "main")==0 ){
11469 sqlite3expert *p = (sqlite3expert*)pCtx;
11470 IdxTable *pTab;
11471 for(pTab=p->pTable; pTab; pTab=pTab->pNext){
11472 if( 0==sqlite3_stricmp(z3, pTab->zName) ) break;
11473 }
11474 if( pTab ){
11475 IdxWrite *pWrite;
11476 for(pWrite=p->pWrite; pWrite; pWrite=pWrite->pNext){
11477 if( pWrite->pTab==pTab && pWrite->eOp==eOp ) break;
11478 }
11479 if( pWrite==0 ){
11480 pWrite = idxMalloc(&rc, sizeof(IdxWrite));
11481 if( rc==SQLITE_OK ){
11482 pWrite->pTab = pTab;
11483 pWrite->eOp = eOp;
11484 pWrite->pNext = p->pWrite;
11485 p->pWrite = pWrite;
11486 }
11487 }
11488 }
11489 }
11490 }
11491 return rc;
11492}
11493
11494static int idxProcessOneTrigger(
11495 sqlite3expert *p,

Callers

nothing calls this directly

Calls 1

idxMallocFunction · 0.85

Tested by

no test coverage detected