Modified identity function to work with joined inheritance tables.
Added regression tests
Fix typo in test name
Merge pull request #691 from 51systems/master

IDENTITY function fix for Joined Inheritance