Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query does not return matching results when comparing 2 columns in Where clause and using InMemoryAdapter #379

Open
wmekal opened this issue Nov 28, 2015 · 0 comments

Comments

@wmekal
Copy link

wmekal commented Nov 28, 2015

Hi,

I've noticed that query comparing 2 columns in Where clause is not returning matching results, when using InMemoryAdapter, which hurts me in my unit tests.
I've checked it with real db (mysql in my case) and it works correctly, so it looks it's only InMemoryAdapter issue.

I'm using version 0.19.
Below, you can find a unit test, which demonstrates the bug.

        [Fact]
        public void SimpleData_When2ColumnsAreComparedInWhere_FindsExpectedRow()
        {
            Database.UseMockAdapter(new InMemoryAdapter());
            var db = Database.Open();
            db.Translations.Insert(
                Text: "some text",
                Language: "pl",
                OriginalLanguage: "pl"
            );

            var result = db.Translations
                .All()
                .Where(db.Translations.Language == db.Translations.OriginalLanguage);

            Assert.Equal(1, result.Count());
        }
wmekal added a commit to wmekal/Simple.Data that referenced this issue Nov 28, 2015
Added support for comparing 2 columns in FindAll/Where in InMemoryAdapter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant