rc = SQLITE_CORRUPT;
}
pCsr->isEof = 1;
- if( pContext && rc!=SQLITE_OK ){
+ if( pContext ){
sqlite3_result_error_code(pContext, rc);
}
return rc;
int nSegment = 0; /* Size of apSegment array */
int nAlloc = 16; /* Allocated size of segment array */
int rc; /* Return code */
- sqlite3_stmt *pStmt; /* SQL statement to scan %_segdir table */
+ sqlite3_stmt *pStmt = 0; /* SQL statement to scan %_segdir table */
int iAge = 0; /* Used to assign ages to segments */
apSegment = (Fts3SegReader **)sqlite3_malloc(sizeof(Fts3SegReader*)*nAlloc);
if( !apSegment ) return SQLITE_NOMEM;
rc = sqlite3Fts3SegReaderPending(p, zTerm, nTerm, isPrefix, &apSegment[0]);
- if( rc!=SQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) goto finished;
if( apSegment[0] ){
nSegment = 1;
}
case 3: zEnd = (const char*)sqlite3_value_text(apVal[2]);
case 2: zStart = (const char*)sqlite3_value_text(apVal[1]);
}
- if( !zStart || !zEnd || !zEllipsis ){
+ if( !zEllipsis || !zEnd || !zStart ){
sqlite3_result_error_nomem(pContext);
}else if( SQLITE_OK==fts3CursorSeek(pContext, pCsr) ){
sqlite3Fts3Snippet(pContext, pCsr, zStart, zEnd, zEllipsis);
-C Further\sfts3\scoverage\stests.
-D 2009-12-12T16:04:32
+C Tests\sto\scover\sa\sfew\sextra\sbranches\sin\sfts3.c.
+D 2009-12-12T19:15:28
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in c5827ead754ab32b9585487177c93bb00b9497b3
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a
F ext/fts3/README.tokenizers 998756696647400de63d5ba60e9655036cb966e9
F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
-F ext/fts3/fts3.c e1828210a55b4b27df2b1f6fa78b1fb12058f56e
+F ext/fts3/fts3.c ea601b21f6bcaab4035804993328a9f0231ec6cb
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
F ext/fts3/fts3Int.h 6fdd41b4f296e5bcc908444dc591397995d4ff5d
F ext/fts3/fts3_expr.c fcf6812dbfd9cb9a2cabaf50e741411794f83e7e
F test/fts3atoken.test 25c2070e1e8755d414bf9c8200427b277a9f99fa
F test/fts3b.test e93bbb653e52afde110ad53bbd793f14fe7a8984
F test/fts3c.test fc723a9cf10b397fdfc2b32e73c53c8b1ec02958
-F test/fts3cov.test f2d27d29628941e4814473345603b20421b93c78
+F test/fts3cov.test 3a9d8618a3107166530c447e808f8992372e0415
F test/fts3d.test 95fb3c862cbc4297c93fceb9a635543744e9ef52
F test/fts3e.test 1f6c6ac9cc8b772ca256e6b22aaeed50c9350851
F test/fts3expr.test 05dab77387801e4900009917bb18f556037d82da
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 68cccd62b71f7b55bf7f2f56dc8507cbe80229ba
-R 24dafc1291b25c037b068505da647d63
+P d2a8c0f683271f5fb8c9badfb13e4e46fd78db71
+R 2bf0117c3db56e5351a8a9dca36e7a01
U dan
-Z f50ab64261ebba22ef3131cb9e897960
+Z cff0315b4b1d4f7a0aab7cdae117a3f0
-d2a8c0f683271f5fb8c9badfb13e4e46fd78db71
\ No newline at end of file
+06b72b007393dc34d75a8bb16ce0e4507d5f8faa
\ No newline at end of file
execsql { SELECT * FROM xx WHERE xx MATCH 'two' }
} {}
-finish_test
+do_malloc_test fts3cov-12 -sqlprep {
+ CREATE VIRTUAL TABLE t12 USING fts3;
+ INSERT INTO t12 VALUES('is one of the two togther');
+ BEGIN;
+ INSERT INTO t12 VALUES('one which was appropriate at the time');
+} -sqlbody {
+ SELECT * FROM t12 WHERE t12 MATCH 'one'
+}
+
+do_malloc_test fts3cov-13 -sqlprep {
+ PRAGMA encoding = 'UTF-16';
+ CREATE VIRTUAL TABLE t13 USING fts3;
+ INSERT INTO t13 VALUES('two scalar functions');
+ INSERT INTO t13 VALUES('scalar two functions');
+ INSERT INTO t13 VALUES('functions scalar two');
+} -sqlbody {
+ SELECT snippet(t13, '%%', '%%', '#') FROM t13 WHERE t13 MATCH 'two';
+ SELECT snippet(t13, '%%', '%%') FROM t13 WHERE t13 MATCH 'two';
+ SELECT snippet(t13, '%%') FROM t13 WHERE t13 MATCH 'two';
+}
+
+finish_test