Change the names of the stream interface APIs to be of the form
"_strm" instead of "_str". In other words, added an "m" to the end, to try to make it clear that we are talking about a "stream" and not a "string. FossilOrigin-Name: 1f44bfdc237ee6304f4aa56e5c5d1c0d74fcc944
This commit is contained in:
parent
6382b6dc71
commit
f1a08ad88d
@ -406,4 +406,3 @@ do_concat_test2 4.4 {
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
||||
|
@ -89,4 +89,3 @@ do_then_undo 3.2 { UPDATE t3 SET b=b||b WHERE e!='x' }
|
||||
do_then_undo 3.3 { UPDATE t3 SET a = 46 }
|
||||
|
||||
finish_test
|
||||
|
||||
|
@ -285,4 +285,3 @@ do_execsql_test 5.4 {
|
||||
} {1 1}
|
||||
|
||||
finish_test
|
||||
|
||||
|
@ -104,5 +104,3 @@ do_test 3.4 {
|
||||
} {x y}
|
||||
|
||||
finish_test
|
||||
|
||||
|
||||
|
@ -516,4 +516,3 @@ do_patchset_changeset_test 5.3 \
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
|
@ -133,4 +133,3 @@ proc changeset_to_list {c} {
|
||||
sqlite3session_foreach elem $c { lappend list $elem }
|
||||
lsort $list
|
||||
}
|
||||
|
||||
|
@ -17,10 +17,12 @@ typedef struct SessionInput SessionInput;
|
||||
/*
|
||||
** Minimum chunk size used by streaming versions of functions.
|
||||
*/
|
||||
#ifdef SQLITE_TEST
|
||||
#define SESSIONS_STR_CHUNK_SIZE 64
|
||||
#else
|
||||
#define SESSIONS_STR_CHUNK_SIZE 1024
|
||||
#ifndef SESSIONS_STRM_CHUNK_SIZE
|
||||
# ifdef SQLITE_TEST
|
||||
# define SESSIONS_STRM_CHUNK_SIZE 64
|
||||
# else
|
||||
# define SESSIONS_STRM_CHUNK_SIZE 1024
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -52,7 +54,7 @@ struct SessionBuffer {
|
||||
** An object of this type is used internally as an abstraction for
|
||||
** input data. Input data may be supplied either as a single large buffer
|
||||
** (e.g. sqlite3changeset_start()) or using a stream function (e.g.
|
||||
** sqlite3changeset_start_str()).
|
||||
** sqlite3changeset_start_strm()).
|
||||
*/
|
||||
struct SessionInput {
|
||||
int iNext; /* Offset in aData[] of next change */
|
||||
@ -1907,12 +1909,12 @@ int sessionGenerateChangeset(
|
||||
rc = sqlite3_reset(pSel);
|
||||
}
|
||||
|
||||
/* If the buffer is now larger than SESSIONS_STR_CHUNK_SIZE, pass
|
||||
/* If the buffer is now larger than SESSIONS_STRM_CHUNK_SIZE, pass
|
||||
** its contents to the xOutput() callback. */
|
||||
if( xOutput
|
||||
&& rc==SQLITE_OK
|
||||
&& buf.nBuf>nNoop
|
||||
&& buf.nBuf>SESSIONS_STR_CHUNK_SIZE
|
||||
&& buf.nBuf>SESSIONS_STRM_CHUNK_SIZE
|
||||
){
|
||||
rc = xOutput(pOut, (void*)buf.aBuf, buf.nBuf);
|
||||
nNoop = -1;
|
||||
@ -1964,7 +1966,7 @@ int sqlite3session_changeset(
|
||||
/*
|
||||
** Streaming version of sqlite3session_changeset().
|
||||
*/
|
||||
int sqlite3session_changeset_str(
|
||||
int sqlite3session_changeset_strm(
|
||||
sqlite3_session *pSession,
|
||||
int (*xOutput)(void *pOut, const void *pData, int nData),
|
||||
void *pOut
|
||||
@ -1975,7 +1977,7 @@ int sqlite3session_changeset_str(
|
||||
/*
|
||||
** Streaming version of sqlite3session_patchset().
|
||||
*/
|
||||
int sqlite3session_patchset_str(
|
||||
int sqlite3session_patchset_strm(
|
||||
sqlite3_session *pSession,
|
||||
int (*xOutput)(void *pOut, const void *pData, int nData),
|
||||
void *pOut
|
||||
@ -2044,7 +2046,7 @@ int sqlite3session_isempty(sqlite3_session *pSession){
|
||||
}
|
||||
|
||||
/*
|
||||
** Do the work for either sqlite3changeset_start() or start_str().
|
||||
** Do the work for either sqlite3changeset_start() or start_strm().
|
||||
*/
|
||||
int sessionChangesetStart(
|
||||
sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
|
||||
@ -2092,7 +2094,7 @@ int sqlite3changeset_start(
|
||||
/*
|
||||
** Streaming version of sqlite3changeset_start().
|
||||
*/
|
||||
int sqlite3changeset_start_str(
|
||||
int sqlite3changeset_start_strm(
|
||||
sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */
|
||||
int (*xInput)(void *pIn, void *pData, int *pnData),
|
||||
void *pIn
|
||||
@ -2111,9 +2113,9 @@ static int sessionInputBuffer(SessionInput *pIn, int nByte){
|
||||
int rc = SQLITE_OK;
|
||||
if( pIn->xInput ){
|
||||
while( !pIn->bEof && (pIn->iNext+nByte)>=pIn->nData && rc==SQLITE_OK ){
|
||||
int nNew = SESSIONS_STR_CHUNK_SIZE;
|
||||
int nNew = SESSIONS_STRM_CHUNK_SIZE;
|
||||
|
||||
if( pIn->iNext>=SESSIONS_STR_CHUNK_SIZE ){
|
||||
if( pIn->iNext>=SESSIONS_STRM_CHUNK_SIZE ){
|
||||
int nMove = pIn->buf.nBuf - pIn->iNext;
|
||||
memmove(pIn->buf.aBuf, &pIn->buf.aBuf[pIn->iNext], nMove);
|
||||
pIn->buf.nBuf -= pIn->iNext;
|
||||
@ -2801,7 +2803,7 @@ static int sessionChangesetInvert(
|
||||
}
|
||||
|
||||
assert( rc==SQLITE_OK );
|
||||
if( xOutput && sOut.nBuf>=SESSIONS_STR_CHUNK_SIZE ){
|
||||
if( xOutput && sOut.nBuf>=SESSIONS_STRM_CHUNK_SIZE ){
|
||||
rc = xOutput(pOut, sOut.aBuf, sOut.nBuf);
|
||||
sOut.nBuf = 0;
|
||||
if( rc!=SQLITE_OK ) goto finished_invert;
|
||||
@ -2847,7 +2849,7 @@ int sqlite3changeset_invert(
|
||||
/*
|
||||
** Streaming version of sqlite3changeset_invert().
|
||||
*/
|
||||
int sqlite3changeset_invert_str(
|
||||
int sqlite3changeset_invert_strm(
|
||||
int (*xInput)(void *pIn, void *pData, int *pnData),
|
||||
void *pIn,
|
||||
int (*xOutput)(void *pOut, const void *pData, int nData),
|
||||
@ -3641,7 +3643,7 @@ int sqlite3changeset_apply(
|
||||
** attached to handle "db". Invoke the supplied conflict handler callback
|
||||
** to resolve any conflicts encountered while applying the change.
|
||||
*/
|
||||
int sqlite3changeset_apply_str(
|
||||
int sqlite3changeset_apply_strm(
|
||||
sqlite3 *db, /* Apply change to "main" db of this handle */
|
||||
int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
|
||||
void *pIn, /* First arg for xInput */
|
||||
@ -3657,7 +3659,7 @@ int sqlite3changeset_apply_str(
|
||||
void *pCtx /* First argument passed to xConflict */
|
||||
){
|
||||
sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */
|
||||
int rc = sqlite3changeset_start_str(&pIter, xInput, pIn);
|
||||
int rc = sqlite3changeset_start_strm(&pIter, xInput, pIn);
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sessionChangesetApply(db, pIter, xFilter, xConflict, pCtx);
|
||||
}
|
||||
@ -3932,7 +3934,7 @@ int sessionChangesetConcat(
|
||||
}
|
||||
}
|
||||
|
||||
if( rc==SQLITE_OK && xOutput && buf.nBuf>=SESSIONS_STR_CHUNK_SIZE ){
|
||||
if( rc==SQLITE_OK && xOutput && buf.nBuf>=SESSIONS_STRM_CHUNK_SIZE ){
|
||||
rc = xOutput(pOut, buf.aBuf, buf.nBuf);
|
||||
buf.nBuf = 0;
|
||||
}
|
||||
@ -3986,7 +3988,7 @@ int sqlite3changeset_concat(
|
||||
/*
|
||||
** Streaming version of sqlite3changeset_concat().
|
||||
*/
|
||||
int sqlite3changeset_concat_str(
|
||||
int sqlite3changeset_concat_strm(
|
||||
int (*xInputA)(void *pIn, void *pData, int *pnData),
|
||||
void *pInA,
|
||||
int (*xInputB)(void *pIn, void *pData, int *pnData),
|
||||
@ -3998,9 +4000,9 @@ int sqlite3changeset_concat_str(
|
||||
sqlite3_changeset_iter *pIter2 = 0;
|
||||
int rc;
|
||||
|
||||
rc = sqlite3changeset_start_str(&pIter1, xInputA, pInA);
|
||||
rc = sqlite3changeset_start_strm(&pIter1, xInputA, pInA);
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3changeset_start_str(&pIter2, xInputB, pInB);
|
||||
rc = sqlite3changeset_start_strm(&pIter2, xInputB, pInB);
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sessionChangesetConcat(pIter1, pIter2, xOutput, pOut, 0, 0);
|
||||
|
@ -946,7 +946,7 @@ int sqlite3changeset_apply(
|
||||
/*
|
||||
** CAPI3REF: Streaming Versions of API functions.
|
||||
**
|
||||
** The six streaming API xxx_str() functions serve similar purposes to the
|
||||
** The six streaming API xxx_strm() functions serve similar purposes to the
|
||||
** corresponding non-streaming API functions:
|
||||
**
|
||||
** <table border=1 style="margin-left:8ex;margin-right:8ex">
|
||||
@ -995,7 +995,7 @@ int sqlite3changeset_apply(
|
||||
** an error, all processing is abandoned and the streaming API function
|
||||
** returns a copy of the error code to the caller.
|
||||
**
|
||||
** In the case of sqlite3changeset_start_str(), the xInput callback may be
|
||||
** In the case of sqlite3changeset_start_strm(), the xInput callback may be
|
||||
** invoked by the sessions module at any point during the lifetime of the
|
||||
** iterator. If such an xInput callback returns an error, the iterator enters
|
||||
** an error state, whereby all subsequent calls to iterator functions
|
||||
@ -1032,7 +1032,7 @@ int sqlite3changeset_apply(
|
||||
** parameter set to a value less than or equal to zero. Other than this,
|
||||
** no guarantees are made as to the size of the chunks of data returned.
|
||||
*/
|
||||
int sqlite3changeset_apply_str(
|
||||
int sqlite3changeset_apply_strm(
|
||||
sqlite3 *db, /* Apply change to "main" db of this handle */
|
||||
int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
|
||||
void *pIn, /* First arg for xInput */
|
||||
@ -1047,7 +1047,7 @@ int sqlite3changeset_apply_str(
|
||||
),
|
||||
void *pCtx /* First argument passed to xConflict */
|
||||
);
|
||||
int sqlite3changeset_concat_str(
|
||||
int sqlite3changeset_concat_strm(
|
||||
int (*xInputA)(void *pIn, void *pData, int *pnData),
|
||||
void *pInA,
|
||||
int (*xInputB)(void *pIn, void *pData, int *pnData),
|
||||
@ -1055,23 +1055,23 @@ int sqlite3changeset_concat_str(
|
||||
int (*xOutput)(void *pOut, const void *pData, int nData),
|
||||
void *pOut
|
||||
);
|
||||
int sqlite3changeset_invert_str(
|
||||
int sqlite3changeset_invert_strm(
|
||||
int (*xInput)(void *pIn, void *pData, int *pnData),
|
||||
void *pIn,
|
||||
int (*xOutput)(void *pOut, const void *pData, int nData),
|
||||
void *pOut
|
||||
);
|
||||
int sqlite3changeset_start_str(
|
||||
int sqlite3changeset_start_strm(
|
||||
sqlite3_changeset_iter **pp,
|
||||
int (*xInput)(void *pIn, void *pData, int *pnData),
|
||||
void *pIn
|
||||
);
|
||||
int sqlite3session_changeset_str(
|
||||
int sqlite3session_changeset_strm(
|
||||
sqlite3_session *pSession,
|
||||
int (*xOutput)(void *pOut, const void *pData, int nData),
|
||||
void *pOut
|
||||
);
|
||||
int sqlite3session_patchset_str(
|
||||
int sqlite3session_patchset_strm(
|
||||
sqlite3_session *pSession,
|
||||
int (*xOutput)(void *pOut, const void *pData, int nData),
|
||||
void *pOut
|
||||
|
@ -160,9 +160,9 @@ static int test_session_cmd(
|
||||
if( test_tcl_integer(interp, SESSION_STREAM_TCL_VAR) ){
|
||||
void *pCtx = (void*)&o;
|
||||
if( iSub==7 ){
|
||||
rc = sqlite3session_patchset_str(pSession, testStreamOutput, pCtx);
|
||||
rc = sqlite3session_patchset_strm(pSession, testStreamOutput, pCtx);
|
||||
}else{
|
||||
rc = sqlite3session_changeset_str(pSession, testStreamOutput, pCtx);
|
||||
rc = sqlite3session_changeset_strm(pSession, testStreamOutput, pCtx);
|
||||
}
|
||||
}else{
|
||||
if( iSub==7 ){
|
||||
@ -626,7 +626,7 @@ static int test_sqlite3changeset_apply(
|
||||
}else{
|
||||
sStr.aData = (unsigned char*)pChangeset;
|
||||
sStr.nData = nChangeset;
|
||||
rc = sqlite3changeset_apply_str(db, testStreamInput, (void*)&sStr,
|
||||
rc = sqlite3changeset_apply_strm(db, testStreamInput, (void*)&sStr,
|
||||
(objc==5) ? test_filter_handler : 0, test_conflict_handler, (void *)&ctx
|
||||
);
|
||||
}
|
||||
@ -697,7 +697,7 @@ static int test_sqlite3changeset_invert(
|
||||
sIn.aData = Tcl_GetByteArrayFromObj(objv[1], &sIn.nData);
|
||||
|
||||
if( sIn.nStream ){
|
||||
rc = sqlite3changeset_invert_str(
|
||||
rc = sqlite3changeset_invert_strm(
|
||||
testStreamInput, (void*)&sIn, testStreamOutput, (void*)&sOut
|
||||
);
|
||||
}else{
|
||||
@ -740,7 +740,7 @@ static int test_sqlite3changeset_concat(
|
||||
sRight.nStream = sLeft.nStream;
|
||||
|
||||
if( sLeft.nStream>0 ){
|
||||
rc = sqlite3changeset_concat_str(
|
||||
rc = sqlite3changeset_concat_strm(
|
||||
testStreamInput, (void*)&sLeft,
|
||||
testStreamInput, (void*)&sRight,
|
||||
testStreamOutput, (void*)&sOut
|
||||
@ -801,7 +801,7 @@ static int test_sqlite3session_foreach(
|
||||
}else{
|
||||
sStr.aData = (unsigned char*)pChangeset;
|
||||
sStr.nData = nChangeset;
|
||||
rc = sqlite3changeset_start_str(&pIter, testStreamInput, (void*)&sStr);
|
||||
rc = sqlite3changeset_start_strm(&pIter, testStreamInput, (void*)&sStr);
|
||||
}
|
||||
if( rc!=SQLITE_OK ){
|
||||
return test_session_error(interp, rc);
|
||||
|
32
manifest
32
manifest
@ -1,5 +1,5 @@
|
||||
C Merge\srecent\strunk\schanges\s(performance\senhancements)\sinto\sthe\ssessions\nbranch.
|
||||
D 2014-09-27T19:51:50.438
|
||||
C Change\sthe\snames\sof\sthe\sstream\sinterface\sAPIs\sto\sbe\sof\sthe\sform\n"_strm"\sinstead\sof\s"_str".\s\sIn\sother\swords,\sadded\san\s"m"\sto\sthe\send,\sto\ntry\sto\smake\sit\sclear\sthat\swe\sare\stalking\sabout\sa\s"stream"\sand\snot\sa\s"string.
|
||||
D 2014-09-27T20:45:48.295
|
||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||
F Makefile.in dd5f245aa8c741bc65845747203c8ce2f3fb6c83
|
||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||
@ -150,17 +150,17 @@ F ext/session/session1.test 4653867f32a98ce4bbb4a181aac6debe51ca4dfb
|
||||
F ext/session/session2.test 99ca0da7ddb617d42bafd83adccf99f18ae0384b
|
||||
F ext/session/session3.test a7a9ce59b8d1e49e2cc23d81421ac485be0eea01
|
||||
F ext/session/session4.test a6ed685da7a5293c5d6f99855bcf41dbc352ca84
|
||||
F ext/session/session5.test 8fdfaf9dba28a2f1c6b89b06168bdab1fef2d478
|
||||
F ext/session/session5.test 716bc6fafd625ce60dfa62ae128971628c1a1169
|
||||
F ext/session/session6.test 443789bc2fca12e4f7075cf692c60b8a2bea1a26
|
||||
F ext/session/session8.test 7d35947ad329b8966f095d34f9617a9eff52dc65
|
||||
F ext/session/session9.test b6dd1086de8c59b6f129923425487791f51c689c
|
||||
F ext/session/sessionA.test 5543846eb9ca045217262f5d8c9376ce812e1ba5
|
||||
F ext/session/sessionB.test d4ac901b43d4922a17dff08bbaa2f5354487ce4d
|
||||
F ext/session/session_common.tcl 1539d8973b2aea0025c133eb0cc4c89fcef541a5
|
||||
F ext/session/session8.test 8e194b3f655d861ca36de5d4de53f702751bab3b
|
||||
F ext/session/session9.test 5409d90d8141881d08285ed1c2c0d8d10fb92069
|
||||
F ext/session/sessionA.test 1feeab0b8e03527f08f2f1defb442da25480138f
|
||||
F ext/session/sessionB.test 06961b7c3641151f5d23088250ecad132501113c
|
||||
F ext/session/session_common.tcl 9de0451b6a47218fc16b9ed8876b6238a0a3d88d
|
||||
F ext/session/sessionfault.test bef044d0952c0d62c31c8d2400be72c8684545cc
|
||||
F ext/session/sqlite3session.c 0691b8d7434edb07166828778540bb418a7a68e3
|
||||
F ext/session/sqlite3session.h b57009fb88835cc4684376bd3eae0d6ab364968a
|
||||
F ext/session/test_session.c 56a4ddd443b571c8d365b03197c032bdaed1443a
|
||||
F ext/session/sqlite3session.c 67b8aee718cf34e267f4040d9b945a7a6407b0b2
|
||||
F ext/session/sqlite3session.h 16608d29879a0ed3c6be6b7fb18dcdb5c707aaef
|
||||
F ext/session/test_session.c a28352e99bc6a83b94e4cce99a7bf25c73d6d489
|
||||
F ext/userauth/sqlite3userauth.h 19cb6f0e31316d0ee4afdfb7a85ef9da3333a220
|
||||
F ext/userauth/user-auth.txt e6641021a9210364665fe625d067617d03f27b04
|
||||
F ext/userauth/userauth.c 5fa3bdb492f481bbc1709fc83c91ebd13460c69e
|
||||
@ -777,7 +777,7 @@ F test/pagesize.test 1dd51367e752e742f58e861e65ed7390603827a0
|
||||
F test/pcache.test b09104b03160aca0d968d99e8cd2c5b1921a993d
|
||||
F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025
|
||||
F test/percentile.test b98fc868d71eb5619d42a1702e9ab91718cbed54
|
||||
F test/permutations.test b8ca6c9ecec6f360485a8cb61ef1b8734b31797b
|
||||
F test/permutations.test a33230010a3d4ce0c57d586672ccef10a7d1af29
|
||||
F test/pragma.test 19d0241a007bcdd77fc2606ec60fc60357e7fc8b
|
||||
F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13
|
||||
F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552
|
||||
@ -833,7 +833,7 @@ F test/selectD.test b0f02a04ef7737decb24e08be2c39b9664b43394
|
||||
F test/selectE.test fc02a1eb04c8eb537091482644b7d778ae8759b7
|
||||
F test/selectF.test 21c94e6438f76537b72532fa9fd4710cdd455fc3
|
||||
F test/server1.test 46803bd3fe8b99b30dbc5ff38ffc756f5c13a118
|
||||
F test/session.test 35f9c76809c26bee45d86891c7620b692ef9b8a8
|
||||
F test/session.test 78fa2365e93d3663a6e933f86e7afc395adf18be
|
||||
F test/shared.test 1da9dbad400cee0d93f252ccf76e1ae007a63746
|
||||
F test/shared2.test 03eb4a8d372e290107d34b6ce1809919a698e879
|
||||
F test/shared3.test fcd65cb11d189eff5f5c85cc4fad246fb0933108
|
||||
@ -1217,7 +1217,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
|
||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
P 09985fa6b60a0bf38e23bbccd4d8e1d1cbf66124 d026f0c944ce812732d3595eaa3c5d432a86c7dd
|
||||
R 6b80dc3719dfaf6510fd0fc97f44558f
|
||||
P 497367cb57345dd37793e5f369b34d12be56172e
|
||||
R cc11bbbd763a56bfdd0667ee0dcdded3
|
||||
U drh
|
||||
Z 29718882bdf5b938c85c12503154fa25
|
||||
Z 9e5912d3733f34c1f4a27e9b30386e30
|
||||
|
@ -1 +1 @@
|
||||
497367cb57345dd37793e5f369b34d12be56172e
|
||||
1f44bfdc237ee6304f4aa56e5c5d1c0d74fcc944
|
@ -938,7 +938,7 @@ test_suite "session_eec" -description {
|
||||
sqlite3_extended_result_codes $::dbhandle 1
|
||||
}
|
||||
|
||||
test_suite "session_str" -description {
|
||||
test_suite "session_strm" -description {
|
||||
All session module related tests using the streaming APIs.
|
||||
} -files [
|
||||
glob -nocomplain $::testdir/../ext/session/*.test
|
||||
|
@ -16,7 +16,7 @@ ifcapable session {
|
||||
# again with it clear.
|
||||
run_test_suite session_eec
|
||||
run_test_suite session
|
||||
run_test_suite session_str
|
||||
run_test_suite session_strm
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
Loading…
Reference in New Issue
Block a user