We had code for this, but the code had a fatal flaw: it tried to detect
a complex operation (an operation that needs projection), and return
false (no need for projection), for the others.
This is the exact opposite of what we should do: we should identify the
*simple* operations, and then return true (needs projection) for the
rest.
CAST is a special beast, since it is not a function, but rather, a
special opcode. Everything else above is the true just the same. But for
CAST, we have to do the extra work to capture it in the logical plan and
pass it down.
Fixes#3372Fixes#3370Fixes#3369
When adding tests for extensions, please follow these guidelines:
Tests that verify the internal logic or behavior of a particular extension should go into cli_tests/extensions.py.
Tests that verify how extensions interact with the database engine, such as virtual table handling, should be written
in TCL (see vtab.test as an example).
To check which extensions are available in TCL, or to add a new one, refer to the tester.tcl file and look at the extension_map.