1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +03:00

Fix handling of transitive constraints in schemalint.tcl.

FossilOrigin-Name: 44edc1aa3b412ddbe2a242075e2bf36a99437688
This commit is contained in:
dan
2016-01-22 14:44:02 +00:00
parent a494ca8d12
commit 336bfe06b9
4 changed files with 25 additions and 11 deletions

View File

@@ -3924,6 +3924,7 @@ static char *whereAppendPrintf(sqlite3 *db, const char *zFmt, ...){
static char *whereAppendSingleTerm(
Parse *pParse,
Table *pTab,
int iCol,
int bOr,
char *zIn,
WhereTerm *pTerm
@@ -3945,7 +3946,7 @@ static char *whereAppendSingleTerm(
const char *zFmt = bOr ? "%z{{%s \"%w\" \"%w\" %lld}}" :
"%z{%s \"%w\" \"%w\" %lld}";
zBuf = whereAppendPrintf(db, zFmt, zIn,
zOp, pTab->aCol[pTerm->u.leftColumn].zName,
zOp, pTab->aCol[iCol].zName,
(pColl ? pColl->zName : "BINARY"),
pTerm->prereqRight
);
@@ -3969,6 +3970,7 @@ static char *whereTraceWC(
int iCol;
int ii;
int bFirst = !bInitialSpace;
int bOr = (pWC->op==TK_OR);
/* List of WO_SINGLE constraints */
for(iCol=0; iCol<pTab->nCol; iCol++){
@@ -3979,9 +3981,9 @@ static char *whereTraceWC(
pTerm;
pTerm=whereScanNext(&scan)
){
assert( iCol==pTerm->u.leftColumn );
/* assert( iCol==pTerm->u.leftColumn ); */
if( bFirst==0 ) zBuf = whereAppendPrintf(db, "%z ", zBuf);
zBuf = whereAppendSingleTerm(pParse, pTab, pWC->op==TK_OR, zBuf, pTerm);
zBuf = whereAppendSingleTerm(pParse, pTab, iCol, bOr, zBuf, pTerm);
bFirst = 0;
}
}