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

Add tests and fixes for "PRAGMA ota_mode".

FossilOrigin-Name: 39df35c4ac65ffba76ba2c6f6727cf5e843e7517
This commit is contained in:
dan
2014-09-17 15:20:24 +00:00
parent 1b95de09bc
commit abc0788663
6 changed files with 140 additions and 26 deletions

View File

@@ -1564,7 +1564,7 @@ void sqlite3CompleteInsertion(
/* If the "ota_mode" flag is set, ignore all indexes except the PK
** index of WITHOUT ROWID tables. */
if( (pParse->db->flags & SQLITE_OtaMode)
&& (pTab->iPKey>=0 || pIdx->idxType!=SQLITE_IDXTYPE_PRIMARYKEY)
&& (HasRowid(pTab) || pIdx->idxType!=SQLITE_IDXTYPE_PRIMARYKEY)
){
continue;
}

View File

@@ -43,10 +43,14 @@ void sqlite3DeleteTriggerStep(sqlite3 *db, TriggerStep *pTriggerStep){
** To state it another way: This routine returns a list of all triggers
** that fire off of pTab. The list will include any TEMP triggers on
** pTab as well as the triggers lised in pTab->pTrigger.
**
** If the SQLITE_OtaMode flag is set, do not include any non-temporary
** triggers in the returned list.
*/
Trigger *sqlite3TriggerList(Parse *pParse, Table *pTab){
Schema * const pTmpSchema = pParse->db->aDb[1].pSchema;
Trigger *pList = 0; /* List of triggers to return */
int bOta = !!(pParse->db->flags & SQLITE_OtaMode);
if( pParse->disableTriggers ){
return 0;
@@ -60,13 +64,13 @@ Trigger *sqlite3TriggerList(Parse *pParse, Table *pTab){
if( pTrig->pTabSchema==pTab->pSchema
&& 0==sqlite3StrICmp(pTrig->table, pTab->zName)
){
pTrig->pNext = (pList ? pList : pTab->pTrigger);
pTrig->pNext = ((pList || bOta) ? pList : pTab->pTrigger);
pList = pTrig;
}
}
}
return (pList ? pList : pTab->pTrigger);
return ((pList || bOta) ? pList : pTab->pTrigger);
}
/*