Tests: Updated SQL and fixed tests
Tests: Added new database caching test (fail)
Database: fixed reinvalidating data in execute() state of execution.
Database: added test for caching joining column in case of empty join resultset
Database: fixed caching joining column in case of empty join resultset