/ Changes On Branch EQP-improvements
Login

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

Changes In Branch EQP-improvements Excluding Merge-Ins

This is equivalent to a diff from 1ec339fd10 to 16c22ff818

2018-03-19
19:05
Enhance the command-line completion extension to return the names of triggers and views along with the names of tables. (check-in: 10e32204e1 user: drh tags: trunk)
16:59
Show symbolic SELECT names in EXPLAIN QUERY PLAN output when compiling with SQLITE_ENABLE_SELECTTRACE. (Leaf check-in: 16c22ff818 user: drh tags: EQP-improvements)
16:09
In the compile_options pragma, show the actual value of the SQLITE_ENABLE_CEROD compile-time option, if it exists. (check-in: 1ec339fd10 user: drh tags: trunk)
16:06
Improved ".selecttrace" output formatting. No changes in non-debug code. (check-in: 30704d2a52 user: drh tags: trunk)

Changes to src/expr.c.

2609
2610
2611
2612
2613
2614
2615






2616
2617
2618
2619
2620
2621
2622
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628







+
+
+
+
+
+







#ifndef SQLITE_OMIT_EXPLAIN
  if( pParse->explain==2 ){
    char *zMsg = sqlite3MPrintf(pParse->db, "EXECUTE %s%s SUBQUERY %d",
        jmpIfDynamic>=0?"":"CORRELATED ",
        pExpr->op==TK_IN?"LIST":"SCALAR",
        pParse->iNextSelectId
    );
#if SELECTTRACE_ENABLED
    if( ExprHasProperty(pExpr, EP_xIsSelect) && pExpr->x.pSelect!=0 ){
       zMsg = sqlite3MPrintf(pParse->db, "%z (%s)", zMsg,
                             pExpr->x.pSelect->zSelName);
    }
#endif
    sqlite3VdbeAddOp4(v, OP_Explain, pParse->iSelectId, 0, 0, zMsg, P4_DYNAMIC);
  }
#endif

  switch( pExpr->op ){
    case TK_IN: {
      int addr;                   /* Address of OP_OpenEphemeral instruction */

Changes to src/wherecode.c.

149
150
151
152
153
154
155




156

157
158
159
160
161
162
163
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168







+
+
+
+

+







    isSearch = (flags&(WHERE_BTM_LIMIT|WHERE_TOP_LIMIT))!=0
            || ((flags&WHERE_VIRTUALTABLE)==0 && (pLoop->u.btree.nEq>0))
            || (wctrlFlags&(WHERE_ORDERBY_MIN|WHERE_ORDERBY_MAX));

    sqlite3StrAccumInit(&str, db, zBuf, sizeof(zBuf), SQLITE_MAX_LENGTH);
    sqlite3StrAccumAppendAll(&str, isSearch ? "SEARCH" : "SCAN");
    if( pItem->pSelect ){
#if SELECTTRACE_ENABLED
      sqlite3XPrintf(&str, " SUBQUERY %d (%s)",
                     pItem->iSelectId, pItem->pSelect->zSelName);
#else
      sqlite3XPrintf(&str, " SUBQUERY %d", pItem->iSelectId);
#endif
    }else{
      sqlite3XPrintf(&str, " TABLE %s", pItem->zName);
    }

    if( pItem->zAlias ){
      sqlite3XPrintf(&str, " AS %s", pItem->zAlias);
    }