1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Improvements to the new syntax-tree output routines: Omit the "END SELECT"

mark and instead terminate the graph at the last item.  Increase the maximum
tree depth to 100.

FossilOrigin-Name: 5ce05757aac80b99c3b2141cd301809f8e28e661
This commit is contained in:
drh
2014-09-30 19:04:41 +00:00
parent 36be4c49e4
commit b08cd3f345
5 changed files with 33 additions and 27 deletions

View File

@@ -1080,8 +1080,7 @@ TreeView *sqlite3TreeViewPush(TreeView *p, u8 moreToFollow){
p->iLevel++;
}
assert( moreToFollow==0 || moreToFollow==1 );
p->mLine &= ~(1<<p->iLevel);
p->mLine |= moreToFollow << p->iLevel;
if( p->iLevel<sizeof(p->bLine) ) p->bLine[p->iLevel] = moreToFollow;
return p;
}
/* Finished with one layer of the tree */
@@ -1100,10 +1099,10 @@ void sqlite3TreeViewLine(TreeView *p, const char *zFormat, ...){
sqlite3StrAccumInit(&acc, zBuf, sizeof(zBuf), 0);
acc.useMalloc = 0;
if( p ){
for(i=0; i<p->iLevel; i++){
sqlite3StrAccumAppend(&acc, (p->mLine & (1<<i))!=0 ? "| " : " ", 4);
for(i=0; i<p->iLevel && i<sizeof(p->bLine)-1; i++){
sqlite3StrAccumAppend(&acc, p->bLine[i] ? "| " : " ", 4);
}
sqlite3StrAccumAppend(&acc, (p->mLine & (1<<i))!=0 ? "|-- " : "'-- ", 4);
sqlite3StrAccumAppend(&acc, p->bLine[i] ? "|-- " : "'-- ", 4);
}
va_start(ap, zFormat);
sqlite3VXPrintf(&acc, 0, zFormat, ap);