1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Note in the documentation that when iterating through a changeset, all changes to a single table are grouped together. Also add the sqlite3session_isempty() function.

FossilOrigin-Name: 364f3b820a26f9b15cf74a0222ed5e302becc54f
This commit is contained in:
dan
2011-07-16 18:05:07 +00:00
parent 4f52804206
commit b69ec3482a
6 changed files with 88 additions and 10 deletions

View File

@ -1773,6 +1773,23 @@ int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){
return ret;
}
/*
** Return true if there have been no changes to monitored tables recorded
** by the session object passed as the only argument.
*/
int sqlite3session_isempty(sqlite3_session *pSession){
int ret = 0;
SessionTable *pTab;
sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db));
for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){
ret = (pTab->nEntry>0);
}
sqlite3_mutex_leave(sqlite3_db_mutex(pSession->db));
return ret;
}
/*
** Create an iterator used to iterate through the contents of a changeset.
*/