SQLite

Check-in [f2504089df]
Login

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

Overview
Comment:Do not mark the ephemeral tables used to hold the RHS of IN clauses as unordered because the NGQP will use those ephemeral tables to help order the output. This is not an issue for standard SQLite since ephemeral tables there are always ordered, regardless of the hint. It only affects systems that substitute an alternative storage engine.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f2504089df0bf4011864e67825b37f6aa3d03458
User & Date: drh 2014-02-04 23:45:45.488
Context
2014-02-05
11:05
In the Win32 VFS, the winSysInfo variable should be static. (check-in: 4a4dd371a7 user: mistachkin tags: trunk)
2014-02-04
23:45
Do not mark the ephemeral tables used to hold the RHS of IN clauses as unordered because the NGQP will use those ephemeral tables to help order the output. This is not an issue for standard SQLite since ephemeral tables there are always ordered, regardless of the hint. It only affects systems that substitute an alternative storage engine. (check-in: f2504089df user: drh tags: trunk)
20:46
Remove the SF_Materialize flag from the SELECT object as it does not accomplish anything useful. (check-in: 65d5dcddbd user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/expr.c.
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
      ** SELECT... statement are columns, then numeric affinity is used
      ** if either column has NUMERIC or INTEGER affinity. If neither
      ** 'x' nor the SELECT... statement are columns, then numeric affinity
      ** is used.
      */
      pExpr->iTable = pParse->nTab++;
      addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pExpr->iTable, !isRowid);
      if( rMayHaveNull==0 ) sqlite3VdbeChangeP5(v, BTREE_UNORDERED);
      pKeyInfo = isRowid ? 0 : sqlite3KeyInfoAlloc(pParse->db, 1, 1);

      if( ExprHasProperty(pExpr, EP_xIsSelect) ){
        /* Case 1:     expr IN (SELECT ...)
        **
        ** Generate code to write the results of the select into the temporary
        ** table allocated and opened above.







<







1759
1760
1761
1762
1763
1764
1765

1766
1767
1768
1769
1770
1771
1772
      ** SELECT... statement are columns, then numeric affinity is used
      ** if either column has NUMERIC or INTEGER affinity. If neither
      ** 'x' nor the SELECT... statement are columns, then numeric affinity
      ** is used.
      */
      pExpr->iTable = pParse->nTab++;
      addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pExpr->iTable, !isRowid);

      pKeyInfo = isRowid ? 0 : sqlite3KeyInfoAlloc(pParse->db, 1, 1);

      if( ExprHasProperty(pExpr, EP_xIsSelect) ){
        /* Case 1:     expr IN (SELECT ...)
        **
        ** Generate code to write the results of the select into the temporary
        ** table allocated and opened above.