mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
Issue the new SQLITE_WARNING_AUTOINDEX warning on the SQLite log whenever
an automatic index is created. FossilOrigin-Name: 338826ef3f8a209b14f8d42370855cab9ac9ed45
This commit is contained in:
@@ -2042,6 +2042,7 @@ static void constructAutomaticIndex(
|
||||
WhereLoop *pLoop; /* The Loop object */
|
||||
Bitmask idxCols; /* Bitmap of columns used for indexing */
|
||||
Bitmask extraCols; /* Bitmap of additional columns */
|
||||
u8 sentWarning = 0; /* True if a warnning has been issued */
|
||||
|
||||
/* Generate code to skip over the creation and initialization of the
|
||||
** transient index on 2nd and subsequent iterations of the loop. */
|
||||
@@ -2062,6 +2063,12 @@ static void constructAutomaticIndex(
|
||||
Bitmask cMask = iCol>=BMS ? MASKBIT(BMS-1) : MASKBIT(iCol);
|
||||
testcase( iCol==BMS );
|
||||
testcase( iCol==BMS-1 );
|
||||
if( !sentWarning ){
|
||||
sqlite3_log(SQLITE_WARNING_AUTOINDEX,
|
||||
"automatic index on %s(%s)", pTable->zName,
|
||||
pTable->aCol[iCol].zName);
|
||||
sentWarning = 1;
|
||||
}
|
||||
if( (idxCols & cMask)==0 ){
|
||||
if( whereLoopResize(pParse->db, pLoop, nColumn+1) ) return;
|
||||
pLoop->aLTerm[nColumn++] = pTerm;
|
||||
|
||||
Reference in New Issue
Block a user