diff options
author | drh <drh@noemail.net> | 2018-01-11 17:04:26 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2018-01-11 17:04:26 +0000 |
commit | 6f390beb7f96774e81420548ef0be7c16567bca1 (patch) | |
tree | 252ec085453f9e290ae884be5bd3550d9ce62452 /src/vdbeapi.c | |
parent | e4185bda9ac72005bae1308665d07596573f7cf5 (diff) | |
download | sqlite-6f390beb7f96774e81420548ef0be7c16567bca1.tar.gz sqlite-6f390beb7f96774e81420548ef0be7c16567bca1.zip |
Add the sqlite3_vtab_nochange() method which virtual table implementations
can use to optimize UPDATEs.
FossilOrigin-Name: d444b1ff39f0a1673a977b8047e1e14a49d461c9934be080d27c2392a830c1c0
Diffstat (limited to 'src/vdbeapi.c')
-rw-r--r-- | src/vdbeapi.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/vdbeapi.c b/src/vdbeapi.c index b9df40b8f..19aa783bb 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -746,6 +746,25 @@ sqlite3 *sqlite3_context_db_handle(sqlite3_context *p){ } /* +** If this routine is invoked from within an xColumn method of a virtual +** table, then it returns true if and only if the the call is during an +** UPDATE operation and the value of the column will not be modified +** by the UPDATE. +** +** If this routine is called from any context other than within the +** xColumn method of a virtual table, then the return value is meaningless +** and arbitrary. +** +** Virtual table implements might use this routine to optimize their +** performance by substituting a NULL result, or some other light-weight +** value, as a signal to the xUpdate routine that the column is unchanged. +*/ +int sqlite3_vtab_nochange(sqlite3_context *p){ + assert( p ); + return p->bVtabNoChng; +} + +/* ** Return the current time for a statement. If the current time ** is requested more than once within the same run of a single prepared ** statement, the exact same time is returned for each invocation regardless |