/ Check-in [ea141a9b]
Login

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

Overview
Comment:Adjust the command-line shell EXPLAIN indentation logic to handle the second loop of an UPDATE that reads out a RowSet.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ea141a9b87dbb5fa1402bf7f6e36e89cc9de3cb3
User & Date: drh 2013-11-14 23:59:33
Context
2013-11-15
03:16
Another adjustment to the EXPLAIN indentation logic, in order to deal with the sorter loop on a CREATE INDEX statement. check-in: cbe85cc2 user: drh tags: trunk
01:10
Rework the logic that factors constant expressions out of inner loops, making it both simpler and faster. check-in: 8dc5c76c user: drh tags: expr-codegen-enhancement
2013-11-14
23:59
Adjust the command-line shell EXPLAIN indentation logic to handle the second loop of an UPDATE that reads out a RowSet. check-in: ea141a9b user: drh tags: trunk
19:34
Remove an unused local variable. check-in: 10d59226 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.

  1169   1169   **
  1170   1170   ** The indenting rules are:
  1171   1171   **
  1172   1172   **     * For each "Next", "Prev", "VNext" or "VPrev" instruction, indent
  1173   1173   **       all opcodes that occur between the p2 jump destination and the opcode
  1174   1174   **       itself by 2 spaces.
  1175   1175   **
  1176         -**     * For each "Goto", if the jump destination is a "Yield", "SeekGt",
  1177         -**       or "SeekLt" instruction that occurs earlier in the program than
  1178         -**       the Goto itself, indent all opcodes between the earlier instruction
         1176  +**     * For each "Goto", if the jump destination is earlier in the program
         1177  +**       and ends on one of:
         1178  +**          Yield  SeekGt  SeekLt  RowSetRead
         1179  +**       then indent all opcodes between the earlier instruction
  1179   1180   **       and "Goto" by 2 spaces.
  1180   1181   */
  1181   1182   static void explain_data_prepare(struct callback_data *p, sqlite3_stmt *pSql){
  1182   1183     const char *zSql;               /* The text of the SQL statement */
  1183   1184     const char *z;                  /* Used to check if this is an EXPLAIN */
  1184   1185     int *abYield = 0;               /* True if op is an OP_Yield */
  1185   1186     int nAlloc = 0;                 /* Allocated size of p->aiIndent[], abYield */
  1186   1187     int iOp;
  1187   1188   
  1188   1189     const char *azNext[] = { "Next", "Prev", "VPrev", "VNext", 0 };
  1189         -  const char *azYield[] = { "Yield", "SeekLt", "SeekGt", 0 };
         1190  +  const char *azYield[] = { "Yield", "SeekLt", "SeekGt", "RowSetRead", 0 };
  1190   1191     const char *azGoto[] = { "Goto", 0 };
  1191   1192   
  1192   1193     /* Try to figure out if this is really an EXPLAIN statement. If this
  1193   1194     ** cannot be verified, return early.  */
  1194   1195     zSql = sqlite3_sql(pSql);
  1195   1196     if( zSql==0 ) return;
  1196   1197     for(z=zSql; *z==' ' || *z=='\t' || *z=='\n' || *z=='\f' || *z=='\r'; z++);