Lines Matching refs:pSession
10023 SQLITE_API void sqlite3session_delete(sqlite3_session *pSession);
10043 SQLITE_API int sqlite3session_enable(sqlite3_session *pSession, int bEnable);
10072 SQLITE_API int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect);
10132 sqlite3_session *pSession, /* Session object */
10146 sqlite3_session *pSession, /* Session object */
10259 sqlite3_session *pSession, /* Session object */
10321 sqlite3_session *pSession,
10357 sqlite3_session *pSession, /* Session object */
10377 SQLITE_API int sqlite3session_isempty(sqlite3_session *pSession);
11242 sqlite3_session *pSession,
11247 sqlite3_session *pSession,
179219 sqlite3_session *pSession, /* Session object that owns pTab */
179229 assert( pTab->nCol==pSession->hook.xCount(pSession->hook.pCtx) );
179237 rc = pSession->hook.xNew(pSession->hook.pCtx, i, &pVal);
179239 rc = pSession->hook.xOld(pSession->hook.pCtx, i, &pVal);
179551 sqlite3_session *pSession, /* Session object that owns SessionTable */
179575 rc = pSession->hook.xNew(pSession->hook.pCtx, iCol, &pVal);
179578 rc = pSession->hook.xOld(pSession->hook.pCtx, iCol, &pVal);
179805 static int sessionInitTable(sqlite3_session *pSession, SessionTable *pTab){
179809 pSession->rc = sessionTableInfo(pSession->db, pSession->zDb,
179812 if( pSession->rc==SQLITE_OK ){
179825 return (pSession->rc || pTab->abPK==0);
179837 sqlite3_session *pSession;
179844 pVal = p->pSession->pZeroBlob;
179854 pVal = p->pSession->pZeroBlob;
179879 sqlite3_session *pSession, /* Session object pTab is attached to */
179887 if( pSession->rc ) return;
179890 if( sessionInitTable(pSession, pTab) ) return;
179894 if( pTab->nCol!=pSession->hook.xCount(pSession->hook.pCtx) ){
179895 pSession->rc = SQLITE_SCHEMA;
179901 pSession->rc = SQLITE_NOMEM;
179906 stat1.hook = pSession->hook;
179907 stat1.pSession = pSession;
179908 pSession->hook.pCtx = (void*)&stat1;
179909 pSession->hook.xNew = sessionStat1New;
179910 pSession->hook.xOld = sessionStat1Old;
179911 pSession->hook.xCount = sessionStat1Count;
179912 pSession->hook.xDepth = sessionStat1Depth;
179913 if( pSession->pZeroBlob==0 ){
179920 pSession->pZeroBlob = p;
179927 rc = sessionPreupdateHash(pSession, pTab, op==SQLITE_INSERT, &iHash, &bNull);
179934 if( sessionPreupdateEqual(pSession, pTab, pC, op) ) break;
179953 TESTONLY(int trc = ) pSession->hook.xOld(pSession->hook.pCtx, i, &p);
179956 TESTONLY(int trc = ) pSession->hook.xNew(pSession->hook.pCtx, i, &p);
179984 pSession->hook.xOld(pSession->hook.pCtx, i, &p);
179986 pSession->hook.xNew(pSession->hook.pCtx, i, &p);
179992 if( pSession->bIndirect || pSession->hook.xDepth(pSession->hook.pCtx) ){
180003 if( pSession->hook.xDepth(pSession->hook.pCtx)==0
180004 && pSession->bIndirect==0
180014 pSession->hook = stat1.hook;
180017 pSession->rc = rc;
180022 sqlite3_session *pSession,
180031 for(pRet=pSession->pTable; pRet; pRet=pRet->pNext){
180035 if( pRet==0 && pSession->bAutoAttach ){
180038 if( pSession->xTableFilter==0
180039 || pSession->xTableFilter(pSession->pFilterCtx, zName)
180041 rc = sqlite3session_attach(pSession, zName);
180043 for(pRet=pSession->pTable; pRet->pNext; pRet=pRet->pNext);
180066 sqlite3_session *pSession;
180071 for(pSession=(sqlite3_session *)pCtx; pSession; pSession=pSession->pNext){
180077 if( pSession->bEnable==0 ) continue;
180078 if( pSession->rc ) continue;
180079 if( sqlite3_strnicmp(zDb, pSession->zDb, nDb+1) ) continue;
180081 pSession->rc = sessionFindTable(pSession, zName, &pTab);
180083 assert( pSession->rc==SQLITE_OK );
180084 sessionPreupdateOneChange(op, pSession, pTab);
180086 sessionPreupdateOneChange(SQLITE_INSERT, pSession, pTab);
180113 sqlite3_session *pSession
180115 pSession->hook.pCtx = (void*)pSession->db;
180116 pSession->hook.xOld = sessionPreupdateOld;
180117 pSession->hook.xNew = sessionPreupdateNew;
180118 pSession->hook.xCount = sessionPreupdateCount;
180119 pSession->hook.xDepth = sessionPreupdateDepth;
180154 sqlite3_session *pSession,
180157 pSession->hook.pCtx = (void*)pDiffCtx;
180158 pSession->hook.xOld = sessionDiffOld;
180159 pSession->hook.xNew = sessionDiffNew;
180160 pSession->hook.xCount = sessionDiffCount;
180161 pSession->hook.xDepth = sessionDiffDepth;
180236 sqlite3_session *pSession,
180249 rc = sqlite3_prepare(pSession->db, zStmt, -1, &pStmt, 0);
180251 SessionDiffCtx *pDiffCtx = (SessionDiffCtx*)pSession->hook.pCtx;
180255 sessionPreupdateOneChange(op, pSession, pTab);
180266 sqlite3_session *pSession,
180274 pSession->zDb, zFrom, pTab->zName, pTab->azCol, pTab->abPK
180281 pSession->zDb, pTab->zName, zFrom, pTab->zName, zExpr, zExpr2
180287 rc = sqlite3_prepare(pSession->db, zStmt, -1, &pStmt, 0);
180290 SessionDiffCtx *pDiffCtx = (SessionDiffCtx*)pSession->hook.pCtx;
180294 sessionPreupdateOneChange(SQLITE_UPDATE, pSession, pTab);
180306 sqlite3_session *pSession,
180311 const char *zDb = pSession->zDb;
180312 int rc = pSession->rc;
180316 sessionDiffHooks(pSession, &d);
180318 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
180322 sqlite3 *db = pSession->db;
180326 rc = sessionFindTable(pSession, zTbl, &pTo);
180328 if( sessionInitTable(pSession, pTo) ){
180329 rc = pSession->rc;
180372 rc = sessionDiffFindNew(SQLITE_INSERT, pSession, pTo, zDb, zFrom, zExpr);
180377 rc = sessionDiffFindNew(SQLITE_DELETE, pSession, pTo, zFrom, zDb, zExpr);
180382 rc = sessionDiffFindModified(pSession, pTo, zFrom, zExpr);
180389 sessionPreupdateHooks(pSession);
180390 sqlite3_mutex_leave(sqlite3_db_mutex(pSession->db));
180460 SQLITE_API void sqlite3session_delete(sqlite3_session *pSession){
180461 sqlite3 *db = pSession->db;
180470 if( (*pp)==pSession ){
180477 sqlite3ValueFree(pSession->pZeroBlob);
180481 sessionDeleteTable(pSession->pTable);
180484 sqlite3_free(pSession);
180491 sqlite3_session *pSession,
180495 pSession->bAutoAttach = 1;
180496 pSession->pFilterCtx = pCtx;
180497 pSession->xTableFilter = xFilter;
180509 sqlite3_session *pSession, /* Session object */
180513 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
180516 pSession->bAutoAttach = 1;
180524 for(pTab=pSession->pTable; pTab; pTab=pTab->pNext){
180543 for(ppTab=&pSession->pTable; *ppTab; ppTab=&(*ppTab)->pNext);
180549 sqlite3_mutex_leave(sqlite3_db_mutex(pSession->db));
181086 sqlite3_session *pSession, /* Session object */
181093 sqlite3 *db = pSession->db; /* Source database handle */
181108 if( pSession->rc ) return pSession->rc;
181109 rc = sqlite3_exec(pSession->db, "SAVEPOINT changeset", 0, 0, 0);
181114 for(pTab=pSession->pTable; rc==SQLITE_OK && pTab; pTab=pTab->pNext){
181126 rc = sessionTableInfo(db, pSession->zDb, zName, &nCol, 0, &azCol, &abPK);
181137 db, pSession->zDb, zName, nCol, azCol, abPK, &pSel);
181212 sqlite3_session *pSession, /* Session object */
181216 return sessionGenerateChangeset(pSession, 0, 0, 0, pnChangeset, ppChangeset);
181223 sqlite3_session *pSession,
181227 return sessionGenerateChangeset(pSession, 0, xOutput, pOut, 0, 0);
181234 sqlite3_session *pSession,
181238 return sessionGenerateChangeset(pSession, 1, xOutput, pOut, 0, 0);
181249 sqlite3_session *pSession, /* Session object */
181253 return sessionGenerateChangeset(pSession, 1, 0, 0, pnPatchset, ppPatchset);
181259 SQLITE_API int sqlite3session_enable(sqlite3_session *pSession, int bEnable){
181261 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
181263 pSession->bEnable = bEnable;
181265 ret = pSession->bEnable;
181266 sqlite3_mutex_leave(sqlite3_db_mutex(pSession->db));
181273 SQLITE_API int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){
181275 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
181277 pSession->bIndirect = bIndirect;
181279 ret = pSession->bIndirect;
181280 sqlite3_mutex_leave(sqlite3_db_mutex(pSession->db));
181288 SQLITE_API int sqlite3session_isempty(sqlite3_session *pSession){
181292 sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
181293 for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){
181296 sqlite3_mutex_leave(sqlite3_db_mutex(pSession->db));