Page 1 of 1

Bug: Entity Framework keyword column name not escaped

Posted: Tue 22 Jun 2010 12:10
by ivanz
Hello,

I am evaluating the MySql provider for Entity Framework, but I have hit a bug which doesn't allow me to finish my testings. One of the tables in the DB I am using has a column named "level". This however appears to be a reserved keyword, which isn't escaped in the query leading to an SQL error and an EntityCommandExecutionException:

Code: Select all

SELECT 
Extent1.id AS id, 
Extent1.test_id AS test_id, 
Extent1.name AS name, 
Extent1.release AS release, 
Extent1.level AS level,                 <---- ### HERE ###
Extent1.state_id AS state_id, 
Extent1.completed_shifts AS completed_shifts, 
Extent1.`delete` AS `delete`
FROM mydb.mytable AS Extent1
WHERE Extent1.test_id = :EntityKeyValue1
I can't change the database, because I don't own it, so can someone provide a fix or a workaround?

The exception is:

Code: Select all

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'release, 
Extent1.level AS level, 
Extent1.state_id AS state_id, 
Extent1.com' at line 5


   at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
   at System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
   at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
   at System.Data.Objects.ObjectQuery`1.Execute(MergeOption mergeOption)
   at System.Data.Objects.DataClasses.EntityCollection`1.Load(List`1 collection, MergeOption mergeOption)
   at System.Data.Objects.DataClasses.EntityCollection`1.Load(MergeOption mergeOption)
   at System.Data.Objects.DataClasses.RelatedEnd.Load()
   at System.Data.Objects.DataClasses.RelatedEnd.DeferredLoad()
   at System.Data.Objects.DataClasses.EntityCollection`1.GetEnumerator()

Posted: Wed 23 Jun 2010 08:10
by AndreyR
Thank you for the report, we are investigating the issue.
I will let you know about the results of our investigation.

Posted: Wed 30 Jun 2010 12:02
by ivanz
Hi,

Is there any update on this issue? (sorry for being impatient)

Posted: Thu 01 Jul 2010 12:36
by AndreyR
Our investigation is in progress. I will post here as soon as the problem is fixed.

Posted: Tue 06 Jul 2010 10:18
by AndreyR
The problem is fixed. The new build will be available this week.

Posted: Thu 08 Jul 2010 12:23
by ivanz
Great, but my trial has expired meanwhile and due to the bug I haven't really been able to try out dotConnect for MySQL. Can I get a trial extension, please?

Posted: Thu 08 Jul 2010 13:35
by AndreyR
You can download the 5.80.146 build of dotConnect for MySQL with prolonged evaluation using this link.

Posted: Thu 08 Jul 2010 15:10
by ivanz
AndreyR wrote:You can download the 5.80.146 build of dotConnect for MySQL with prolonged evaluation using this link.
Thanks, but this is dotConnect Oracle instead of dotConnect MySQL.

Posted: Fri 09 Jul 2010 13:26
by AndreyR
Sorry, here is the correct link.