Fossil

Diff
Login

Diff

Differences From Artifact [722cdb2de9]:

To Artifact [62e4e4943e]:


3238
3239
3240
3241
3242
3243
3244

3245
3246

3247
3248
3249

3250
3251

3252
3253
3254
3255
3256
3257
3258
  switch( p->spec.eStyle ){
    case QRF_STYLE_Count: {
      sqlite3_str_appendf(p->pOut, "%lld\n", p->nRow);
      qrfWrite(p);
      break;
    }
    case QRF_STYLE_Json: {

      sqlite3_str_append(p->pOut, "}]\n", 3);
      qrfWrite(p);

      break;
    }
    case QRF_STYLE_JObject: {

      sqlite3_str_append(p->pOut, "}\n", 2);
      qrfWrite(p);

      break;
    }
    case QRF_STYLE_Line: {
      if( p->u.sLine.azCol ) sqlite3_free(p->u.sLine.azCol);
      break;
    }
    case QRF_STYLE_Stats:







>
|
|
>



>
|
|
>







3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
  switch( p->spec.eStyle ){
    case QRF_STYLE_Count: {
      sqlite3_str_appendf(p->pOut, "%lld\n", p->nRow);
      qrfWrite(p);
      break;
    }
    case QRF_STYLE_Json: {
      if( p->nRow>0 ){
        sqlite3_str_append(p->pOut, "}]\n", 3);
        qrfWrite(p);
      }
      break;
    }
    case QRF_STYLE_JObject: {
      if( p->nRow>0 ){
        sqlite3_str_append(p->pOut, "}\n", 2);
        qrfWrite(p);
      }
      break;
    }
    case QRF_STYLE_Line: {
      if( p->u.sLine.azCol ) sqlite3_free(p->u.sLine.azCol);
      break;
    }
    case QRF_STYLE_Stats:
24039
24040
24041
24042
24043
24044
24045

24046
24047
24048
24049
24050
24051
24052
24053

24054
24055
24056
24057
24058
24059
24060


/*
** Clear a display mode, freeing any allocated memory that it
** contains.
*/
static void modeFree(Mode *p){

  free(p->spec.aWidth);
  free(p->spec.aAlign);
  free(p->spec.zColumnSep);
  free(p->spec.zRowSep);
  free(p->spec.zTableName);
  free(p->spec.zNull);
  memset(p, 0, sizeof(*p));
  p->spec.iVersion = 1;

}

/*
** Duplicate Mode pSrc into pDest.  pDest is assumed to be
** uninitialized prior to invoking this routine.
*/
static void modeDup(Mode *pDest, Mode *pSrc){







>








>







24043
24044
24045
24046
24047
24048
24049
24050
24051
24052
24053
24054
24055
24056
24057
24058
24059
24060
24061
24062
24063
24064
24065
24066


/*
** Clear a display mode, freeing any allocated memory that it
** contains.
*/
static void modeFree(Mode *p){
  u8 autoExplain = p->autoExplain;
  free(p->spec.aWidth);
  free(p->spec.aAlign);
  free(p->spec.zColumnSep);
  free(p->spec.zRowSep);
  free(p->spec.zTableName);
  free(p->spec.zNull);
  memset(p, 0, sizeof(*p));
  p->spec.iVersion = 1;
  p->autoExplain = autoExplain;
}

/*
** Duplicate Mode pSrc into pDest.  pDest is assumed to be
** uninitialized prior to invoking this routine.
*/
static void modeDup(Mode *pDest, Mode *pSrc){
32709
32710
32711
32712
32713
32714
32715
32716
32717
32718
32719
32720
32721
32722
32723
      zDiv = " UNION ALL ";
      if( sqlite3_stricmp(zDb, "main")==0 ){
        sqlite3_str_appendf(pSql,
            "SELECT shell_format_schema(shell_add_schema(sql,NULL,name),%d)",
            bIndent);
      }else{
        sqlite3_str_appendf(pSql,
            "SELECT shell_format_schema(shell_add_schema(sql,%Q,name),%d))",
            zDb, bIndent);
      }
      sqlite3_str_appendf(pSql,
         " AS sql, type, tbl_name, name, rowid, %d AS snum, %Q as sname",
         ++iSchema, zDb);
      sqlite3_str_appendf(pSql," FROM \"%w\".sqlite_schema", zDb);
    }







|







32715
32716
32717
32718
32719
32720
32721
32722
32723
32724
32725
32726
32727
32728
32729
      zDiv = " UNION ALL ";
      if( sqlite3_stricmp(zDb, "main")==0 ){
        sqlite3_str_appendf(pSql,
            "SELECT shell_format_schema(shell_add_schema(sql,NULL,name),%d)",
            bIndent);
      }else{
        sqlite3_str_appendf(pSql,
            "SELECT shell_format_schema(shell_add_schema(sql,%Q,name),%d)",
            zDb, bIndent);
      }
      sqlite3_str_appendf(pSql,
         " AS sql, type, tbl_name, name, rowid, %d AS snum, %Q as sname",
         ++iSchema, zDb);
      sqlite3_str_appendf(pSql," FROM \"%w\".sqlite_schema", zDb);
    }