Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c25cfcfa37 |
+1
-1
@@ -3353,7 +3353,7 @@ static int fts3ColumnMethod(
|
||||
switch( iCol-p->nColumn ){
|
||||
case 0:
|
||||
/* The special 'table-name' column */
|
||||
sqlite3_result_pointer(pCtx, pCsr, "fts3cursor", 0);
|
||||
sqlite3_result_pointer(pCtx, pCsr, "fts3cursor");
|
||||
break;
|
||||
|
||||
case 1:
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ static int SQLITE_TCLAPI f5tDbAndApi(
|
||||
Tcl_AppendResult(interp, "error: ", sqlite3_errmsg(db), 0);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
sqlite3_bind_pointer(pStmt, 1, (void*)&pApi, "fts5_api_ptr", 0);
|
||||
sqlite3_bind_pointer(pStmt, 1, (void*)&pApi, "fts5_api_ptr");
|
||||
sqlite3_step(pStmt);
|
||||
|
||||
if( sqlite3_finalize(pStmt)!=SQLITE_OK ){
|
||||
|
||||
@@ -75,7 +75,7 @@ static int fts5_api_from_db(sqlite3 *db, fts5_api **ppApi){
|
||||
*ppApi = 0;
|
||||
rc = sqlite3_prepare(db, "SELECT fts5(?1)", -1, &pStmt, 0);
|
||||
if( rc==SQLITE_OK ){
|
||||
sqlite3_bind_pointer(pStmt, 1, (void*)ppApi, "fts5_api_ptr", 0);
|
||||
sqlite3_bind_pointer(pStmt, 1, (void*)ppApi, "fts5_api_ptr");
|
||||
(void)sqlite3_step(pStmt);
|
||||
rc = sqlite3_finalize(pStmt);
|
||||
}
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@
|
||||
**
|
||||
** static int aX[] = { 53, 9, 17, 2231, 4, 99 };
|
||||
** int i = sqlite3_bind_parameter_index(pStmt, "$ptr");
|
||||
** sqlite3_bind_value(pStmt, i, aX, "carray", 0);
|
||||
** sqlite3_bind_value(pStmt, i, aX, "carray");
|
||||
**
|
||||
** There is an optional third parameter to determine the datatype of
|
||||
** the C-language array. Allowed values of the third parameter are
|
||||
@@ -377,7 +377,7 @@ static void inttoptrFunc(
|
||||
int i32 = i64 & 0xffffffff;
|
||||
memcpy(&p, &i32, sizeof(p));
|
||||
}
|
||||
sqlite3_result_pointer(context, p, "carray", 0);
|
||||
sqlite3_result_pointer(context, p, "carray");
|
||||
}
|
||||
#endif /* SQLITE_TEST */
|
||||
|
||||
|
||||
+33
-9
@@ -339,6 +339,14 @@ struct RtreeGeomCallback {
|
||||
void *pContext;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
** Value for the first field of every RtreeMatchArg object. The MATCH
|
||||
** operator tests that the first field of a blob operand matches this
|
||||
** value to avoid operating on invalid blobs (which could cause a segfault).
|
||||
*/
|
||||
#define RTREE_GEOMETRY_MAGIC 0x891245AB
|
||||
|
||||
/*
|
||||
** An instance of this structure (in the form of a BLOB) is returned by
|
||||
** the SQL functions that sqlite3_rtree_geometry_callback() and
|
||||
@@ -346,7 +354,7 @@ struct RtreeGeomCallback {
|
||||
** operand to the MATCH operator of an R-Tree.
|
||||
*/
|
||||
struct RtreeMatchArg {
|
||||
u32 iSize; /* Size of this object */
|
||||
u32 magic; /* Always RTREE_GEOMETRY_MAGIC */
|
||||
RtreeGeomCallback cb; /* Info about the callback functions */
|
||||
int nParam; /* Number of parameters to the SQL function */
|
||||
sqlite3_value **apSqlParam; /* Original SQL parameter values */
|
||||
@@ -1641,17 +1649,33 @@ static int findLeafNode(
|
||||
** operator.
|
||||
*/
|
||||
static int deserializeGeometry(sqlite3_value *pValue, RtreeConstraint *pCons){
|
||||
RtreeMatchArg *pBlob, *pSrc; /* BLOB returned by geometry function */
|
||||
RtreeMatchArg *pBlob; /* BLOB returned by geometry function */
|
||||
sqlite3_rtree_query_info *pInfo; /* Callback information */
|
||||
int nBlob; /* Size of the geometry function blob */
|
||||
int nExpected; /* Expected size of the BLOB */
|
||||
|
||||
pSrc = sqlite3_value_pointer(pValue, "RtreeMatchArg");
|
||||
if( pSrc==0 ) return SQLITE_ERROR;
|
||||
pInfo = (sqlite3_rtree_query_info*)
|
||||
sqlite3_malloc64( sizeof(*pInfo)+pSrc->iSize );
|
||||
/* Check that value is actually a blob. */
|
||||
if( sqlite3_value_type(pValue)!=SQLITE_BLOB ) return SQLITE_ERROR;
|
||||
|
||||
/* Check that the blob is roughly the right size. */
|
||||
nBlob = sqlite3_value_bytes(pValue);
|
||||
if( nBlob<(int)sizeof(RtreeMatchArg) ){
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
|
||||
pInfo = (sqlite3_rtree_query_info*)sqlite3_malloc( sizeof(*pInfo)+nBlob );
|
||||
if( !pInfo ) return SQLITE_NOMEM;
|
||||
memset(pInfo, 0, sizeof(*pInfo));
|
||||
pBlob = (RtreeMatchArg*)&pInfo[1];
|
||||
memcpy(pBlob, pSrc, pSrc->iSize);
|
||||
|
||||
memcpy(pBlob, sqlite3_value_blob(pValue), nBlob);
|
||||
nExpected = (int)(sizeof(RtreeMatchArg) +
|
||||
pBlob->nParam*sizeof(sqlite3_value*) +
|
||||
(pBlob->nParam-1)*sizeof(RtreeDValue));
|
||||
if( pBlob->magic!=RTREE_GEOMETRY_MAGIC || nBlob!=nExpected ){
|
||||
sqlite3_free(pInfo);
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
pInfo->pContext = pBlob->cb.pContext;
|
||||
pInfo->nParam = pBlob->nParam;
|
||||
pInfo->aParam = pBlob->aParam;
|
||||
@@ -3689,7 +3713,7 @@ static void geomCallback(sqlite3_context *ctx, int nArg, sqlite3_value **aArg){
|
||||
sqlite3_result_error_nomem(ctx);
|
||||
}else{
|
||||
int i;
|
||||
pBlob->iSize = nBlob;
|
||||
pBlob->magic = RTREE_GEOMETRY_MAGIC;
|
||||
pBlob->cb = pGeomCtx[0];
|
||||
pBlob->apSqlParam = (sqlite3_value**)&pBlob->aParam[nArg];
|
||||
pBlob->nParam = nArg;
|
||||
@@ -3706,7 +3730,7 @@ static void geomCallback(sqlite3_context *ctx, int nArg, sqlite3_value **aArg){
|
||||
sqlite3_result_error_nomem(ctx);
|
||||
rtreeMatchArgFree(pBlob);
|
||||
}else{
|
||||
sqlite3_result_pointer(ctx, pBlob, "RtreeMatchArg", rtreeMatchArgFree);
|
||||
sqlite3_result_blob(ctx, pBlob, nBlob, rtreeMatchArgFree);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
C In\ssqlite3_bind_pointer(),\sinvoke\sthe\sdestructor\sif\sthe\sbind\sindex\sis\nout\sof\srange,\slike\ssqlite3_bind_blob()\sdoes.
|
||||
D 2017-07-27T16:42:36.805
|
||||
C Experimental\sAPI\ssqlite3_stmt_refresh()\sto\sforce\sa\sprepared\sstatement\sto\nrecompile\sif\sit\sneeds\sto\sdue\sto\sa\sschema\schange\sor\sother\sfactor.
|
||||
D 2017-07-20T16:55:51.434
|
||||
F Makefile.in d9873c9925917cca9990ee24be17eb9613a668012c85a343aef7e5536ae266e8
|
||||
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
|
||||
F Makefile.msc 02b469e9dcd5b7ee63fc1fb05babc174260ee4cfa4e0ef2e48c3c6801567a016
|
||||
@@ -70,7 +70,7 @@ F ext/fts3/README.content fdc666a70d5257a64fee209f97cf89e0e6e32b51
|
||||
F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a
|
||||
F ext/fts3/README.tokenizers e0a8b81383ea60d0334d274fadf305ea14a8c314
|
||||
F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
|
||||
F ext/fts3/fts3.c f1c58503bc81c3dab1a70b25e146878ae40fccc716fd7c9b817995b661bc896f
|
||||
F ext/fts3/fts3.c dfda8bb464d229785e0528fcf7017b4f8e95656d40d28333dfc3f3363bbe229e
|
||||
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
|
||||
F ext/fts3/fts3Int.h eb2502000148e80913b965db3e59f29251266d0a
|
||||
F ext/fts3/fts3_aux.c 9edc3655fcb287f0467d0a4b886a01c6185fe9f1
|
||||
@@ -108,8 +108,8 @@ F ext/fts5/fts5_hash.c 32be400cf761868c9db33efe81a06eb19a17c5402ad477ee9efb51301
|
||||
F ext/fts5/fts5_index.c 2ce9d50ec5508b8205615aad69e1c9b2c77f017f21d4479e1fb2079c01fdd017
|
||||
F ext/fts5/fts5_main.c 24868f88ab2a865defbba7a92eebeb726cc991eb092b71b5f5508f180c72605b
|
||||
F ext/fts5/fts5_storage.c fb5ef3c27073f67ade2e1bea08405f9e43f68f5f3676ed0ab7013bce5ba10be6
|
||||
F ext/fts5/fts5_tcl.c a7df39442ae674dde877cf06fe02ebb7658e69c179a4d223241c90df4f14b54e
|
||||
F ext/fts5/fts5_test_mi.c 65864ba1e5c34a61d409c4c587e0bbe0466eb4f8f478d85dc42a92caad1338e6
|
||||
F ext/fts5/fts5_tcl.c 4fab0eaba3d8a82c36195c9268e68e64c9b7acbd9e6b054e84fcf2ee97672714
|
||||
F ext/fts5/fts5_test_mi.c 03cfc256bb2dfe0d0f9516daea894ea651a7105cd3bdcfbd6c1f4d3145634931
|
||||
F ext/fts5/fts5_test_tok.c ffd657dd67e7fcdb31bf63fb60b6d867299a581d0f46e97086abacd66c2a9b26
|
||||
F ext/fts5/fts5_tokenize.c 2ce7b44183538ec46b7907726262ee43ffdd39a8
|
||||
F ext/fts5/fts5_unicode2.c b450b209b157d598f7b9df9f837afb75a14c24bf
|
||||
@@ -256,7 +256,7 @@ F ext/lsm1/test/lsm1_simple.test 3bb38951450cd1f12a6c294949334d6fbb109a3da38c48e
|
||||
F ext/misc/README.md 8e008c8d2b02e09096b31dfba033253ac27c6c06a18aa5826e299fa7601d90b2
|
||||
F ext/misc/amatch.c 6db4607cb17c54b853a2d7c7c36046d004853f65b9b733e6f019d543d5dfae87
|
||||
F ext/misc/anycollseq.c 5ffdfde9829eeac52219136ad6aa7cd9a4edb3b15f4f2532de52f4a22525eddb
|
||||
F ext/misc/carray.c ed96c218ea940b85c9a274c4d9c59fe9491c299147a38a8bba537687bd6c6005
|
||||
F ext/misc/carray.c 880684b2796ef6ad915094093297eede40db6c07f280c7f491c8eff72ea03ec7
|
||||
F ext/misc/closure.c 0d2a038df8fbae7f19de42e7c7d71f2e4dc88704
|
||||
F ext/misc/completion.c 52c3f01523e3e387eb321b4739a89d1fe47cbe6025aa1f2d8d3685e9e365df0f
|
||||
F ext/misc/compress.c 122faa92d25033d6c3f07c39231de074ab3d2e83
|
||||
@@ -321,7 +321,7 @@ F ext/rbu/sqlite3rbu.c d1438580a451eebda3bfd42ef69b677512f00125285e0e4e789b6131a
|
||||
F ext/rbu/sqlite3rbu.h fc25e1fcd99b5c6d32b1b5b1c73122632e873ac89bd0be9bf646db362b7ce02c
|
||||
F ext/rbu/test_rbu.c ec18cfc69a104309df23c359e3c80306c9a6bdd1d2c53c8b70ae158e9832dcd6
|
||||
F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
|
||||
F ext/rtree/rtree.c 4f1804b80ae06ddf7ff69192aacdceee283646dc6a328acb951f116147445212
|
||||
F ext/rtree/rtree.c c5886d4ba7e7c66d0f9ee0b788d5532f8537ca04db19cec7f2f64dcf46e9be37
|
||||
F ext/rtree/rtree.h 834dbcb82dc85b2481cde6a07cdadfddc99e9b9e
|
||||
F ext/rtree/rtree1.test 4fdd60ae034e43f2fefc26492032d02e742e8b14d468b7c51d95a1e2fa47cf00
|
||||
F ext/rtree/rtree2.test acbb3a4ce0f4fbc2c304d2b4b784cfa161856bba
|
||||
@@ -455,15 +455,15 @@ F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac
|
||||
F src/select.c c6bf96a7f9d7d68f929de84738c599a30d0a725ab0b54420e70545743cd5ee7b
|
||||
F src/shell.c bd6a37cbe8bf64ef6a6a74fdc50f067d3148149b4ce2b4d03154663e66ded55f
|
||||
F src/shell.c.in b5725acacba95ccefa57b6d068f710e29ba8239c3aa704628a1902a1f729c175
|
||||
F src/sqlite.h.in 86a14aab0f03021bdc71e8a78091ca52931cdc3dc69633dacf9a511dfe9ee993
|
||||
F src/sqlite.h.in d100c0942b5a6c20ec5c4a5a0b752be62530f80babd854544d1dbd2f23f91023
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
F src/sqlite3ext.h 0f9f72b86a3792314f5db7a1dfbc2c82376bcd8d0919ceb80637bca126ec3c68
|
||||
F src/sqliteInt.h bd6be75bc43d38ada272ef0b3472bc44ef0cc15536bea22c349ca1a2812a19ce
|
||||
F src/sqlite3ext.h 967154985ed2ae62f90d9029bb5b5071793d847f1696a2ebe9e8cc0b042ae60b
|
||||
F src/sqliteInt.h 96197a18f041b9ab99e6cee0db39dbf771ac7762d9f0f63d9e719285f0478664
|
||||
F src/sqliteLimit.h 1513bfb7b20378aa0041e7022d04acb73525de35b80b252f1b83fedb4de6a76b
|
||||
F src/status.c a9e66593dfb28a9e746cba7153f84d49c1ddc4b1
|
||||
F src/table.c b46ad567748f24a326d9de40e5b9659f96ffff34
|
||||
F src/tclsqlite.c 2c29b0b76e91edfd1b43bf135c32c8674710089197327682b6b7e6af88062c3d
|
||||
F src/test1.c cfb78b728b37ae3a2b14fe1b3a6c766e0da41370eda112594e698c94011b622e
|
||||
F src/test1.c 84f9472ca24c2c2aa2d76256f19db3ce0bb0224c0553db793f0fb2c0969c869e
|
||||
F src/test2.c 3efb99ab7f1fc8d154933e02ae1378bac9637da5
|
||||
F src/test3.c b8434949dfb8aff8dfa082c8b592109e77844c2135ed3c492113839b6956255b
|
||||
F src/test4.c 18ec393bb4d0ad1de729f0b94da7267270f3d8e6
|
||||
@@ -476,7 +476,7 @@ F src/test_async.c 195ab49da082053fdb0f949c114b806a49ca770a
|
||||
F src/test_autoext.c 915d245e736652a219a907909bb6710f0d587871
|
||||
F src/test_backup.c bf5da90c9926df0a4b941f2d92825a01bbe090a0
|
||||
F src/test_bestindex.c d23f80d334c59662af69191854c76b8d3d0c8c96
|
||||
F src/test_blob.c ae4a0620b478548afb67963095a7417cd06a4ec0a56adb453542203bfdcb31ce
|
||||
F src/test_blob.c f65ac717da2618691cf9dad094e6da0219dcd208
|
||||
F src/test_btree.c 8b2dc8b8848cf3a4db93f11578f075e82252a274
|
||||
F src/test_config.c abf6fc1fe9d041b699578c42e3db81f8831c4f5b804f1927958102ee8f2b773e
|
||||
F src/test_delete.c e2fe07646dff6300b48d49b2fee2fe192ed389e834dd635e3b3bac0ce0bf9f8f
|
||||
@@ -520,13 +520,13 @@ F src/update.c c443935c652af9365e033f756550b5032d02e1b06eb2cb890ed7511ae0c051dc
|
||||
F src/utf.c 810fbfebe12359f10bc2a011520a6e10879ab2a163bcb26c74768eab82ea62a5
|
||||
F src/util.c fc081ec6f63448dcd80d3dfad35baecfa104823254a815b081a4d9fe76e1db23
|
||||
F src/vacuum.c 874c0f2f15ab2908748297d587d22d485ea96d55aaec91d4775dddb2e24d2ecf
|
||||
F src/vdbe.c 1e541ec7ff409bbabcc6b4f154957296fff5827c16c2ab0056348acae75685bf
|
||||
F src/vdbe.c 53f3f4d1ee9bd4985cc0b199bdf6a6c5e99c526eb15f100fed59653c79cf8fa6
|
||||
F src/vdbe.h d50cadf12bcf9fb99117ef392ce1ea283aa429270481426b6e8b0280c101fd97
|
||||
F src/vdbeInt.h ff2b7db0968d20e6184aee256d2e535d565f5a172e3588a78adb166a41fc4911
|
||||
F src/vdbeapi.c 0823531191f9d5588a245ed5b39306798681814e9e8099d54a3213a13a28fbe7
|
||||
F src/vdbeaux.c 3fe68bad02b33b09e08bdc0ad90d6b92b3d571f7864c3d047abca1bde050751c
|
||||
F src/vdbeInt.h e202dc9f7b00722a85f609053610d40afa9b6a836a42810b2ef2d2a7b9e099ba
|
||||
F src/vdbeapi.c d83d30e1130c96d5bb1132275275402502b17cd7434065ea93b4cd1eccab8c65
|
||||
F src/vdbeaux.c 42e215cc6f69e91eebdd2b886ec1ff2b0d5e44331bd8b88a0a44e78bbeed7133
|
||||
F src/vdbeblob.c 359891617358deefc85bef7bcf787fa6b77facb9
|
||||
F src/vdbemem.c 9ca2854976f35db40341977e688a08204c96427505f5b90215dc7970f6ea42c4
|
||||
F src/vdbemem.c fe8fce1cdc258320b465934039fe4b1230d63f81d6b81b1eac775b6eec00af0d
|
||||
F src/vdbesort.c f512c68d0bf7e0105316a5594c4329358c8ee9cae3b25138df041d97516c0372
|
||||
F src/vdbetrace.c 41963d5376f0349842b5fc4aaaaacd7d9cdc0834
|
||||
F src/vtab.c 35b9bdc2b41de32a417141d12097bcc4e29a77ed7cdb8f836d1d2305d946b61b
|
||||
@@ -632,7 +632,7 @@ F test/capi2.test 011c16da245fdc0106a2785035de6b242c05e738
|
||||
F test/capi3.test 986e57cea8ab423b3fc8c2e3b69330394252d3d2a4496122ff3749e258305695
|
||||
F test/capi3b.test efb2b9cfd127efa84433cd7a2d72ce0454ae0dc4
|
||||
F test/capi3c.test 7ebed1d8fa2f3190149d556fe8cff5a006be62af437c5c4640db614470126098
|
||||
F test/capi3d.test 485048dc5cd07bc68011e4917ad035ad6047ab82
|
||||
F test/capi3d.test 876b9dda41f003aed30df91f0b8653e576a956ab46efa00eadd35d6920cb94e2
|
||||
F test/capi3e.test 3d49c01ef2a1a55f41d73cba2b23b5059ec460fe
|
||||
F test/cast.test 4c275cbdc8202d6f9c54a3596701719868ac7dc3
|
||||
F test/cffault.test 9d6b20606afe712374952eec4f8fd74b1a8097ef
|
||||
@@ -916,7 +916,7 @@ F test/in3.test 3cbf58c87f4052cee3a58b37b6389777505aa0c0
|
||||
F test/in4.test d2b38cba404bc4320f4fe1b595b3d163f212c068
|
||||
F test/in5.test 7ae37fcd4a5e198291c6ab5f31a5bb3d15397efe8b75a6736d7a95a7b8dd9e08
|
||||
F test/incrblob.test c9b96afc292aeff43d6687bcb09b0280aa599822
|
||||
F test/incrblob2.test a494c9e848560039a23974b9119cfc2cf3ad3bd15cc2694ee6367ae537ef8f1f
|
||||
F test/incrblob2.test a5ce5ed1d0b01e2ed347245a21170372528af0a5
|
||||
F test/incrblob3.test d8d036fde015d4a159cd3cbae9d29003b37227a4
|
||||
F test/incrblob4.test 21a52a6843a56cdcce968c6a86b72a7066d0e6ba
|
||||
F test/incrblob_err.test 69f9247fed50278d48ea710d1a8f9cdb09e4c0b8
|
||||
@@ -936,7 +936,7 @@ F test/index7.test 7feababe16f2091b229c22aff2bcc1d4d6b9d2bb
|
||||
F test/index8.test bc2e3db70e8e62459aaa1bd7e4a9b39664f8f9d7
|
||||
F test/index9.test 0aa3e509dddf81f93380396e40e9bb386904c1054924ba8fa9bcdfe85a8e7721
|
||||
F test/indexedby.test 9c4cd331224e57f79fbf411ae245e6272d415985
|
||||
F test/indexexpr1.test f348668daf7f533f1e5578dd4f31e4b9a3875da1ee2a60a8d2d50b938a7699c9
|
||||
F test/indexexpr1.test f06298de30f343f6a022c3b13ae82817bb52a169f2b23a13600688aa591be5d9
|
||||
F test/indexexpr2.test 3ddd7f23bc381b9f2b7a15f2d083b1a4078e7733dce8295602ecfa3c74a34cf9
|
||||
F test/indexfault.test 31d4ab9a7d2f6e9616933eb079722362a883eb1d
|
||||
F test/init.test 15c823093fdabbf7b531fe22cf037134d09587a7
|
||||
@@ -1433,8 +1433,8 @@ F test/tt3_vacuum.c 1753f45917699c9c1f66b64c717a717c9379f776
|
||||
F test/types.test bf816ce73c7dfcfe26b700c19f97ef4050d194ff
|
||||
F test/types2.test 1aeb81976841a91eef292723649b5c4fe3bc3cac
|
||||
F test/types3.test 99e009491a54f4dc02c06bdbc0c5eea56ae3e25a
|
||||
F test/unionvtab.test 595fb601de00188ca5e7c6dbe266c17a0faf234cf434ce85eccec1a929ef9baf
|
||||
F test/unionvtabfault.test 18f4f878e550ae3c5efa195b1420c78607c0f9810f7a71a49ab6379dfe501f32
|
||||
F test/unionvtab.test 3cb7463d8c6a34ae7c043e53103d63d19465a1488f4587a981ae05e978cc6d26
|
||||
F test/unionvtabfault.test ccb87c510efd0da88d90d813cfaeebe69f2be78cdfbdc3343b04fd9fc507d887
|
||||
F test/unique.test 93f8b2ef5ea51b9495f8d6493429b1fd0f465264
|
||||
F test/unique2.test 3674e9f2a3f1fbbfd4772ac74b7a97090d0f77d2
|
||||
F test/unixexcl.test d936ba2b06794018e136418addd59a2354eeae97
|
||||
@@ -1637,7 +1637,10 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P 601ad6795927fff8c3cc1711a2fd90912499573e94aa5bc8f18cbd4b89778f58
|
||||
R 94d2d6800509c651201392a359c9b77e
|
||||
P a90c062d46c63a1e6f83064b1c5afb26a16e93b6ee8620ca46d169fdb325c488
|
||||
R 25671fe00f59e885629fa15763c01ca2
|
||||
T *branch * sqlite3_stmt_refresh
|
||||
T *sym-sqlite3_stmt_refresh *
|
||||
T -sym-trunk *
|
||||
U drh
|
||||
Z 4d5dc73f23f587970c3fb18e2e41aea7
|
||||
Z 3a35a5d7b215280c71ff1c56378d2e53
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
d6684d2a744e6e04b8796c3b5ecb81c6577728b698c1ab5f4a828b2ac114b8a2
|
||||
10556ee454edf60dd6542fdf9017f713c783b9ca1b86f25f45e3c17ffb184e24
|
||||
+22
-23
@@ -3645,7 +3645,7 @@ int sqlite3_prepare16_v3(
|
||||
sqlite3 *db, /* Database handle */
|
||||
const void *zSql, /* SQL statement, UTF-16 encoded */
|
||||
int nByte, /* Maximum length of zSql in bytes. */
|
||||
unsigned int prepFlags, /* Zero or more SQLITE_PREPARE_ flags */
|
||||
unsigned int prepFalgs, /* Zero or more SQLITE_PREPARE_ flags */
|
||||
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
|
||||
const void **pzTail /* OUT: Pointer to unused portion of zSql */
|
||||
);
|
||||
@@ -3742,6 +3742,17 @@ int sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
|
||||
*/
|
||||
int sqlite3_stmt_busy(sqlite3_stmt*);
|
||||
|
||||
/*
|
||||
** CAPI3REF: Recompile A Prepared Statement If Needed
|
||||
** METHOD: sqlite3_stmt
|
||||
**
|
||||
** ^The sqlite3_stmt_refresh(S) examines the [prepared statement] S
|
||||
** and attempts to recompile it if it has expired, for example due
|
||||
** to a schema change. ^If the prepared statement S is up-to-date and
|
||||
** ready for use, then sqlite3_stmt_refresh(S) is a no-op.
|
||||
*/
|
||||
int sqlite3_stmt_refresh(sqlite3_stmt*);
|
||||
|
||||
/*
|
||||
** CAPI3REF: Dynamically Typed Value Object
|
||||
** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
|
||||
@@ -3883,20 +3894,14 @@ typedef struct sqlite3_context sqlite3_context;
|
||||
** [sqlite3_blob_open | incremental BLOB I/O] routines.
|
||||
** ^A negative value for the zeroblob results in a zero-length BLOB.
|
||||
**
|
||||
** ^The sqlite3_bind_pointer(S,I,P,T,D) routine causes the I-th parameter in
|
||||
** ^The sqlite3_bind_pointer(S,I,P,T) routine causes the I-th parameter in
|
||||
** [prepared statement] S to have an SQL value of NULL, but to also be
|
||||
** associated with the pointer P of type T. ^D is either a NULL pointer or
|
||||
** a pointer to a destructor function that is called when P goes out of scope.
|
||||
** associated with the pointer P of type T.
|
||||
** ^The sqlite3_bind_pointer() routine can be used to pass
|
||||
** host-language pointers into [application-defined SQL functions].
|
||||
** ^A parameter that is initialized using [sqlite3_bind_pointer()] appears
|
||||
** to be an ordinary SQL NULL value to everything other than
|
||||
** [sqlite3_value_pointer()]. The T parameter should be a static string,
|
||||
** preferably a string literal. The procedure that invokes
|
||||
** sqlite3_bind_pointer(S,I,P,T,D) owns the T string and
|
||||
** must guarantee that it remains valid and unchanged until after the last
|
||||
** access via [sqlite3_value_pointer()]. The sqlite3_bind_pointer() routine
|
||||
** is part of the [pointer passing interface] added for SQLite 3.20.0.
|
||||
** [sqlite3_value_pointer()]. The T parameter should be a static string.
|
||||
**
|
||||
** ^If any of the sqlite3_bind_*() routines are called with a NULL pointer
|
||||
** for the [prepared statement] or with a prepared statement for which
|
||||
@@ -3931,7 +3936,7 @@ int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
|
||||
int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
|
||||
void(*)(void*), unsigned char encoding);
|
||||
int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
|
||||
int sqlite3_bind_pointer(sqlite3_stmt*, int, void*, const char*,void(*)(void*));
|
||||
int sqlite3_bind_pointer(sqlite3_stmt*, int, void*, const char*);
|
||||
int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
|
||||
int sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
|
||||
|
||||
@@ -4764,7 +4769,7 @@ SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
|
||||
** extract UTF-16 strings as big-endian and little-endian respectively.
|
||||
**
|
||||
** ^If [sqlite3_value] object V was initialized
|
||||
** using [sqlite3_bind_pointer(S,I,P,X,D)] or [sqlite3_result_pointer(C,P,X,D)]
|
||||
** using [sqlite3_bind_pointer(S,I,P,X)] or [sqlite3_result_pointer(C,P,X)]
|
||||
** and if X and Y are strings that compare equal according to strcmp(X,Y),
|
||||
** then sqlite3_value_pointer(V,Y) will return the pointer P. ^Otherwise,
|
||||
** sqlite3_value_pointer(V,Y) returns a NULL.
|
||||
@@ -5102,20 +5107,14 @@ typedef void (*sqlite3_destructor_type)(void*);
|
||||
** [unprotected sqlite3_value] object is required, so either
|
||||
** kind of [sqlite3_value] object can be used with this interface.
|
||||
**
|
||||
** ^The sqlite3_result_pointer(C,P,T,D) interface sets the result to an
|
||||
** ^The sqlite3_result_pointer(C,P,T) interface sets the result to an
|
||||
** SQL NULL value, just like [sqlite3_result_null(C)], except that it
|
||||
** also associates the host-language pointer P or type T with that
|
||||
** NULL value such that the pointer can be retrieved within an
|
||||
** [application-defined SQL function] using [sqlite3_value_pointer()].
|
||||
** ^If the D parameter is not NULL, then it is a pointer to a destructor
|
||||
** for the P parameter. ^The destructor D is invoked on P when the result
|
||||
** value goes out of scope.
|
||||
** The T parameter should be a static string and preferably a string
|
||||
** literal. The procedure that invokes sqlite3_result_pointer(C,P,T,D)
|
||||
** continues to own the P and T pointers and must guarantee that
|
||||
** those pointers remain valid until after the last access via
|
||||
** [sqlite3_value_pointer()]. The sqlite3_result_pointer() routine
|
||||
** is part of the [pointer passing interface] added for SQLite 3.20.0.
|
||||
** The T parameter should be a static string.
|
||||
** This mechanism can be used to pass non-SQL values between
|
||||
** application-defined functions.
|
||||
**
|
||||
** If these routines are called from within the different thread
|
||||
** than the one containing the application-defined function that received
|
||||
@@ -5140,7 +5139,7 @@ void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
|
||||
void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
|
||||
void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
|
||||
void sqlite3_result_value(sqlite3_context*, sqlite3_value*);
|
||||
void sqlite3_result_pointer(sqlite3_context*, void*,const char*,void(*)(void*));
|
||||
void sqlite3_result_pointer(sqlite3_context*, void*, const char*);
|
||||
void sqlite3_result_zeroblob(sqlite3_context*, int n);
|
||||
int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
|
||||
|
||||
|
||||
+2
-2
@@ -289,8 +289,8 @@ struct sqlite3_api_routines {
|
||||
sqlite3_stmt**,const char**);
|
||||
int (*prepare16_v3)(sqlite3*,const void*,int,unsigned int,
|
||||
sqlite3_stmt**,const void**);
|
||||
int (*bind_pointer)(sqlite3_stmt*,int,void*,const char*,void(*)(void*));
|
||||
void (*result_pointer)(sqlite3_context*,void*,const char*,void(*)(void*));
|
||||
int (*bind_pointer)(sqlite3_stmt*,int,void*,const char*);
|
||||
void (*result_pointer)(sqlite3_context*,void*,const char*);
|
||||
void *(*value_pointer)(sqlite3_value*,const char*);
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -1662,7 +1662,7 @@ struct FuncDestructor {
|
||||
0, 0, xFunc, 0, #zName, {0} }
|
||||
#define PURE_DATE(zName, nArg, iArg, bNC, xFunc) \
|
||||
{nArg, SQLITE_FUNC_SLOCHNG|SQLITE_UTF8|SQLITE_FUNC_CONSTANT, \
|
||||
(void*)&sqlite3Config, 0, xFunc, 0, #zName, {0} }
|
||||
(void*)xFunc, 0, xFunc, 0, #zName, {0} }
|
||||
#define FUNCTION2(zName, nArg, iArg, bNC, xFunc, extraFlags) \
|
||||
{nArg,SQLITE_FUNC_CONSTANT|SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL)|extraFlags,\
|
||||
SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, #zName, {0} }
|
||||
|
||||
+27
@@ -2638,6 +2638,32 @@ static int SQLITE_TCLAPI test_stmt_busy(
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** Usage: sqlite3_stmt_refresh STMT
|
||||
**
|
||||
** Recompile the STMT prepared statement if it needs to be recompiled.
|
||||
*/
|
||||
static int SQLITE_TCLAPI test_stmt_refresh(
|
||||
void * clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[]
|
||||
){
|
||||
sqlite3_stmt *pStmt;
|
||||
int rc;
|
||||
|
||||
if( objc!=2 ){
|
||||
Tcl_AppendResult(interp, "wrong # args: should be \"",
|
||||
Tcl_GetStringFromObj(objv[0], 0), " STMT", 0);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
|
||||
rc = sqlite3_stmt_refresh(pStmt);
|
||||
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(rc));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** Usage: uses_stmt_journal STMT
|
||||
**
|
||||
@@ -7491,6 +7517,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
|
||||
{ "sqlite3_next_stmt", test_next_stmt ,0 },
|
||||
{ "sqlite3_stmt_readonly", test_stmt_readonly ,0 },
|
||||
{ "sqlite3_stmt_busy", test_stmt_busy ,0 },
|
||||
{ "sqlite3_stmt_refresh", test_stmt_refresh ,0 },
|
||||
{ "uses_stmt_journal", uses_stmt_journal ,0 },
|
||||
|
||||
{ "sqlite3_release_memory", test_release_memory, 0},
|
||||
|
||||
+1
-1
@@ -241,7 +241,7 @@ static int SQLITE_TCLAPI test_blob_read(
|
||||
if( nByte>0 ){
|
||||
zBuf = (unsigned char *)Tcl_AttemptAlloc(nByte);
|
||||
if( zBuf==0 ){
|
||||
Tcl_AppendResult(interp, "out of memory in " __FILE__, 0);
|
||||
Tcl_AppendResult(interp, "out of memory", 0);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3191,6 +3191,9 @@ case OP_Transaction: {
|
||||
rc = SQLITE_SCHEMA;
|
||||
}
|
||||
if( rc ) goto abort_due_to_error;
|
||||
if( p->stopAfterInit && pOp[1].opcode!=OP_Transaction ){
|
||||
goto vdbe_return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+8
-8
@@ -189,8 +189,8 @@ struct sqlite3_value {
|
||||
union MemValue {
|
||||
double r; /* Real value used when MEM_Real is set in flags */
|
||||
i64 i; /* Integer value used when MEM_Int is set in flags */
|
||||
int nZero; /* Extra zero bytes when MEM_Zero and MEM_Blob set */
|
||||
const char *zPType; /* Pointer type when MEM_Term|MEM_Subtype|MEM_Null */
|
||||
int nZero; /* Used when bit MEM_Zero is set in flags */
|
||||
void *pPtr; /* Pointer when flags=MEM_NULL and eSubtype='p' */
|
||||
FuncDef *pDef; /* Used only when flags==MEM_Agg */
|
||||
RowSet *pRowSet; /* Used only when flags==MEM_RowSet */
|
||||
VdbeFrame *pFrame; /* Used when flags==MEM_Frame */
|
||||
@@ -222,8 +222,7 @@ struct sqlite3_value {
|
||||
** representations of the value stored in the Mem struct.
|
||||
**
|
||||
** If the MEM_Null flag is set, then the value is an SQL NULL value.
|
||||
** For a pointer type created using sqlite3_bind_pointer() or
|
||||
** sqlite3_result_pointer() the MEM_Term and MEM_Subtype flags are also set.
|
||||
** No other flags may be set in this case.
|
||||
**
|
||||
** If the MEM_Str flag is set then Mem.z points at a string representation.
|
||||
** Usually this is encoded in the same unicode encoding as the main
|
||||
@@ -231,7 +230,7 @@ struct sqlite3_value {
|
||||
** set, then the string is nul terminated. The MEM_Int and MEM_Real
|
||||
** flags may coexist with the MEM_Str flag.
|
||||
*/
|
||||
#define MEM_Null 0x0001 /* Value is NULL (or a pointer) */
|
||||
#define MEM_Null 0x0001 /* Value is NULL */
|
||||
#define MEM_Str 0x0002 /* Value is a string */
|
||||
#define MEM_Int 0x0004 /* Value is an integer */
|
||||
#define MEM_Real 0x0008 /* Value is a real number */
|
||||
@@ -241,7 +240,7 @@ struct sqlite3_value {
|
||||
#define MEM_Frame 0x0040 /* Value is a VdbeFrame object */
|
||||
#define MEM_Undefined 0x0080 /* Value is undefined */
|
||||
#define MEM_Cleared 0x0100 /* NULL set by OP_Null, not from data */
|
||||
#define MEM_TypeMask 0xc1ff /* Mask of type bits */
|
||||
#define MEM_TypeMask 0x81ff /* Mask of type bits */
|
||||
|
||||
|
||||
/* Whenever Mem contains a valid string or blob representation, one of
|
||||
@@ -249,7 +248,7 @@ struct sqlite3_value {
|
||||
** policy for Mem.z. The MEM_Term flag tells us whether or not the
|
||||
** string is \000 or \u0000 terminated
|
||||
*/
|
||||
#define MEM_Term 0x0200 /* String in Mem.z is zero terminated */
|
||||
#define MEM_Term 0x0200 /* String rep is nul terminated */
|
||||
#define MEM_Dyn 0x0400 /* Need to call Mem.xDel() on Mem.z */
|
||||
#define MEM_Static 0x0800 /* Mem.z points to a static string */
|
||||
#define MEM_Ephem 0x1000 /* Mem.z points to an ephemeral string */
|
||||
@@ -393,6 +392,7 @@ struct Vdbe {
|
||||
bft usesStmtJournal:1; /* True if uses a statement journal */
|
||||
bft readOnly:1; /* True for statements that do not write */
|
||||
bft bIsReader:1; /* True for statements that read */
|
||||
bft stopAfterInit:1; /* Halt after running the last OP_Transaction */
|
||||
yDbMask btreeMask; /* Bitmask of db->aDb[] entries referenced */
|
||||
yDbMask lockMask; /* Subset of btreeMask that requires a lock */
|
||||
u32 aCounter[7]; /* Counters used by sqlite3_stmt_status() */
|
||||
@@ -477,7 +477,7 @@ void sqlite3VdbeMemSetInt64(Mem*, i64);
|
||||
#else
|
||||
void sqlite3VdbeMemSetDouble(Mem*, double);
|
||||
#endif
|
||||
void sqlite3VdbeMemSetPointer(Mem*, void*, const char*, void(*)(void*));
|
||||
void sqlite3VdbeMemSetPointer(Mem*, void*, const char*);
|
||||
void sqlite3VdbeMemInit(Mem*,sqlite3*,u16);
|
||||
void sqlite3VdbeMemSetNull(Mem*);
|
||||
void sqlite3VdbeMemSetZeroBlob(Mem*,int);
|
||||
|
||||
+29
-21
@@ -201,13 +201,12 @@ unsigned int sqlite3_value_subtype(sqlite3_value *pVal){
|
||||
}
|
||||
void *sqlite3_value_pointer(sqlite3_value *pVal, const char *zPType){
|
||||
Mem *p = (Mem*)pVal;
|
||||
if( (p->flags&(MEM_TypeMask|MEM_Term|MEM_Subtype)) ==
|
||||
(MEM_Null|MEM_Term|MEM_Subtype)
|
||||
if( p->flags==(MEM_Null|MEM_Subtype|MEM_Term|MEM_Static)
|
||||
&& zPType!=0
|
||||
&& p->eSubtype=='p'
|
||||
&& strcmp(p->u.zPType, zPType)==0
|
||||
&& strcmp(p->z, zPType)==0
|
||||
){
|
||||
return (void*)p->z;
|
||||
return p->u.pPtr;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
@@ -390,16 +389,11 @@ void sqlite3_result_null(sqlite3_context *pCtx){
|
||||
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
|
||||
sqlite3VdbeMemSetNull(pCtx->pOut);
|
||||
}
|
||||
void sqlite3_result_pointer(
|
||||
sqlite3_context *pCtx,
|
||||
void *pPtr,
|
||||
const char *zPType,
|
||||
void (*xDestructor)(void*)
|
||||
){
|
||||
void sqlite3_result_pointer(sqlite3_context *pCtx, void *pPtr, const char *zPT){
|
||||
Mem *pOut = pCtx->pOut;
|
||||
assert( sqlite3_mutex_held(pOut->db->mutex) );
|
||||
sqlite3VdbeMemSetNull(pOut);
|
||||
sqlite3VdbeMemSetPointer(pOut, pPtr, zPType, xDestructor);
|
||||
sqlite3VdbeMemSetPointer(pOut, pPtr, zPT);
|
||||
}
|
||||
void sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
|
||||
Mem *pOut = pCtx->pOut;
|
||||
@@ -1404,21 +1398,13 @@ int sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
int sqlite3_bind_pointer(
|
||||
sqlite3_stmt *pStmt,
|
||||
int i,
|
||||
void *pPtr,
|
||||
const char *zPTtype,
|
||||
void (*xDestructor)(void*)
|
||||
){
|
||||
int sqlite3_bind_pointer(sqlite3_stmt *pStmt, int i, void *pPtr,const char *zT){
|
||||
int rc;
|
||||
Vdbe *p = (Vdbe*)pStmt;
|
||||
rc = vdbeUnbind(p, i);
|
||||
if( rc==SQLITE_OK ){
|
||||
sqlite3VdbeMemSetPointer(&p->aVar[i-1], pPtr, zPTtype, xDestructor);
|
||||
sqlite3VdbeMemSetPointer(&p->aVar[i-1], pPtr, zT);
|
||||
sqlite3_mutex_leave(p->db->mutex);
|
||||
}else if( xDestructor ){
|
||||
xDestructor(pPtr);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
@@ -1622,6 +1608,28 @@ int sqlite3_stmt_busy(sqlite3_stmt *pStmt){
|
||||
return v!=0 && v->magic==VDBE_MAGIC_RUN && v->pc>=0;
|
||||
}
|
||||
|
||||
/*
|
||||
** Recompile the prepared statement if it has expired
|
||||
*/
|
||||
int sqlite3_stmt_refresh(sqlite3_stmt *pStmt){
|
||||
int rc = SQLITE_OK;
|
||||
if( !sqlite3_stmt_busy(pStmt) ){
|
||||
VdbeOp *aOp;
|
||||
Vdbe *v = (Vdbe*)pStmt;
|
||||
sqlite3_mutex_enter(v->db->mutex);
|
||||
aOp = v->aOp;
|
||||
assert( aOp[0].opcode==OP_Init );
|
||||
if( aOp[aOp[0].p2].opcode==OP_Transaction ){
|
||||
v->stopAfterInit = 1;
|
||||
rc = sqlite3_step(pStmt);
|
||||
v->stopAfterInit = 0;
|
||||
sqlite3_reset(pStmt);
|
||||
}
|
||||
sqlite3_mutex_leave(v->db->mutex);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Return a pointer to the next prepared statement after pStmt associated
|
||||
** with database connection pDb. If pStmt is NULL, return the first
|
||||
|
||||
@@ -4593,9 +4593,6 @@ void sqlite3VdbeSetVarmask(Vdbe *v, int iVar){
|
||||
** features such as 'now'.
|
||||
*/
|
||||
int sqlite3NotPureFunc(sqlite3_context *pCtx){
|
||||
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
|
||||
if( pCtx->pVdbe==0 ) return 1;
|
||||
#endif
|
||||
if( pCtx->pVdbe->aOp[pCtx->iOp].opcode==OP_PureFunc ){
|
||||
sqlite3_result_error(pCtx,
|
||||
"non-deterministic function in index expression or CHECK constraint",
|
||||
|
||||
+11
-43
@@ -27,7 +27,7 @@
|
||||
*/
|
||||
int sqlite3VdbeCheckMemInvariants(Mem *p){
|
||||
/* If MEM_Dyn is set then Mem.xDel!=0.
|
||||
** Mem.xDel might not be initialized if MEM_Dyn is clear.
|
||||
** Mem.xDel is might not be initialized if MEM_Dyn is clear.
|
||||
*/
|
||||
assert( (p->flags & MEM_Dyn)==0 || p->xDel!=0 );
|
||||
|
||||
@@ -40,34 +40,9 @@ int sqlite3VdbeCheckMemInvariants(Mem *p){
|
||||
/* Cannot be both MEM_Int and MEM_Real at the same time */
|
||||
assert( (p->flags & (MEM_Int|MEM_Real))!=(MEM_Int|MEM_Real) );
|
||||
|
||||
if( p->flags & MEM_Null ){
|
||||
/* Cannot be both MEM_Null and some other type */
|
||||
assert( (p->flags & (MEM_Int|MEM_Real|MEM_Str|MEM_Blob
|
||||
|MEM_RowSet|MEM_Frame|MEM_Agg|MEM_Zero))==0 );
|
||||
|
||||
/* If MEM_Null is set, then either the value is a pure NULL (the usual
|
||||
** case) or it is a pointer set using sqlite3_bind_pointer() or
|
||||
** sqlite3_result_pointer(). If a pointer, then MEM_Term must also be
|
||||
** set.
|
||||
*/
|
||||
if( (p->flags & (MEM_Term|MEM_Subtype))==(MEM_Term|MEM_Subtype) ){
|
||||
/* This is a pointer type. There may be a flag to indicate what to
|
||||
** do with the pointer. */
|
||||
assert( ((p->flags&MEM_Dyn)!=0 ? 1 : 0) +
|
||||
((p->flags&MEM_Ephem)!=0 ? 1 : 0) +
|
||||
((p->flags&MEM_Static)!=0 ? 1 : 0) <= 1 );
|
||||
|
||||
/* No other bits set */
|
||||
assert( (p->flags & ~(MEM_Null|MEM_Term|MEM_Subtype
|
||||
|MEM_Dyn|MEM_Ephem|MEM_Static))==0 );
|
||||
}else{
|
||||
/* A pure NULL might have other flags, such as MEM_Static, MEM_Dyn,
|
||||
** MEM_Ephem, MEM_Cleared, or MEM_Subtype */
|
||||
}
|
||||
}else{
|
||||
/* The MEM_Cleared bit is only allowed on NULLs */
|
||||
assert( (p->flags & MEM_Cleared)==0 );
|
||||
}
|
||||
/* Cannot be both MEM_Null and some other type */
|
||||
assert( (p->flags & MEM_Null)==0 ||
|
||||
(p->flags & (MEM_Int|MEM_Real|MEM_Str|MEM_Blob))==0 );
|
||||
|
||||
/* The szMalloc field holds the correct memory allocation size */
|
||||
assert( p->szMalloc==0
|
||||
@@ -730,25 +705,18 @@ void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){
|
||||
}
|
||||
}
|
||||
|
||||
/* A no-op destructor */
|
||||
static void sqlite3NoopDestructor(void *p){ UNUSED_PARAMETER(p); }
|
||||
|
||||
/*
|
||||
** Set the value stored in *pMem should already be a NULL.
|
||||
** Also store a pointer to go with it.
|
||||
*/
|
||||
void sqlite3VdbeMemSetPointer(
|
||||
Mem *pMem,
|
||||
void *pPtr,
|
||||
const char *zPType,
|
||||
void (*xDestructor)(void*)
|
||||
){
|
||||
void sqlite3VdbeMemSetPointer(Mem *pMem, void *pPtr, const char *zPType){
|
||||
assert( pMem->flags==MEM_Null );
|
||||
pMem->u.zPType = zPType ? zPType : "";
|
||||
pMem->z = pPtr;
|
||||
pMem->flags = MEM_Null|MEM_Dyn|MEM_Subtype|MEM_Term;
|
||||
pMem->eSubtype = 'p';
|
||||
pMem->xDel = xDestructor ? xDestructor : sqlite3NoopDestructor;
|
||||
if( zPType ){
|
||||
pMem->flags = MEM_Null|MEM_Subtype|MEM_Term|MEM_Static;
|
||||
pMem->u.pPtr = pPtr;
|
||||
pMem->eSubtype = 'p';
|
||||
pMem->z = (char*)zPType;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef SQLITE_OMIT_FLOATING_POINT
|
||||
|
||||
@@ -179,5 +179,30 @@ do_test capi3d-4.2.6 {
|
||||
sqlite3_finalize $::s1
|
||||
} {SQLITE_OK}
|
||||
|
||||
# Tests for the sqlite3_stmt_refresh() interface
|
||||
#
|
||||
do_execsql_test capi3d-5.1 {
|
||||
DROP TABLE IF EXISTS t5;
|
||||
CREATE TABLE t5(a,b);
|
||||
INSERT INTO t5 VALUES(1,2),(3,4);
|
||||
}
|
||||
do_test capi3d-5.2 {
|
||||
set ::s1 [sqlite3_prepare_v2 db "SELECT * FROM t5" -1 notused]
|
||||
sqlite3 db2 test.db
|
||||
db2 eval {SELECT * FROM t5 ORDER BY a}
|
||||
} {1 2 3 4}
|
||||
do_test capi3d-5.3 {
|
||||
sqlite3_column_count $::s1
|
||||
} 2
|
||||
do_test capi3d-5.4 {
|
||||
db2 eval {ALTER TABLE t5 ADD COLUMN c DEFAULT 9}
|
||||
sqlite3_column_count $::s1
|
||||
} 2
|
||||
do_test capi3d-5.5 {
|
||||
sqlite3_stmt_refresh $::s1
|
||||
sqlite3_column_count $::s1
|
||||
} 3
|
||||
sqlite3_finalize $::s1
|
||||
db2 close
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -331,9 +331,6 @@ if {$::tcl_platform(pointerSize)>=8} {
|
||||
# integer overflow.
|
||||
sqlite3_blob_read $rdHandle 2147483647 2147483647
|
||||
} errmsg]
|
||||
if {[string match {out of memory in *test_blob.c} $errmsg]} {
|
||||
set errmsg SQLITE_ERROR
|
||||
}
|
||||
lappend rc $errmsg
|
||||
} {1 SQLITE_ERROR}
|
||||
}
|
||||
|
||||
@@ -380,4 +380,7 @@ do_execsql_test indexexpr1-1300.1 {
|
||||
SELECT a FROM t1300 WHERE substr(b,4)='ess' COLLATE nocase ORDER BY +a;
|
||||
} {3 4}
|
||||
|
||||
# Date and time functions can participate in an index as long as they
|
||||
# do not contain
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -16,11 +16,6 @@ set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
set testprefix unionvtab
|
||||
|
||||
ifcapable !vtab {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
load_static_extension db unionvtab
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@@ -16,10 +16,6 @@ set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
set testprefix unionvtabfault
|
||||
|
||||
ifcapable !vtab {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
forcedelete test.db2
|
||||
do_execsql_test 1.0 {
|
||||
|
||||
Reference in New Issue
Block a user