1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-19 21:43:15 +03:00

Change the name of the new sqlite3_index_info.flags field to "idxFlags". Add documentation for the same to sqlite.h.in.

FossilOrigin-Name: f61203bc0fb0b62e12d6270e8d9063e445a5a252
This commit is contained in:
dan
2015-09-29 11:57:20 +00:00
parent 354474ad6d
commit b3deb4ea64
5 changed files with 33 additions and 15 deletions

View File

@@ -1525,7 +1525,7 @@ static void fts3SetEstimatedRows(sqlite3_index_info *pIdxInfo, i64 nRow){
static void fts3SetUniqueFlag(sqlite3_index_info *pIdxInfo){
#if SQLITE_VERSION_NUMBER>=3008012
if( sqlite3_libversion_number()>=3008012 ){
pIdxInfo->flags |= SQLITE_INDEX_SCAN_UNIQUE;
pIdxInfo->idxFlags |= SQLITE_INDEX_SCAN_UNIQUE;
}
#endif
}

View File

@@ -1,5 +1,5 @@
C Add\stests\sfor\sfts3\sand\sonepass\supdate/delete\soperations.\sAlso\sfix\sa\sproblem\swith\sonepass\supdates\sthat\sdo\snot\saffect\sany\srows.
D 2015-09-29T10:11:26.685
C Change\sthe\sname\sof\sthe\snew\ssqlite3_index_info.flags\sfield\sto\s"idxFlags".\sAdd\sdocumentation\sfor\sthe\ssame\sto\ssqlite.h.in.
D 2015-09-29T11:57:20.011
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 2143eeef6d0cc26006ae5fc4bb242a4a8b973412
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -78,7 +78,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 52232f39bae8320c537f1d9ffd8d58b64dfaf21e
F ext/fts3/fts3.c e028eb13432f108d2e22cded019fc980700e4e00
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
F ext/fts3/fts3Int.h c84125c666ee54cef6efce6ff64abb0d0e2f4535
F ext/fts3/fts3_aux.c 9edc3655fcb287f0467d0a4b886a01c6185fe9f1
@@ -342,7 +342,7 @@ F src/resolve.c 1954a0f01bf65d78d7d559aea3d5c67f33376d91
F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
F src/select.c 33230303f5f32430ee971a6fcc6a370e4a93ae1a
F src/shell.c a11b20da4c6630e0e8f83c47ce36f717dd0422f0
F src/sqlite.h.in eade8bcc0456ff4d3f7ecfbbd3c4eec117314f26
F src/sqlite.h.in 4b76d74d69af48c534c58fb723137dc6944bdedc
F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
F src/sqlite3ext.h 64350bf36833a56ad675e27392a913f417c5c308
F src/sqliteInt.h 5afc6e50402be1e0a870f28e1cd8b32eb9db590f
@@ -417,7 +417,7 @@ F src/vxworks.h c18586c8edc1bddbc15c004fa16aeb1e1342b4fb
F src/wal.c 18b0ed49830cf04fe2d68224b41838a73ac6cd24
F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
F src/walker.c 2e14d17f592d176b6dc879c33fbdec4fbccaa2ba
F src/where.c d07fb77010949be9b96e9120b4653712bf9f74ae
F src/where.c 6491ebe811ee698793912f927b0fe3b662687e1b
F src/whereInt.h 7892bb54cf9ca0ae5c7e6094491b94c9286dc647
F src/wherecode.c a87238178f8c300fd27afec54326ea8d0a18baa2
F src/whereexpr.c 2473e4350e30f9b55d1c6a8f66ca23c689f23f1d
@@ -1389,7 +1389,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 1aa27d706db9b2e21737ce4b94b47ecd12c2570f
R 906a452cbd4322b894c4cf3888c881fe
P 820c804468abff692742952de670c5d906a50956
R 546729b46aaa02f7503bc91f6617e820
U dan
Z 392788408df553b8d21ff2f5c84b91d4
Z 84ab7e4ab7ab149e316240ec34018bc8

View File

@@ -1 +1 @@
820c804468abff692742952de670c5d906a50956
f61203bc0fb0b62e12d6270e8d9063e445a5a252

View File

@@ -5634,13 +5634,31 @@ struct sqlite3_module {
** ^The estimatedRows value is an estimate of the number of rows that
** will be returned by the strategy.
**
** The xBestIndex method may optionally populate the idxFlags field with a
** mask of SQLITE_INDEX_SCAN_* flags. Currently there is only one such flag -
** SQLITE_INDEX_SCAN_UNIQUE. If the xBestIndex method sets this flag, SQLite
** assumes that the strategy may visit at most one row.
**
** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then
** SQLite also assumes that if a call to the xUpdate() method is made as
** part of the same statement to delete or update a virtual table row and the
** implementation returns SQLITE_CONSTRAINT, then there is no need to rollback
** any database changes. In other words, if the xUpdate() returns
** SQLITE_CONSTRAINT, the database contents must be exactly as they were
** before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not
** set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by
** the xUpdate method are automatically rolled back by SQLite.
**
** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info
** structure for SQLite version 3.8.2. If a virtual table extension is
** used with an SQLite version earlier than 3.8.2, the results of attempting
** to read or write the estimatedRows field are undefined (but are likely
** to included crashing the application). The estimatedRows field should
** therefore only be used if [sqlite3_libversion_number()] returns a
** value greater than or equal to 3008002.
** value greater than or equal to 3008002. Similarly, the idxFlags field
** was added for version 3.8.12. It may therefore only be used if
** sqlite3_libversion_number() returns a value greater than or equal to
** 3008012.
*/
struct sqlite3_index_info {
/* Inputs */
@@ -5669,7 +5687,7 @@ struct sqlite3_index_info {
/* Fields below are only available in SQLite 3.8.2 and later */
sqlite3_int64 estimatedRows; /* Estimated number of rows returned */
/* Fields below are only available in SQLite 3.8.12 and later */
int flags; /* Mask of SQLITE_INDEX_SCAN_* flags */
int idxFlags; /* Mask of SQLITE_INDEX_SCAN_* flags */
};
/*

View File

@@ -2832,7 +2832,7 @@ static int whereLoopAddVirtual(
pIdxInfo->orderByConsumed = 0;
pIdxInfo->estimatedCost = SQLITE_BIG_DBL / (double)2;
pIdxInfo->estimatedRows = 25;
pIdxInfo->flags = 0;
pIdxInfo->idxFlags = 0;
rc = vtabBestIndex(pParse, pTab, pIdxInfo);
if( rc ) goto whereLoopAddVtab_exit;
pIdxCons = *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint;
@@ -2878,7 +2878,7 @@ static int whereLoopAddVirtual(
** (2) Multiple outputs from a single IN value will not merge
** together. */
pIdxInfo->orderByConsumed = 0;
pIdxInfo->flags &= ~SQLITE_INDEX_SCAN_UNIQUE;
pIdxInfo->idxFlags &= ~SQLITE_INDEX_SCAN_UNIQUE;
}
}
}
@@ -2897,7 +2897,7 @@ static int whereLoopAddVirtual(
/* Set the WHERE_ONEROW flag if the xBestIndex() method indicated
** that the scan will visit at most one row. Clear it otherwise. */
if( pIdxInfo->flags & SQLITE_INDEX_SCAN_UNIQUE ){
if( pIdxInfo->idxFlags & SQLITE_INDEX_SCAN_UNIQUE ){
pNew->wsFlags |= WHERE_ONEROW;
}else{
pNew->wsFlags &= ~WHERE_ONEROW;