/ Check-in [41c27bc0]
Login

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

Overview
Comment:Improved optimizations of views as the right operand of a LEFT JOIN.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 41c27bc0ff1d3135cdb6273ede4595f5bb0c0e1e1d470ea1633cb525674cf431
User & Date: drh 2017-04-18 11:20:19
References
2020-02-22
13:07 Fixed ticket [aa437869]: sqlite3.c:87338: int sqlite3VdbeExec(Vdbe *): Assertion `sqlite3BtreeCursorIsValid(pCrsr)' failed. plus 6 other changes (artifact: 9fee2067 user: drh)
2019-12-18
20:51
Continue to back away from the LEFT JOIN optimization of check-in [41c27bc0ff1d3135] by disallowing query flattening if the outer query is DISTINCT. Without this fix, if an index scan is run on the table within the view on the right-hand side of the LEFT JOIN, stale result registers might be accessed yielding incorrect results, and/or an OP_IfNullRow opcode might be invoked on the un-opened table, resulting in a NULL-pointer dereference. This problem was found by the Yongheng and Rui fuzzer. (check-in: 86297431 user: drh tags: trunk)
2017-07-29
03:26 New ticket [de3403bf] Column name shift due to LEFT JOIN query flattening. (artifact: e6b7df69 user: drh)
2017-06-20
16:15 New ticket [892fc34f] Incorrect query result when a LEFT JOIN subquery is flattened. (artifact: d28d6544 user: drh)
Context
2017-04-18
13:50
Use sqlite3_table_column_metadata() instead of a SELECT statement to check for the existence of a %_stat table in fts3. This leads to smaller and easier to test code. (check-in: dc2a4802 user: dan tags: trunk)
11:20
Improved optimizations of views as the right operand of a LEFT JOIN. (check-in: 41c27bc0 user: drh tags: trunk)
05:49
Refactor the fts3ColumnMethod() function so that all branches can be covered. (check-in: e47fdb49 user: dan tags: trunk)
2017-04-14
19:03
Add the TK_IF_NULL_ROW opcode to deal with non-NULL result columns in the result set of a view or subquery on the RHS of a LEFT JOIN that gets flattened. (Closed-Leaf check-in: 3a5860d8 user: drh tags: left-join-view)
Changes
Unified Diffs Side-by-Side Diffs Patch

Changes to src/expr.c.

Changes to src/parse.y.

Changes to src/select.c.

Changes to src/treeview.c.

Changes to src/vdbe.c.

Changes to src/where.c.

Changes to tool/addopcodes.tcl.