/ Check-in [a6356817]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a formatting issue in the TreeView output for bare expression lists.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: a6356817815fe986c4d89475194e0537ebd46582d6df1034482bf08521182bdf
User & Date: drh 2018-04-23 20:04:38
Context
2018-04-23
20:38
Fix a problem in sqlite3ExprCompare() associated with UPSERT. check-in: 67d0b2c1 user: drh tags: trunk
20:04
Fix a formatting issue in the TreeView output for bare expression lists. check-in: a6356817 user: drh tags: trunk
18:38
Add the ".imposter off" variant of the ".imposter" dot-command in the CLI. check-in: d3dad06f user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/treeview.c.

    58     58     sqlite3StrAccumInit(&acc, 0, zBuf, sizeof(zBuf), 0);
    59     59     if( p ){
    60     60       for(i=0; i<p->iLevel && i<sizeof(p->bLine)-1; i++){
    61     61         sqlite3StrAccumAppend(&acc, p->bLine[i] ? "|   " : "    ", 4);
    62     62       }
    63     63       sqlite3StrAccumAppend(&acc, p->bLine[i] ? "|-- " : "'-- ", 4);
    64     64     }
    65         -  va_start(ap, zFormat);
    66         -  sqlite3VXPrintf(&acc, zFormat, ap);
    67         -  va_end(ap);
    68         -  assert( acc.nChar>0 );
    69         -  if( zBuf[acc.nChar-1]!='\n' ) sqlite3StrAccumAppend(&acc, "\n", 1);
           65  +  if( zFormat!=0 ){
           66  +    va_start(ap, zFormat);
           67  +    sqlite3VXPrintf(&acc, zFormat, ap);
           68  +    va_end(ap);
           69  +    assert( acc.nChar>0 );
           70  +    sqlite3StrAccumAppend(&acc, "\n", 1);
           71  +  }
    70     72     sqlite3StrAccumFinish(&acc);
    71     73     fprintf(stdout,"%s", zBuf);
    72     74     fflush(stdout);
    73     75   }
    74     76   
    75     77   /*
    76     78   ** Shorthand for starting a new tree item that consists of a single label
................................................................................
   532    534       sqlite3TreeViewLine(pView, "%s (empty)", zLabel);
   533    535     }else{
   534    536       int i;
   535    537       sqlite3TreeViewLine(pView, "%s", zLabel);
   536    538       for(i=0; i<pList->nExpr; i++){
   537    539         int j = pList->a[i].u.x.iOrderByCol;
   538    540         char *zName = pList->a[i].zName;
          541  +      int moreToFollow = i<pList->nExpr - 1;
   539    542         if( j || zName ){
   540         -        sqlite3TreeViewPush(pView, 0);
   541         -      }
   542         -      if( zName ){
   543         -        sqlite3TreeViewLine(pView, "AS %s", zName);
          543  +        sqlite3TreeViewPush(pView, moreToFollow);
          544  +        moreToFollow = 0;
          545  +        sqlite3TreeViewLine(pView, 0);
          546  +        if( zName ){
          547  +          fprintf(stdout, "AS %s ", zName);
          548  +        }
          549  +        if( j ){
          550  +          fprintf(stdout, "iOrderByCol=%d", j);
          551  +        }
          552  +        fprintf(stdout, "\n");
          553  +        fflush(stdout);
   544    554         }
   545         -      if( j ){
   546         -        sqlite3TreeViewLine(pView, "iOrderByCol=%d", j);
   547         -      }
   548         -      sqlite3TreeViewExpr(pView, pList->a[i].pExpr, i<pList->nExpr-1);
          555  +      sqlite3TreeViewExpr(pView, pList->a[i].pExpr, moreToFollow);
   549    556         if( j || zName ){
   550    557           sqlite3TreeViewPop(pView);
   551    558         }
   552    559       }
   553    560     }
   554    561   }
   555    562   void sqlite3TreeViewExprList(