I think I found a query bug of v3.0.5

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
mmp7uk
Posts: 5
Joined: Mon 26 Sep 2011 16:17

I think I found a query bug of v3.0.5

Post by mmp7uk » Fri 07 Oct 2011 06:23

im using the newest ver 3.0.5

I execute a query twice to mySql DB with different parameters.
i found that if my first parameter is empty, then the second query parameter will be empty too, even i pass a non-empty string into second query.

for example:

my test code:

Code: Select all

                TestContext.TestDataContext con = new TestContext.TestDataContext();
                con.Log = Console.Out;

                var a = con.Testtables.FirstOrDefault(x => x.Name == "");
                var b = con.Testtables.FirstOrDefault(x => x.Name == "abc");
generated queries:

Code: Select all

SELECT t1.Id, t1.Name
FROM test.testtable t1
WHERE t1.Name = :p0 LIMIT 1
-- p0: Input VarChar (Size = 0; DbType = AnsiString) []
-- Context: Devart.Data.MySql.Linq.Provider.MySqlDataProvider Model: an Build: 3.0.5.0

SELECT t1.Id, t1.Name
FROM test.testtable t1
WHERE t1.Name = :p0 LIMIT 1
-- p0: Input VarChar (Size = 0; DbType = AnsiString) []
-- Context: Devart.Data.MySql.Linq.Provider.MySqlDataProvider Model: an Build: 3.0.5.0
you can see that the parameters are empty!

but if i pass a non-empty string into first query, then both queries work well.

Code: Select all

                TestContext.TestDataContext con = new TestContext.TestDataContext();
                con.Log = Console.Out;

                var a = con.Testtables.FirstOrDefault(x => x.Name == "cde");
                var b = con.Testtables.FirstOrDefault(x => x.Name == "abc");
generated queries:

Code: Select all

SELECT t1.Id, t1.Name
FROM test.testtable t1
WHERE t1.Name = :p0 LIMIT 1
-- p0: Input VarChar (Size = 3; DbType = AnsiString) [cde]
-- Context: Devart.Data.MySql.Linq.Provider.MySqlDataProvider Model: an Build: 3.0.5.0

SELECT t1.Id, t1.Name
FROM test.testtable t1
WHERE t1.Name = :p0 LIMIT 1
-- p0: Input VarChar (Size = 3; DbType = AnsiString) [abc]
-- Context: Devart.Data.MySql.Linq.Provider.MySqlDataProvider Model: an Build: 3.0.5.0
is this a new bug?

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Mon 10 Oct 2011 13:23

Thank you for your report, we have reproduced and fixed this problem. The fix will be available in the nearesst build, which we plan to release in about a week.

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Thu 17 Nov 2011 09:18

The fix for this issue is available in the latest 3.0.14 build of LinqConnect. The new build can be downloaded from
http://www.devart.com/linqconnect/download.html
(the trial and free versions) or from Registered Users' Area (for users with active subscription only).

For the detailed information about the fixes and improvements available in LinqConnect 3.0.14, please refer to
http://www.devart.com/forums/viewtopic.php?t=22548

Post Reply