/ Check-in [070b4982]
Login

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

Overview
Comment:Fix a problem in the legacy ".explain on" formatting when it is used on a query with more than 8 output columns.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 070b49825c5f87cce15be4b758f0dfdd65226ec379465ca527a18706a1f3b8f4
User & Date: drh 2019-10-26 16:02:34
Context
2019-10-26
16:38
Clarify some comments and add assert() and testcase() macros to the replace-trigger recheck logic for ticket [c1e19e12046d23fe] check-in: 8c0042bd user: drh tags: trunk
16:02
Fix a problem in the legacy ".explain on" formatting when it is used on a query with more than 8 output columns. check-in: 070b4982 user: drh tags: trunk
15:40
Minor changes to help ensure the pointer returned by sqlite3VdbeGetOp() is not used after it becomes invalid. check-in: 346bdd49 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/shell.c.in.

1851
1852
1853
1854
1855
1856
1857

1858
1859

1860
1861
1862
1863

1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
    }
    case MODE_Explain:
    case MODE_Column: {
      static const int aExplainWidths[] = {4, 13, 4, 4, 4, 13, 2, 13};
      const int *colWidth;
      int showHdr;
      char *rowSep;

      if( p->cMode==MODE_Column ){
        colWidth = p->colWidth;

        showHdr = p->showHeader;
        rowSep = p->rowSeparator;
      }else{
        colWidth = aExplainWidths;

        showHdr = 1;
        rowSep = SEP_Row;
      }
      if( p->cnt++==0 ){
        for(i=0; i<nArg; i++){
          int w, n;
          if( i<ArraySize(p->colWidth) ){
            w = colWidth[i];
          }else{
            w = 0;
          }
          if( w==0 ){
            w = strlenChar(azCol[i] ? azCol[i] : "");
            if( w<10 ) w = 10;







>


>




>






|







1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
    }
    case MODE_Explain:
    case MODE_Column: {
      static const int aExplainWidths[] = {4, 13, 4, 4, 4, 13, 2, 13};
      const int *colWidth;
      int showHdr;
      char *rowSep;
      int nWidth;
      if( p->cMode==MODE_Column ){
        colWidth = p->colWidth;
        nWidth = ArraySize(p->colWidth);
        showHdr = p->showHeader;
        rowSep = p->rowSeparator;
      }else{
        colWidth = aExplainWidths;
        nWidth = ArraySize(aExplainWidths);
        showHdr = 1;
        rowSep = SEP_Row;
      }
      if( p->cnt++==0 ){
        for(i=0; i<nArg; i++){
          int w, n;
          if( i<nWidth ){
            w = colWidth[i];
          }else{
            w = 0;
          }
          if( w==0 ){
            w = strlenChar(azCol[i] ? azCol[i] : "");
            if( w<10 ) w = 10;