Fixed erroneous source filter in SQLAlchemy.

Also added test cases for source filter. This fixed bug 1093580.

Change-Id: Ie3d99e7f27064f88196d6b0a7139fba36251b3c0
Merge "Fixed erroneous source filter in SQLAlchemy."