Merge updates from trunk.

FossilOrigin-Name: 4859778900a99e7e50ce3d56910ad4c5469f2cdb
This commit is contained in:
mistachkin
2015-09-12 16:59:38 +00:00
19 changed files with 179 additions and 200 deletions
-17
View File
@@ -387,12 +387,6 @@ int sqlite3Fts5IndexSync(Fts5Index *p, int bCommit);
*/
int sqlite3Fts5IndexRollback(Fts5Index *p);
/*
** Retrieve and clear the current error code, respectively.
*/
int sqlite3Fts5IndexErrcode(Fts5Index*);
void sqlite3Fts5IndexReset(Fts5Index*);
/*
** Get or set the "averages" values.
*/
@@ -678,17 +672,6 @@ int sqlite3Fts5TokenizerInit(fts5_api*);
** End of interface to code in fts5_tokenizer.c.
**************************************************************************/
/**************************************************************************
** Interface to code in fts5_sorter.c.
*/
typedef struct Fts5Sorter Fts5Sorter;
int sqlite3Fts5SorterNew(Fts5Expr *pExpr, Fts5Sorter **pp);
/*
** End of interface to code in fts5_sorter.c.
**************************************************************************/
/**************************************************************************
** Interface to code in fts5_vocab.c.
*/
-1
View File
@@ -947,7 +947,6 @@ static int fts5ExprNearNextMatch(
for(j=0; j<pPhrase->nTerm; j++){
Fts5ExprTerm *pTerm = &pPhrase->aTerm[j];
if( pTerm->pSynonym ){
int bEof = 1;
i64 iRowid = fts5ExprSynonymRowid(pTerm, bDesc, 0);
if( iRowid==iLast ) continue;
bMatch = 0;
+6 -31
View File
@@ -737,7 +737,6 @@ static void fts5DataWrite(Fts5Index *p, i64 iRowid, const u8 *pData, int nData){
if( p->rc!=SQLITE_OK ) return;
if( p->pWriter==0 ){
int rc = SQLITE_OK;
Fts5Config *pConfig = p->pConfig;
fts5IndexPrepareStmt(p, &p->pWriter, sqlite3_mprintf(
"REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)",
@@ -973,7 +972,6 @@ static Fts5Structure *fts5StructureRead(Fts5Index *p){
Fts5Structure *pRet = 0; /* Object to return */
int iCookie; /* Configuration cookie */
Fts5Data *pData;
Fts5Buffer buf = {0, 0, 0};
pData = fts5DataRead(p, FTS5_STRUCTURE_ROWID);
if( p->rc ) return 0;
@@ -1417,11 +1415,6 @@ static int fts5DlidxIterPgno(Fts5DlidxIter *pIter){
return pIter->aLvl[0].iLeafPgno;
}
static void fts5LeafHeader(Fts5Data *pLeaf, int *piRowid, int *piTerm){
*piRowid = (int)fts5GetU16(&pLeaf->p[0]);
*piTerm = (int)fts5GetU16(&pLeaf->p[2]);
}
/*
** Load the next leaf page into the segment iterator.
*/
@@ -1827,7 +1820,6 @@ static void fts5SegIterNext(
fts5DataRelease(pIter->pLeaf);
pIter->pLeaf = 0;
}else{
int nExtra;
fts5SegIterLoadTerm(p, pIter, nKeep);
fts5SegIterLoadNPos(p, pIter);
if( pbNewTerm ) *pbNewTerm = 1;
@@ -1857,12 +1849,11 @@ static void fts5SegIterReverse(Fts5Index *p, Fts5SegIter *pIter){
pgnoLast = fts5DlidxIterPgno(pDlidx);
pLast = fts5DataRead(p, FTS5_SEGMENT_ROWID(iSegid, pgnoLast));
}else{
int iOff; /* Byte offset within pLeaf */
Fts5Data *pLeaf = pIter->pLeaf; /* Current leaf data */
/* Currently, Fts5SegIter.iLeafOffset (and iOff) points to the first
** byte of position-list content for the current rowid. Back it up
** so that it points to the start of the position-list size field. */
/* Currently, Fts5SegIter.iLeafOffset points to the first byte of
** position-list content for the current rowid. Back it up so that it
** points to the start of the position-list size field. */
pIter->iLeafOffset -= sqlite3Fts5GetVarintLen(pIter->nPos*2+pIter->bDel);
/* If this condition is true then the largest rowid for the current
@@ -1988,7 +1979,6 @@ static void fts5LeafSeek(
int nMatch = 0;
int nKeep = 0;
int nNew = 0;
int iTerm = 0;
int iTermOff;
int iPgidx; /* Current offset in pgidx */
int bEndOfPage = 0;
@@ -2048,7 +2038,6 @@ static void fts5LeafSeek(
return;
}else if( bEndOfPage ){
do {
iTerm = 0;
fts5SegIterNextPage(p, pIter);
if( pIter->pLeaf==0 ) return;
a = pIter->pLeaf->p;
@@ -3314,10 +3303,6 @@ static void fts5WriteAppendPoslistData(
}
}
static void fts5WriteAppendZerobyte(Fts5Index *p, Fts5SegWriter *pWriter){
fts5BufferAppendVarint(&p->rc, &pWriter->writer.buf, 0);
}
/*
** Flush any data cached by the writer object to the database. Free any
** allocations associated with the writer.
@@ -3480,7 +3465,6 @@ static void fts5IndexMergeLevel(
Fts5SegWriter writer; /* Writer object */
Fts5StructureSegment *pSeg; /* Output segment */
Fts5Buffer term;
int bRequireDoclistTerm = 0; /* Doclist terminator (0x00) required */
int bOldest; /* True if the output segment is the oldest */
assert( iLvl<pStruct->nLevel );
@@ -3545,13 +3529,8 @@ static void fts5IndexMergeLevel(
}
/* This is a new term. Append a term to the output segment. */
/* TODO2: Doclist 0x00 term */
if( bRequireDoclistTerm ){
/* fts5WriteAppendZerobyte(p, &writer); */
}
fts5WriteAppendTerm(p, &writer, nTerm, pTerm);
fts5BufferSet(&p->rc, &term, nTerm, pTerm);
bRequireDoclistTerm = 1;
}
/* Append the rowid to the output */
@@ -3758,7 +3737,6 @@ static void fts5FlushOneHash(Fts5Index *p){
Fts5StructureSegment *pSeg; /* New segment within pStruct */
Fts5Buffer *pBuf; /* Buffer in which to assemble leaf page */
Fts5Buffer *pPgidx; /* Buffer in which to assemble pgidx */
const u8 *zPrev = 0;
Fts5SegWriter writer;
fts5WriteInit(p, &writer, iSegid);
@@ -3780,11 +3758,10 @@ static void fts5FlushOneHash(Fts5Index *p){
const char *zTerm; /* Buffer containing term */
const u8 *pDoclist; /* Pointer to doclist for this term */
int nDoclist; /* Size of doclist in bytes */
int nSuffix; /* Size of term suffix */
/* Write the term for this entry to disk. */
sqlite3Fts5HashScanEntry(pHash, &zTerm, &pDoclist, &nDoclist);
fts5WriteAppendTerm(p, &writer, strlen(zTerm), zTerm);
fts5WriteAppendTerm(p, &writer, strlen(zTerm), (const u8*)zTerm);
if( writer.bFirstRowidInPage==0
&& pgsz>=(pBuf->n + pPgidx->n + nDoclist + 1)
@@ -3854,7 +3831,6 @@ static void fts5FlushOneHash(Fts5Index *p){
/* TODO2: Doclist terminator written here. */
/* pBuf->p[pBuf->n++] = '\0'; */
assert( pBuf->n<=pBuf->nSpace );
zPrev = (const u8*)zTerm;
sqlite3Fts5HashScanNext(pHash);
}
sqlite3Fts5HashClear(pHash);
@@ -4888,7 +4864,6 @@ static void fts5IndexIntegrityCheckEmpty(
}
static void fts5IntegrityCheckPgidx(Fts5Index *p, Fts5Data *pLeaf){
int nPg = (pLeaf->nn - pLeaf->szLeaf) / 2;
int iTermOff = 0;
int ii;
@@ -5300,7 +5275,7 @@ static int fts5DecodePoslist(int *pRc, Fts5Buffer *pBuf, const u8 *a, int n){
** The return value is the number of bytes read from the input buffer.
*/
static int fts5DecodeDoclist(int *pRc, Fts5Buffer *pBuf, const u8 *a, int n){
i64 iDocid;
i64 iDocid = 0;
int iOff = 0;
if( n>0 ){
@@ -5476,7 +5451,7 @@ static void fts5RowidFunction(
zArg = (const char*)sqlite3_value_text(apVal[0]);
if( 0==sqlite3_stricmp(zArg, "segment") ){
i64 iRowid;
int segid, height, pgno;
int segid, pgno;
if( nArg!=3 ){
sqlite3_result_error(pCtx,
"should be: fts5_rowid('segment', segid, pgno))", -1
+4 -4
View File
@@ -25,11 +25,11 @@
int sqlite3_fts5_may_be_corrupt = 1;
typedef struct Fts5Table Fts5Table;
typedef struct Fts5Cursor Fts5Cursor;
typedef struct Fts5Auxiliary Fts5Auxiliary;
typedef struct Fts5Auxdata Fts5Auxdata;
typedef struct Fts5Auxiliary Fts5Auxiliary;
typedef struct Fts5Cursor Fts5Cursor;
typedef struct Fts5Sorter Fts5Sorter;
typedef struct Fts5Table Fts5Table;
typedef struct Fts5TokenizerModule Fts5TokenizerModule;
/*
+10 -8
View File
@@ -495,12 +495,12 @@ static void jsonReturn(
}
if( v==0 ) break;
if( v<=0x7f ){
zOut[j++] = v;
zOut[j++] = (char)v;
}else if( v<=0x7ff ){
zOut[j++] = 0xc0 | (v>>6);
zOut[j++] = (char)(0xc0 | (v>>6));
zOut[j++] = 0x80 | (v&0x3f);
}else{
zOut[j++] = 0xe0 | (v>>12);
zOut[j++] = (char)(0xe0 | (v>>12));
zOut[j++] = 0x80 | ((v>>6)&0x3f);
zOut[j++] = 0x80 | (v&0x3f);
}
@@ -1053,6 +1053,7 @@ static void jsonTest1Func(
int argc,
sqlite3_value **argv
){
UNUSED_PARAM(argc);
sqlite3_result_int(ctx, sqlite3_value_subtype(argv[0])==JSON_SUBTYPE);
}
#endif /* SQLITE_DEBUG */
@@ -1274,8 +1275,8 @@ static void jsonReplaceFunc(
pNode = jsonLookup(&x, zPath, 0, ctx);
if( x.nErr ) goto replace_err;
if( pNode ){
pNode->jnFlags |= JNODE_REPLACE;
pNode->iVal = i+1;
pNode->jnFlags |= (u8)JNODE_REPLACE;
pNode->iVal = (u8)(i+1);
}
}
if( x.aNode[0].jnFlags & JNODE_REPLACE ){
@@ -1329,8 +1330,8 @@ static void jsonSetFunc(
}else if( x.nErr ){
goto jsonSetDone;
}else if( pNode && (bApnd || bIsSet) ){
pNode->jnFlags |= JNODE_REPLACE;
pNode->iVal = i+1;
pNode->jnFlags |= (u8)JNODE_REPLACE;
pNode->iVal = (u8)(i+1);
}
}
if( x.aNode[0].jnFlags & JNODE_REPLACE ){
@@ -1388,6 +1389,7 @@ static void jsonValidFunc(
JsonParse x; /* The parse */
int rc = 0;
UNUSED_PARAM(argc);
if( jsonParse(&x, 0, (const char*)sqlite3_value_text(argv[0]))==0
&& x.nNode>0
){
@@ -1734,7 +1736,7 @@ static int jsonEachFilter(
){
JsonEachCursor *p = (JsonEachCursor*)cur;
const char *z;
const char *zRoot;
const char *zRoot = 0;
sqlite3_int64 n;
UNUSED_PARAM(idxStr);
+22 -22
View File
@@ -1,5 +1,5 @@
C Fix\scomments.
D 2015-09-12T04:22:01.762
C Merge\supdates\sfrom\strunk.
D 2015-09-12T16:59:38.586
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in f85066ce844a28b671aaeeff320921cd0ce36239
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -106,14 +106,14 @@ F ext/fts3/unicode/mkunicode.tcl 95cf7ec186e48d4985e433ff8a1c89090a774252
F ext/fts3/unicode/parseunicode.tcl da577d1384810fb4e2b209bf3313074353193e95
F ext/fts5/extract_api_docs.tcl a36e54ec777172ddd3f9a88daf593b00848368e0
F ext/fts5/fts5.h f04659e0df5af83731b102189a32280f74f4a6bc
F ext/fts5/fts5Int.h 81ba5e474979b166a52a8be306aa3b09d43a10e9
F ext/fts5/fts5Int.h 666aba8432940a8449a3bd4636e898fe906ed95d
F ext/fts5/fts5_aux.c 7a307760a9c57c750d043188ec0bad59f5b5ec7e
F ext/fts5/fts5_buffer.c 64dcaf36a3ebda9e84b7c3b8788887ec325e12a4
F ext/fts5/fts5_config.c 57ee5fe71578cb494574fc0e6e51acb9a22a8695
F ext/fts5/fts5_expr.c a7726fe7045eec7caca8a074af747c8ea3545b83
F ext/fts5/fts5_expr.c 667faaf14a69a5683ac383acdc8d942cf32c3f93
F ext/fts5/fts5_hash.c 4bf4b99708848357b8a2b5819e509eb6d3df9246
F ext/fts5/fts5_index.c 093e2e5936dab536cbe3e321bf4b53dda2b40547
F ext/fts5/fts5_main.c 4b04c934084ea24a858438a04b5be8af3a9e0311
F ext/fts5/fts5_index.c 62a682a70ea2e84fa67c7786ead892b201116ad1
F ext/fts5/fts5_main.c 3fa906f6c0177caf8f82862bc70f37b28bb3305c
F ext/fts5/fts5_storage.c 120f7b143688b5b7710dacbd48cff211609b8059
F ext/fts5/fts5_tcl.c 6da58d6e8f42a93c4486b5ba9b187a7f995dee37
F ext/fts5/fts5_test_mi.c e96be827aa8f571031e65e481251dc1981d608bf
@@ -195,7 +195,7 @@ F ext/misc/eval.c f971962e92ebb8b0a4e6b62949463ee454d88fa2
F ext/misc/fileio.c d4171c815d6543a9edef8308aab2951413cd8d0f
F ext/misc/fuzzer.c 4c84635c71c26cfa7c2e5848cf49fe2d2cfcd767
F ext/misc/ieee754.c b0362167289170627659e84173f5d2e8fee8566e
F ext/misc/json1.c 96490b8e34299a416ab221f827e0369344d95c53
F ext/misc/json1.c f35d00fbd79a7e23af18d7630a2fcf22dce3692b
F ext/misc/nextchar.c 35c8b8baacb96d92abbb34a83a997b797075b342
F ext/misc/percentile.c bcbee3c061b884eccb80e21651daaae8e1e43c63
F ext/misc/regexp.c af92cdaa5058fcec1451e49becc7ba44dba023dc
@@ -583,20 +583,20 @@ F test/e_blobclose.test df756753f571bc30e42e3a6cba2807576e49e716
F test/e_blobopen.test 234f960d90235a9b51ec3ca1e062e8541dd558d8
F test/e_blobwrite.test 615b405f29feb2cfb5a1f03dab7933258294fa26
F test/e_changes.test fd66105385153dbf21fdb35eb8ef6c3e1eade579
F test/e_createtable.test c7e67b49e6cf92473c8fb30ab26143e9e2128cf7
F test/e_delete.test d5186e2f5478b659f16a2c8b66c09892823e542a
F test/e_createtable.test d4c6059d44dcd4b636de9aae322766062b471844
F test/e_delete.test ab39084f26ae1f033c940b70ebdbbd523dc4962e
F test/e_droptrigger.test 3cd080807622c13e5bbb61fc9a57bd7754da2412
F test/e_dropview.test 0c9f7f60989164a70a67a9d9c26d1083bc808306
F test/e_expr.test 8f5fdd7261e2d746813b0c6a1c0e34824ad3c5ad
F test/e_expr.test 03a84a6fa9bd3472112d6bd4599f5269f5f74803
F test/e_fkey.test a1783fe1f759e1990e6a11adfcf0702dac4d0707
F test/e_fts3.test 5c02288842e4f941896fd44afdef564dd5fc1459
F test/e_insert.test 0e63edc037afe738bb81a626a676811ed7862c90
F test/e_reindex.test 57d439f6c644befc8274ac93cf2f5449cf2736c1
F test/e_resolve.test dcce9308fb13b934ce29591105d031d3e14fbba6
F test/e_insert.test 3de217e95094d3d165992a6de1164bbc4bd92dc7
F test/e_reindex.test 2bebf7b393e519198b7c654407221cf171a439b8
F test/e_resolve.test a61751c368b109db73df0f20fc75fb47e166b1d8
F test/e_select.test 52692ff3849541e828ad4661fe3773a9b8711763
F test/e_select2.test aceb80ab927d46fba5ce7586ebabf23e2bb0604f
F test/e_totalchanges.test b12ee5809d3e63aeb83238dd501a7bca7fd72c10
F test/e_update.test 312cb8f5ccfe41515a6bb092f8ea562a9bd54d52
F test/e_update.test f46c2554d915c9197548681e8d8c33a267e84528
F test/e_uri.test 5ae33760fb2039c61aa2d90886f1664664173585
F test/e_vacuum.test 5bfbdc21b65c0abf24398d0ba31dc88d93ca77a9
F test/e_wal.test ae9a593207a77d711443ee69ffe081fda9243625
@@ -624,7 +624,7 @@ F test/fkey1.test de5b287f6a480b36bd51e8debcf48168e26e4ed2
F test/fkey2.test f3d27ecba480a348c328965d154214719bb158a9
F test/fkey3.test 76d475c80b84ee7a5d062e56ccb6ea68882e2b49
F test/fkey4.test 86446017011273aad8f9a99c1a65019e7bd9ca9d
F test/fkey5.test 56bcb5a6e8b725b17febc267fb041a6695e86853
F test/fkey5.test 5a373303f201ac03c22ba1ef17a733d3f56e611a
F test/fkey6.test abb59f866c1b44926fd02d1fdd217d831fe04f48
F test/fkey7.test 72e915890ee4a005daaf3002cb208e8fe973ac13
F test/fkey8.test 8f08203458321e6c19a263829de4cfc936274ab0
@@ -782,7 +782,7 @@ F test/index4.test ab92e736d5946840236cd61ac3191f91a7856bf6
F test/index5.test 8621491915800ec274609e42e02a97d67e9b13e7
F test/index6.test 7102ec371414c42dfb1d5ca37eb4519aa9edc23a
F test/index7.test 9c6765a74fc3fcde7aebc5b3bd40d98df14a527c
F test/indexedby.test 5f527a78bae74c61b8046ae3037f9dfb0bf0c353
F test/indexedby.test 69d2292dfdabe85aa7c5df577c71bb4325607ec2
F test/indexexpr1.test 4feec154aadacb033b41acc1760a18edc4c60470
F test/indexfault.test 31d4ab9a7d2f6e9616933eb079722362a883eb1d
F test/init.test 15c823093fdabbf7b531fe22cf037134d09587a7
@@ -815,7 +815,7 @@ F test/jrnlmode.test 7864d59cf7f6e552b9b99ba0f38acd167edc10fa
F test/jrnlmode2.test 81610545a4e6ed239ea8fa661891893385e23a1d
F test/jrnlmode3.test 556b447a05be0e0963f4311e95ab1632b11c9eaa
F test/json101.test e20d2421c531db32fad59c5e06e80af0b1b002c8
F test/json102.test b5da30aef253102ad63f2186c9319e4b5d505a1b
F test/json102.test 4e1403cb06481ab160cf471c3c139820498e0563
F test/keyword1.test 37ef6bba5d2ed5b07ecdd6810571de2956599dff
F test/lastinsert.test 42e948fd6442f07d60acbd15d33fb86473e0ef63
F test/laststmtchanges.test ae613f53819206b3222771828d024154d51db200
@@ -921,8 +921,8 @@ F test/pcache.test c8acbedd3b6fd0f9a7ca887a83b11d24a007972b
F test/pcache2.test af7f3deb1a819f77a6d0d81534e97d1cf62cd442
F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff
F test/permutations.test ac3b00c299250cc087d4a527b5c75a0f8aef4e54
F test/pragma.test be7195f0aa72bdb8a512133e9640ac40f15b57a2
F test/pragma2.test 8e72df3a16c0fda748ad52abf79cb8256b04a6fe
F test/pragma.test a44253f911e7d50127d4a08f927f47c861a4c772
F test/pragma2.test b5e2ce4c892afceb308c6ae6163a9099b2a0d8d7
F test/pragma3.test 6f849ccffeee7e496d2f2b5e74152306c0b8757c
F test/printf.test b3ff34e73d59124140eaf89f7672e21bc2ca5fcc
F test/printf2.test 0b61566dd1c0f0b802f59dffa228c5dc5aa6b054
@@ -1386,7 +1386,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P 1a97bc81ccfc88f2dd527dff16e9e395718675bc
R 7da2877070c61e4e7804a32fa3d7ad69
P de3fa51e931d34f341fc3432bfdf97390bb68d4e 86781093bdb4c4fdedd228cb1c8961db48a483bb
R cfc16eded5405e1561a759b6078e93d0
U mistachkin
Z 7f1031460ebf4d5a4e025d650694c0fb
Z b4260572fc7350e5188ad004402214d3
+1 -1
View File
@@ -1 +1 @@
de3fa51e931d34f341fc3432bfdf97390bb68d4e
4859778900a99e7e50ce3d56910ad4c5469f2cdb
+7 -8
View File
@@ -373,8 +373,8 @@ do_createtable_tests 1.1.2 {
}
# EVIDENCE-OF: R-10195-31023 If a <database-name> is specified, it
# must be either "main", "temp", or the name of an attached database.
# EVIDENCE-OF: R-18448-33677 If a schema-name is specified, it must be
# either "main", "temp", or the name of an attached database.
#
# EVIDENCE-OF: R-39822-07822 In this case the new table is created in
# the named database.
@@ -422,9 +422,9 @@ do_createtable_tests 1.4 -tclquery {
2 "CREATE TEMPORARY TABLE t2(a, b)" {{} {t1 t2} {} {}}
}
# EVIDENCE-OF: R-49439-47561 It is an error to specify both a
# <database-name> and the TEMP or TEMPORARY keyword, unless the
# <database-name> is "temp".
# EVIDENCE-OF: R-23976-43329 It is an error to specify both a
# schema-name and the TEMP or TEMPORARY keyword, unless the schema-name
# is "temp".
#
drop_all_tables
do_createtable_tests 1.5.1 -error {
@@ -447,9 +447,8 @@ do_createtable_tests 1.5.2 -tclquery {
4 "CREATE TEMPORARY TABLE TEMP.xxx(x)" {{} {t1 t2 t3 xxx} {} {}}
}
# EVIDENCE-OF: R-00917-09393 If no database name is specified and the
# TEMP keyword is not present then the table is created in the main
# database.
# EVIDENCE-OF: R-31997-24564 If no schema name is specified and the TEMP
# keyword is not present then the table is created in the main database.
#
drop_all_tables
do_createtable_tests 1.6 -tclquery {
+8 -5
View File
@@ -70,9 +70,12 @@ do_delete_tests e_delete-1.1 {
2 "DELETE FROM main.t2 ; SELECT * FROM t2" {}
}
# EVIDENCE-OF: R-30203-16177 If a WHERE clause is supplied, then only
# those rows for which the result of evaluating the WHERE clause as a
# boolean expression is true are deleted.
# EVIDENCE-OF: R-26300-50198 If a WHERE clause is supplied, then only
# those rows for which the WHERE clause boolean expression is true are
# deleted.
#
# EVIDENCE-OF: R-23360-48280 Rows for which the expression is false or
# NULL are retained.
#
do_delete_tests e_delete-1.2 {
1 "DELETE FROM t3 WHERE 1 ; SELECT x FROM t3" {}
@@ -117,8 +120,8 @@ do_execsql_test e_delete-2.0 {
# EVIDENCE-OF: R-09681-58560 The table-name specified as part of a
# DELETE statement within a trigger body must be unqualified.
#
# EVIDENCE-OF: R-36771-43788 In other words, the database-name. prefix
# on the table name is not allowed within triggers.
# EVIDENCE-OF: R-12275-20298 In other words, the schema-name. prefix on
# the table name is not allowed within triggers.
#
do_delete_tests e_delete-2.1 -error {
qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers
+4 -4
View File
@@ -1426,16 +1426,16 @@ do_execsql_test e_expr-27.1.2 {
typeof(CAST(4.5 as INTEGER)), CAST(4.5 as INTEGER)
} {text UVU real 1.23 integer 4}
# EVIDENCE-OF: R-27225-65050 If the value of <expr> is NULL, then
# the result of the CAST expression is also NULL.
# EVIDENCE-OF: R-32434-09092 If the value of expr is NULL, then the
# result of the CAST expression is also NULL.
#
do_expr_test e_expr-27.2.1 { CAST(NULL AS integer) } null {}
do_expr_test e_expr-27.2.2 { CAST(NULL AS text) } null {}
do_expr_test e_expr-27.2.3 { CAST(NULL AS blob) } null {}
do_expr_test e_expr-27.2.4 { CAST(NULL AS number) } null {}
# EVIDENCE-OF: R-31076-23575 Casting a value to a <type-name> with
# no affinity causes the value to be converted into a BLOB.
# EVIDENCE-OF: R-43522-35548 Casting a value to a type-name with no
# affinity causes the value to be converted into a BLOB.
#
do_expr_test e_expr-27.3.1 { CAST('abc' AS blob) } blob abc
do_expr_test e_expr-27.3.2 { CAST('def' AS shobblob_x) } blob def
+8 -8
View File
@@ -157,9 +157,9 @@ do_insert_tests e_insert-1.1 {
3b "SELECT count(*) FROM a2" {4}
}
# EVIDENCE-OF: R-53616-44976 If no column-list is specified then the
# number of values inserted into each row must be the same as the number
# of columns in the table.
# EVIDENCE-OF: R-19218-01018 If the column-name list after table-name is
# omitted then the number of values inserted into each row must be the
# same as the number of columns in the table.
#
# A test in the block above verifies that if the VALUES list has the
# correct number of columns (for table a2, 3 columns) works. So these
@@ -191,9 +191,9 @@ do_insert_tests e_insert-1.3 {
3b "SELECT * FROM a2 WHERE oid=last_insert_rowid()" {2 x y}
}
# EVIDENCE-OF: R-09234-17933 If a column-list is specified, then the
# number of values in each term of the VALUE list must match the number
# of specified columns.
# EVIDENCE-OF: R-21115-58321 If a column-name list is specified, then
# the number of values in each term of the VALUE list must match the
# number of specified columns.
#
do_insert_tests e_insert-1.4 -error {
%d values for %d columns
@@ -394,8 +394,8 @@ foreach {tn sql error ac data } {
do_test e_insert-4.1.$tn.3 {sqlite3_get_autocommit db} $ac
}
# EVIDENCE-OF: R-64196-02418 The optional "database-name." prefix on the
# table-name is support for top-level INSERT statements only.
# EVIDENCE-OF: R-59829-49719 The optional "schema-name." prefix on the
# table-name is supported for top-level INSERT statements only.
#
# EVIDENCE-OF: R-05731-00924 The table name must be unqualified for
# INSERT statements that occur within CREATE TRIGGER statements.
+3 -4
View File
@@ -265,10 +265,9 @@ test_index 5.40 t2 collB value
test_index 5.41 aux.t1 collA length
test_index 5.42 aux.t1 collB value
# EVIDENCE-OF: R-15639-02023 If no database-name is specified and there
# exists both a table or index and a collation sequence of the specified
# name, SQLite interprets this as a request to rebuild the indices that
# use the named collation sequence.
# EVIDENCE-OF: R-35892-30289 For a command of the form "REINDEX name", a
# match against collation-name takes precedence over a match against
# index-name or table-name.
#
set_collations value length
do_execsql_test e_reindex-2.6.0 {
+6 -6
View File
@@ -65,9 +65,9 @@ do_execsql_test 1.2 { SELECT * FROM n2 } {main n2}
do_execsql_test 1.3 { SELECT * FROM n3 } {at1 n3}
do_execsql_test 1.4 { SELECT * FROM n4 } {at2 n4}
# EVIDENCE-OF: R-54577-28142 If a database name is specified as part of
# an object reference, it must be either "main", or "temp" or the name
# of an attached database.
# EVIDENCE-OF: R-00634-08585 If a schema name is specified as part of an
# object reference, it must be either "main", or "temp" or the
# schema-name of an attached database.
#
# Or else it is a "no such table: xxx" error.
#
@@ -79,7 +79,7 @@ do_execsql_test 2.1.4 { SELECT * FROM at2.n1 } {at2 n1}
do_catchsql_test 2.2 { SELECT * FROM xxx.n1 } {1 {no such table: xxx.n1}}
# EVIDENCE-OF: R-26223-47623 Like other SQL identifiers, database names
# EVIDENCE-OF: R-17446-42210 Like other SQL identifiers, schema names
# are case-insensitive.
#
resolve_reopen_db
@@ -88,8 +88,8 @@ do_execsql_test 3.2 { SELECT * FROM tEmP.n1 } {temp n1}
do_execsql_test 3.3 { SELECT * FROM aT1.n1 } {at1 n1}
do_execsql_test 3.4 { SELECT * FROM At2.n1 } {at2 n1}
# EVIDENCE-OF: R-15639-28392 If a database name is specified, then only
# the named database is searched for the named object.
# EVIDENCE-OF: R-14755-58619 If a schema name is specified, then only
# that one schema is searched for the named object.
#
do_catchsql_test 4.1 { SELECT * FROM temp.n2 } {1 {no such table: temp.n2}}
do_catchsql_test 4.2 { SELECT * FROM main.n2 } {0 {main n2}}
+8 -8
View File
@@ -146,9 +146,8 @@ do_update_tests e_update-1.2 {
{greek roman greek roman greek roman}
}
# EVIDENCE-OF: R-42117-40023 Otherwise, the UPDATE affects only those
# rows for which the result of evaluating the WHERE clause expression as
# a boolean expression is true.
# EVIDENCE-OF: R-58095-46013 Otherwise, the UPDATE affects only those
# rows for which the WHERE clause boolean expression is true.
#
do_execsql_test e_update-1.3.0 {
DELETE FROM main.t1;
@@ -265,9 +264,10 @@ do_update_tests e_update-1.7 -query {
3 "UPDATE t2 SET a=c||c, c=NULL" {44 5 {} 99 14 {} 55 11 {}}
}
# EVIDENCE-OF: R-12619-24112 The optional conflict-clause allows the
# user to nominate a specific constraint conflict resolution algorithm
# to use during this one UPDATE command.
# EVIDENCE-OF: R-28518-13457 The optional "OR action" conflict clause
# that follows the UPDATE keyword allows the user to nominate a specific
# constraint conflict resolution algorithm to use during this one UPDATE
# command.
#
do_execsql_test e_update-1.8.0 {
DELETE FROM t3;
@@ -322,8 +322,8 @@ foreach {tn sql error ac data } {
# EVIDENCE-OF: R-12123-54095 The table-name specified as part of an
# UPDATE statement within a trigger body must be unqualified.
#
# EVIDENCE-OF: R-09690-36749 In other words, the database-name. prefix
# on the table name of the UPDATE is not allowed within triggers.
# EVIDENCE-OF: R-43190-62442 In other words, the schema-name. prefix on
# the table name of the UPDATE is not allowed within triggers.
#
do_update_tests e_update-2.1 -error {
qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers
+2 -2
View File
@@ -12,8 +12,8 @@
#
# This file tests the PRAGMA foreign_key_check command.
#
# EVIDENCE-OF: R-01427-50262 PRAGMA database.foreign_key_check; PRAGMA
# database.foreign_key_check(table-name);
# EVIDENCE-OF: R-15402-03103 PRAGMA schema.foreign_key_check; PRAGMA
# schema.foreign_key_check(table-name);
#
# EVIDENCE-OF: R-23918-17301 The foreign_key_check pragma checks the
# database, or the table called "table-name", for foreign key
+1 -1
View File
@@ -58,7 +58,7 @@ do_execsql_test indexedby-1.4 {
# SQL view. Also test that specifying an index that does not exist or
# is attached to a different table is detected as an error.
#
# EVIDENCE-OF: R-63761-48810 -- syntax diagram qualified-table-name
# EVIDENCE-OF: R-07004-11522 -- syntax diagram qualified-table-name
#
# EVIDENCE-OF: R-58230-57098 The "INDEXED BY index-name" phrase
# specifies that the named index must be used in order to look up values
+75 -55
View File
@@ -20,145 +20,165 @@ source $testdir/tester.tcl
load_static_extension db json
do_execsql_test json102-100 {
SELECT json_object('ex','[52,3.14159]');
} {{{"ex":"[52,3.14159]"}}}
do_execsql_test json102-110 {
SELECT json_object('ex',json('[52,3.14159]'));
} {{{"ex":[52,3.14159]}}}
do_execsql_test json102-120 {
SELECT json_object('ex',json_array(52,3.14159));
} {{{"ex":[52,3.14159]}}}
do_execsql_test json102-130 {
SELECT json(' { "this" : "is", "a": [ "test" ] } ');
} {{{"this":"is","a":["test"]}}}
do_execsql_test json102-110 {
do_execsql_test json102-140 {
SELECT json_array(1,2,'3',4);
} {{[1,2,"3",4]}}
do_execsql_test json102-120 {
do_execsql_test json102-150 {
SELECT json_array('[1,2]');
} {{["[1,2]"]}}
do_execsql_test json102-130 {
do_execsql_test json102-160 {
SELECT json_array(json_array(1,2));
} {{[[1,2]]}}
do_execsql_test json102-140 {
do_execsql_test json102-170 {
SELECT json_array(1,null,'3','[4,5]','{"six":7.7}');
} {{[1,null,"3","[4,5]","{\"six\":7.7}"]}}
do_execsql_test json102-150 {
do_execsql_test json102-180 {
SELECT json_array(1,null,'3',json('[4,5]'),json('{"six":7.7}'));
} {{[1,null,"3",[4,5],{"six":7.7}]}}
do_execsql_test json102-160 {
do_execsql_test json102-190 {
SELECT json_array_length('[1,2,3,4]');
} {{4}}
do_execsql_test json102-170 {
do_execsql_test json102-200 {
SELECT json_array_length('[1,2,3,4]', '$');
} {{4}}
do_execsql_test json102-210 {
SELECT json_array_length('[1,2,3,4]', '$[2]');
} {{0}}
do_execsql_test json102-220 {
SELECT json_array_length('{"one":[1,2,3]}');
} {{0}}
do_execsql_test json102-180 {
do_execsql_test json102-230 {
SELECT json_array_length('{"one":[1,2,3]}', '$.one');
} {{3}}
do_execsql_test json102-190 {
SELECT json_extract('{"a":2,"c":[4,5,{"f":7}]}', '$');
} {{{"a":2,"c":[4,5,{"f":7}]}}}
do_execsql_test json102-200 {
SELECT json_extract('{"a":2,"c":[4,5,{"f":7}]}', '$.c');
} {{[4,5,{"f":7}]}}
do_execsql_test json102-210 {
SELECT json_extract('{"a":2,"c":[4,5,{"f":7}]}', '$.c[2]');
} {{{"f":7}}}
do_execsql_test json102-220 {
SELECT json_extract('{"a":2,"c":[4,5,{"f":7}]}', '$.c[2].f');
} {{7}}
do_execsql_test json102-230 {
SELECT json_extract('{"a":2,"c":[4,5],"f":7}','$.c','$.a');
} {{[[4,5],2]}}
do_execsql_test json102-240 {
SELECT json_extract('{"a":2,"c":[4,5,{"f":7}]}', '$.x');
SELECT json_array_length('{"one":[1,2,3]}', '$.two');
} {{}}
do_execsql_test json102-250 {
SELECT json_extract('{"a":2,"c":[4,5,{"f":7}]}', '$');
} {{{"a":2,"c":[4,5,{"f":7}]}}}
do_execsql_test json102-260 {
SELECT json_extract('{"a":2,"c":[4,5,{"f":7}]}', '$.c');
} {{[4,5,{"f":7}]}}
do_execsql_test json102-270 {
SELECT json_extract('{"a":2,"c":[4,5,{"f":7}]}', '$.c[2]');
} {{{"f":7}}}
do_execsql_test json102-280 {
SELECT json_extract('{"a":2,"c":[4,5,{"f":7}]}', '$.c[2].f');
} {{7}}
do_execsql_test json102-290 {
SELECT json_extract('{"a":2,"c":[4,5],"f":7}','$.c','$.a');
} {{[[4,5],2]}}
do_execsql_test json102-300 {
SELECT json_extract('{"a":2,"c":[4,5,{"f":7}]}', '$.x');
} {{}}
do_execsql_test json102-310 {
SELECT json_extract('{"a":2,"c":[4,5,{"f":7}]}', '$.x', '$.a');
} {{[null,2]}}
do_execsql_test json102-320 {
SELECT json_insert('{"a":2,"c":4}', '$.a', 99);
} {{{"a":2,"c":4}}}
do_execsql_test json102-260 {
do_execsql_test json102-330 {
SELECT json_insert('{"a":2,"c":4}', '$.e', 99);
} {{{"a":2,"c":4,"e":99}}}
do_execsql_test json102-270 {
do_execsql_test json102-340 {
SELECT json_replace('{"a":2,"c":4}', '$.a', 99);
} {{{"a":99,"c":4}}}
do_execsql_test json102-280 {
do_execsql_test json102-350 {
SELECT json_replace('{"a":2,"c":4}', '$.e', 99);
} {{{"a":2,"c":4}}}
do_execsql_test json102-290 {
do_execsql_test json102-360 {
SELECT json_set('{"a":2,"c":4}', '$.a', 99);
} {{{"a":99,"c":4}}}
do_execsql_test json102-300 {
do_execsql_test json102-370 {
SELECT json_set('{"a":2,"c":4}', '$.e', 99);
} {{{"a":2,"c":4,"e":99}}}
do_execsql_test json102-310 {
do_execsql_test json102-380 {
SELECT json_set('{"a":2,"c":4}', '$.c', '[97,96]');
} {{{"a":2,"c":"[97,96]"}}}
do_execsql_test json102-320 {
do_execsql_test json102-390 {
SELECT json_set('{"a":2,"c":4}', '$.c', json('[97,96]'));
} {{{"a":2,"c":[97,96]}}}
do_execsql_test json102-330 {
do_execsql_test json102-400 {
SELECT json_set('{"a":2,"c":4}', '$.c', json_array(97,96));
} {{{"a":2,"c":[97,96]}}}
do_execsql_test json102-340 {
do_execsql_test json102-410 {
SELECT json_object('a',2,'c',4);
} {{{"a":2,"c":4}}}
do_execsql_test json102-350 {
do_execsql_test json102-420 {
SELECT json_object('a',2,'c','{e:5}');
} {{{"a":2,"c":"{e:5}"}}}
do_execsql_test json102-360 {
do_execsql_test json102-430 {
SELECT json_object('a',2,'c',json_object('e',5));
} {{{"a":2,"c":{"e":5}}}}
do_execsql_test json102-370 {
do_execsql_test json102-440 {
SELECT json_remove('[0,1,2,3,4]','$[2]');
} {{[0,1,3,4]}}
do_execsql_test json102-380 {
do_execsql_test json102-450 {
SELECT json_remove('[0,1,2,3,4]','$[2]','$[0]');
} {{[1,3,4]}}
do_execsql_test json102-390 {
do_execsql_test json102-460 {
SELECT json_remove('[0,1,2,3,4]','$[0]','$[2]');
} {{[1,2,4]}}
do_execsql_test json102-400 {
do_execsql_test json102-470 {
SELECT json_remove('{"x":25,"y":42}');
} {{{"x":25,"y":42}}}
do_execsql_test json102-410 {
do_execsql_test json102-480 {
SELECT json_remove('{"x":25,"y":42}','$.z');
} {{{"x":25,"y":42}}}
do_execsql_test json102-420 {
do_execsql_test json102-490 {
SELECT json_remove('{"x":25,"y":42}','$.y');
} {{{"x":25}}}
do_execsql_test json102-430 {
do_execsql_test json102-500 {
SELECT json_remove('{"x":25,"y":42}','$');
} {{}}
do_execsql_test json102-440 {
do_execsql_test json102-510 {
SELECT json_type('{"a":[2,3.5,true,false,null,"x"]}');
} {{object}}
do_execsql_test json102-450 {
do_execsql_test json102-520 {
SELECT json_type('{"a":[2,3.5,true,false,null,"x"]}','$');
} {{object}}
do_execsql_test json102-460 {
do_execsql_test json102-530 {
SELECT json_type('{"a":[2,3.5,true,false,null,"x"]}','$.a');
} {{array}}
do_execsql_test json102-470 {
do_execsql_test json102-540 {
SELECT json_type('{"a":[2,3.5,true,false,null,"x"]}','$.a[0]');
} {{integer}}
do_execsql_test json102-480 {
do_execsql_test json102-550 {
SELECT json_type('{"a":[2,3.5,true,false,null,"x"]}','$.a[1]');
} {{real}}
do_execsql_test json102-490 {
do_execsql_test json102-560 {
SELECT json_type('{"a":[2,3.5,true,false,null,"x"]}','$.a[2]');
} {{true}}
do_execsql_test json102-500 {
do_execsql_test json102-570 {
SELECT json_type('{"a":[2,3.5,true,false,null,"x"]}','$.a[3]');
} {{false}}
do_execsql_test json102-510 {
do_execsql_test json102-580 {
SELECT json_type('{"a":[2,3.5,true,false,null,"x"]}','$.a[4]');
} {{null}}
do_execsql_test json102-520 {
do_execsql_test json102-590 {
SELECT json_type('{"a":[2,3.5,true,false,null,"x"]}','$.a[5]');
} {{text}}
do_execsql_test json102-530 {
do_execsql_test json102-600 {
SELECT json_type('{"a":[2,3.5,true,false,null,"x"]}','$.a[6]');
} {{}}
do_execsql_test json102-540 {
do_execsql_test json102-610 {
SELECT json_valid(char(123)||'"x":35'||char(125));
} {{1}}
do_execsql_test json102-550 {
do_execsql_test json102-620 {
SELECT json_valid(char(123)||'"x":35');
} {{0}}
ifcapable vtab {
do_execsql_test json102-1000 {
CREATE TABLE user(name,phone);
+13 -14
View File
@@ -83,8 +83,8 @@ delete_file test.db test.db-journal
delete_file test3.db test3.db-journal
sqlite3 db test.db; set DB [sqlite3_connection_pointer db]
# EVIDENCE-OF: R-24197-42751 PRAGMA database.cache_size; PRAGMA
# database.cache_size = pages; PRAGMA database.cache_size = -kibibytes;
# EVIDENCE-OF: R-13861-56665 PRAGMA schema.cache_size; PRAGMA
# schema.cache_size = pages; PRAGMA schema.cache_size = -kibibytes;
# Query or change the suggested maximum number of database disk pages
# that SQLite will hold in memory at once per open database file.
#
@@ -697,8 +697,8 @@ do_test pragma-6.5.1b {
} {0 0 a 1 1 b 2 -1 {}}
# EVIDENCE-OF: R-62725-03366 PRAGMA database.index_info(index-name);
# This pragma returns one row for each key column in the named index.
# EVIDENCE-OF: R-29448-60346 PRAGMA schema.index_info(index-name); This
# pragma returns one row for each key column in the named index.
#
# (The first column of output from PRAGMA index_info is...)
# EVIDENCE-OF: R-34186-52914 The rank of the column within the index. (0
@@ -784,9 +784,9 @@ do_test pragma-6.8 {
# Miscellaneous tests
#
ifcapable schema_pragmas {
# EVIDENCE-OF: R-63500-32024 PRAGMA database.index_list(table-name);
# This pragma returns one row for each index associated with the given
# table.
# EVIDENCE-OF: R-64103-17776 PRAGMA schema.index_list(table-name); This
# pragma returns one row for each index associated with the given table.
#
do_test pragma-7.1.1 {
# Make sure a pragma knows to read the schema if it needs to
db close
@@ -1379,8 +1379,8 @@ ifcapable pager_pragmas {
forcedelete test.db
sqlite3 db test.db
# EVIDENCE-OF: R-13905-26312 PRAGMA database.page_count; Return the
# total number of pages in the database file.
# EVIDENCE-OF: R-15672-33611 PRAGMA schema.page_count; Return the total
# number of pages in the database file.
#
do_test pragma-14.1 {
execsql { pragma auto_vacuum = 0 }
@@ -1817,8 +1817,8 @@ do_test 23.2a {
db2 eval {SELECT cid, name, '|' FROM out ORDER BY seqno}
} {2 c | 3 d | 1 b |}
# EVIDENCE-OF: R-44874-46325 PRAGMA database.index_xinfo(index-name);
# This pragma returns information about every column in an index.
# EVIDENCE-OF: R-56143-29319 PRAGMA schema.index_xinfo(index-name); This
# pragma returns information about every column in an index.
#
# EVIDENCE-OF: R-45970-35618 Unlike this index_info pragma, this pragma
# returns information about every column in the index, not just the key
@@ -1861,9 +1861,8 @@ do_test 23.2d {
db2 eval {PRAGMA index_xinfo(i2x)}
} {0 3 d 0 nocase 1 1 2 c 1 BINARY 1 2 -1 {} 0 BINARY 0}
# EVIDENCE-OF: R-63500-32024 PRAGMA database.index_list(table-name);
# This pragma returns one row for each index associated with the given
# table.
# EVIDENCE-OF: R-64103-17776 PRAGMA schema.index_list(table-name); This
# pragma returns one row for each index associated with the given table.
#
# (The first column of output from PRAGMA index_list is...)
# EVIDENCE-OF: R-02753-24748 A sequence number assigned to each index
+1 -1
View File
@@ -42,7 +42,7 @@ sqlite3 db test.db; set DB [sqlite3_connection_pointer db]
db eval {PRAGMA auto_vacuum=0}
# EVIDENCE-OF: R-17887-14874 PRAGMA database.freelist_count; Return the
# EVIDENCE-OF: R-11211-21323 PRAGMA schema.freelist_count; Return the
# number of unused pages in the database file.
#
do_test pragma2-1.1 {