Database: fixed bug when subselect table have multi column primary key [Closes #288]
Database: fixed work with undefined primary key [Refs #288]