Bug #76466 | Error parsing boolean's on eager load (EF) | ||
---|---|---|---|
Submitted: | 23 Mar 2015 23:09 | Modified: | 16 Oct 2017 14:31 |
Reporter: | Emanuel Gianico | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | Connector / NET | Severity: | S3 (Non-critical) |
Version: | 6.9.6 | OS: | Windows |
Assigned to: | CPU Architecture: | Any | |
Tags: | EF, entity framework |
[23 Mar 2015 23:09]
Emanuel Gianico
[23 Mar 2015 23:12]
Emanuel Gianico
Title change in order to make it more clear.
[23 Mar 2015 23:16]
Emanuel Gianico
My entities: Public Class Estudio Public Overridable Property Id As Integer Public Overridable Property Razon_social As String Public Overridable Property Cuit As String Public Overridable Property Fecha_alta As DateTime Public Overridable Property Id_base As Integer Public Overridable Property Usuarios As ICollection(Of Usuario) Public Property TipoGestiones As ICollection(Of EstudioTipoGestion) Public Property Filtros As ICollection(Of EstudioFiltro) Public Property Contactos As ICollection(Of EstudioContacto) Public Property Sujetos As ICollection(Of Entities.Sujeto) Public Property Resultados As ICollection(Of EstudioResultado) Public Overridable Property Categorias As ICollection(Of EstudioCategoria) Public Overridable Property Bancos As ICollection(Of EmpresaMedioPago) Public Overridable Property MediosPago As ICollection(Of MedioPago) Public Overridable Property CarteraQuita As ICollection(Of EstudioCarteraQuita) Public Overridable Property Rrpp As ICollection(Of EstudioPersona) Public Overridable Property RrppTelefonos As ICollection(Of EstudioTelefono) End Class Public Class EstudioResultado Public Overridable Property Id As Integer Public Overridable Property Nombre As String Public Overridable Property Tipo As String Public Overridable Property Clase As String Public Overridable Property Id_estudio As Integer Public Overridable Property Id_codigo As Integer Public Overridable Property Id_accion As Integer Public Overridable Property Id_categoria As Integer Public Overridable Property Filtro As EstudioFiltro Public Overridable Property Accion As SujetoAccion Public Overridable Property Categoria As EstudioCategoria Public Overridable Property Contactos As ICollection(Of EstudioContacto) Public Overridable Property Resultados As ICollection(Of EstudioResultado) End Class Public Class EstudioContacto Public Overridable Property Id As Integer Public Overridable Property Nombre As String Public Overridable Property Id_estudio As Integer Public Overridable Property Contacto As Boolean Public Overridable Property No_contacto_required As Boolean Public Overridable Property Sistema As Boolean Public Overridable Property Puntaje As Integer Public Overridable Property Color As String Public Overridable Property Resultados As ICollection(Of EstudioResultado) Public Overridable Property TipoGestiones As ICollection(Of EstudioTipoGestion) End Class Public Class EstudioTipoGestion Public Overridable Property Id As Integer Public Overridable Property Nombre As String Public Overridable Property Id_estudio As Integer Public Overridable Property Elegible As Boolean Public Overridable Property Llamada As Boolean Public Overridable Property Plan As Boolean Public Overridable Property Llamada_saliente As Boolean Public Overridable Property Sistema As Boolean Public Overridable Property Contactos As ICollection(Of EstudioContacto) End Class
[30 Mar 2015 5:57]
Chiranjeevi Battula
Hello Emanuel Gianico, Thank you for the bug report. I tried to reproduce the steps at my end using VB 2013, MySQL Connector/Net 6.9.6 and EntityFramework(6.1.3), but couldn't trace out any issue with EagerLoad. Could you please list out the steps you tried out at your end? Please provide repeatable steps for us to confirm this issue at our end. Thanks, Chiranjeevi.
[30 Mar 2015 19:02]
Emanuel Gianico
Yes, first thing you need is the sql dump to create and populate the test database. http://pastebin.com/AJp0T3B9 Second, here you have the Test Project (A simple winforms application with everything configured (Last mysql and mysql.entity (6.9.6) from nuget, entity framework 6.1.3, etc). Just remember to change the connectionstring from App.config. https://drive.google.com/file/d/0B6HefFqn_h-FUzZJbDFZeTI1ZGc/view?usp=sharing
[2 Apr 2015 7:39]
Chiranjeevi Battula
Hello Emanuel Gianico, Thank you for your feedback. Verified this behavior on VB 2013, MySQL Connector/Net 6.9.6 and EntityFramework(6.1.3). Thanks, Chiranjeevi.
[2 Apr 2015 7:39]
Chiranjeevi Battula
Generated SQL: SELECT `UnionAll2`.`C2` AS `C1`, `UnionAll2`.`C3` AS `C2`, `UnionAll2`.`C4` AS `C3`, `UnionAll2`.`C5` AS `C4`, `UnionAll2`.`C6` AS `C5`, `UnionAll2`.`C7` AS `C6`, `UnionAll2`.`C1` AS `C7`, `UnionAll2`.`C8`, `UnionAll2`.`C9`, `UnionAll2`.`C10`, `UnionAll2`.`C11`, `UnionAll2`.`C12`, `UnionAll2`.`C13`, `UnionAll2`.`C14`, `UnionAll2`.`C15`, `UnionAll2`.`C16`, `UnionAll2`.`C17`, `UnionAll2`.`C18`, `UnionAll2`.`C19`, `UnionAll2`.`C20`, `UnionAll2`.`C21`, `UnionAll2`.`C22`, `UnionAll2`.`C23`, `UnionAll2`.`C24`, `UnionAll2`.`C25`, `UnionAll2`.`C26`, `UnionAll2`.`C27`, `UnionAll2`.`C28` FROM ((SELECT `UnionAll1`.`C1`, `UnionAll1`.`Id` AS `C2`, `UnionAll1`.`Id1` AS `C3`, `UnionAll1`.`Razon_social` AS `C4`, `UnionAll1`.`Cuit` AS `C5`, `UnionAll1`.`Fecha_alta` AS `C6`, `UnionAll1`.`Id_base` AS `C7`, `UnionAll1`.`Id2` AS `C8`, `UnionAll1`.`Nombre` AS `C9`, `UnionAll1`.`Tipo` AS `C10`, `UnionAll1`.`Clase` AS `C11`, `UnionAll1`.`Id_codigo` AS `C12`, `UnionAll1`.`Id_accion` AS `C13`, `UnionAll1`.`Id_categoria` AS `C14`, `UnionAll1`.`C2` AS `C15`, `UnionAll1`.`C3` AS `C16`, `UnionAll1`.`C4` AS `C17`, `UnionAll1`.`C5` AS `C18`, `UnionAll1`.`C6` AS `C19`, `UnionAll1`.`C7` AS `C20`, `UnionAll1`.`C8` AS `C21`, `UnionAll1`.`C9` AS `C22`, `UnionAll1`.`C10` AS `C23`, `UnionAll1`.`C11` AS `C24`, `UnionAll1`.`C12` AS `C25`, `UnionAll1`.`C13` AS `C26`, `UnionAll1`.`C14` AS `C27`, `UnionAll1`.`C15` AS `C28` FROM ((SELECT CASE WHEN (`Join1`.`id_estudio` IS NULL) THEN (NULL) ELSE (1) END AS `C1`, `Extent1`.`Id`, `Extent1`.`Id` AS `Id1`, `Extent1`.`Razon_social`, `Extent1`.`Cuit`, `Extent1`.`Fecha_alta`, `Extent1`.`Id_base`, `Join1`.`Id` AS `Id2`, `Join1`.`Nombre`, `Join1`.`Tipo`, `Join1`.`Clase`, `Join1`.`Id_codigo`, `Join1`.`Id_accion`, `Join1`.`Id_categoria`, NULL AS `C2`, NULL AS `C3`, NULL AS `C4`, NULL AS `C5`, NULL AS `C6`, NULL AS `C7`, NULL AS `C8`, NULL AS `C9`, NULL AS `C10`, NULL AS `C11`, NULL AS `C12`, NULL AS `C13`, NULL AS `C14`, NULL AS `C15` FROM `estudio` AS `Extent1` LEFT OUTER JOIN (SELECT `Extent2`.`id_estudio`, `Extent2`.`id_resultado`, `Extent3`.`Id`, `Extent3`.`Nombre`, `Extent3`.`Tipo`, `Extent3`.`Clase`, `Extent3`.`Id_codigo`, `Extent3`.`Id_accion`, `Extent3`.`Id_categoria` FROM `estudio_resultado_estudio` AS `Extent2` INNER JOIN `estudio_resultado` AS `Extent3` ON `Extent3`.`Id` = `Extent2`.`id_resultado`) AS `Join1` ON `Extent1`.`Id` = `Join1`.`id_estudio` WHERE 1 = `Extent1`.`Id`) UNION ALL (SELECT 2 AS `C1`, `Extent4`.`Id`, `Extent4`.`Id` AS `Id1`, `Extent4`.`Razon_social`, `Extent4`.`Cuit`, `Extent4`.`Fecha_alta`, `Extent4`.`Id_base`, NULL AS `C2`, NULL AS `C3`, NULL AS `C4`, NULL AS `C5`, NULL AS `C6`, NULL AS `C7`, NULL AS `C8`, `Join3`.`Id` AS `Id2`, `Join3`.`Nombre`, `Join3`.`Contacto`, `Join3`.`No_contacto_required`, `Join3`.`Sistema`, `Join3`.`Puntaje`, `Join3`.`Color`, NULL AS `C9`, NULL AS `C10`, NULL AS `C11`, NULL AS `C12`, NULL AS `C13`, NULL AS `C14`, NULL AS `C15` FROM `estudio` AS `Extent4` INNER JOIN (SELECT `Extent5`.`id_estudio`, `Extent5`.`id_contacto`, `Extent6`.`Id`, `Extent6`.`Nombre`, `Extent6`.`Contacto`, `Extent6`.`No_contacto_required`, `Extent6`.`Sistema`, `Extent6`.`Puntaje`, `Extent6`.`Color` FROM `estudio_contacto_estudio` AS `Extent5` INNER JOIN `estudio_contacto` AS `Extent6` ON `Extent6`.`Id` = `Extent5`.`id_contacto`) AS `Join3` ON `Extent4`.`Id` = `Join3`.`id_estudio` WHERE 1 = `Extent4`.`Id`)) AS `UnionAll1`) UNION ALL (SELECT 3 AS `C1`, `Extent7`.`Id`, `Extent7`.`Id` AS `Id1`, `Extent7`.`Razon_social`, `Extent7`.`Cuit`, `Extent7`.`Fecha_alta`, `Extent7`.`Id_base`, NULL AS `C2`, NULL AS `C3`, NULL AS `C4`, NULL AS `C5`, NULL AS `C6`, NULL AS `C7`, NULL AS `C8`, NULL AS `C9`, NULL AS `C10`, NULL AS `C11`, NULL AS `C12`, NULL AS `C13`, NULL AS `C14`, NULL AS `C15`, `Join5`.`Id` AS `Id2`, `Join5`.`Nombre`, `Join5`.`Elegible`, `Join5`.`Llamada`, `Join5`.`Plan`, `Join5`.`Llamada_saliente`, `Join5`.`Sistema` FROM `estudio` AS `Extent7` INNER JOIN (SELECT `Extent8`.`id_estudio`, `Extent8`.`id_tipo_gestion`, `Extent9`.`Id`, `Extent9`.`Nombre`, `Extent9`.`Elegible`, `Extent9`.`Llamada`, `Extent9`.`Plan`, `Extent9`.`Llamada_saliente`, `Extent9`.`Sistema` FROM `estudio_tipo_gestion_estudio` AS `Extent8` INNER JOIN `estudio_tipo_gestion` AS `Extent9` ON `Extent9`.`Id` = `Extent8`.`id_tipo_gestion`) AS `Join5` ON `Extent7`.`Id` = `Join5`.`id_estudio` WHERE 1 = `Extent7`.`Id`)) AS `UnionAll2` ORDER BY `UnionAll2`.`C3` ASC , `UnionAll2`.`C1` ASC
[2 Apr 2015 7:40]
Chiranjeevi Battula
Error message screenshot
Attachment: 76466.PNG (image/png, text), 85.48 KiB.
[22 Apr 2015 12:21]
Wouter Dingemanse
How can we solve this?
[5 Jun 2015 15:13]
Eskild D
I've run into this bug as well. Is there a workaround? The strange thing is that it doesn't happen locally but on the web server it fails :/
[20 Jul 2015 12:41]
Keymer Leon
Greetings I am experiencing the same problem. You have found a solution for this problem?
[25 Nov 2015 11:03]
Eskild D
This bug is a show stopper when using ASP.NET OData (v4) Controllers where you don't have direct control over the query. And it happens quite frequent... I noticed that it starts to fail when the query joins multiple nested entities. So a query like this is more likely to not work, then work: /odata/...?$expand=Foo($expand=Bar($expand=Baz)),X($expand=Y($expand=Z))
[30 Nov 2015 5:50]
Chiranjeevi Battula
Note : http://bugs.mysql.com/bug.php?id=79448 marked as duplicate of this one.
[2 Dec 2015 6:36]
epep eppe
I think the severity of this bug should be increased as it basically forbids the usage of multiple includes.
[2 Dec 2015 7:44]
Wouter Dingemanse
@epep eppe Multiple includes work fine for me. Its only on certain conditions that it isnt working. I'm thinking when there's enums or booleans involved. This works: .Include(s => s.Distribution) .Include(s => s.Category) .Include(s => s.Country) While this doesnt: .Include(s => s.Distribution) .Include(s => s.Distribution.SiteDistributions) .Include(s => s.Category) .Include(s => s.Country)
[8 Mar 2016 11:33]
Wouter Dingemanse
Found the solution (at least where booleans are involved) here: http://stackoverflow.com/a/31534825/141243 I added this convention to make it work: public class BoolConvention : Convention { public BoolConvention() { Properties<bool>() .Configure(p => p.HasColumnType("bit")); } }
[1 Jul 2016 12:57]
Chiranjeevi Battula
http://bugs.mysql.com/bug.php?id=68886 marked as duplicate of this one.
[28 Sep 2017 7:45]
Wolfgang Jacques
Hello everyone, in the meantime we are at .NET Connector 6.9.9 and the problem persists. Any chances of fixing?
[16 Oct 2017 14:31]
Emanuel Gianico
Two years and the bug isn't fixed yet. Glad i moved to NHibernate.
[5 Dec 2017 23:29]
anchit pancholi
i am not finding any work around for slimier issue, it is going to be fix in next version (7.x or 8.x)?
[19 Feb 2018 8:31]
Wouter Dingemanse
I stopped using MySql, but for anyone coming here I would advise using this: https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql I didnt test it, so if this helps you please confirm here, so everyone can benefit.
[6 Nov 2018 0:38]
Greg Bennett
I'm still getting a similar result. Is this fixed or is there a workaround?
[21 May 2019 10:44]
Manikandan Nagarajan
Any update on this issue. I still face this issue with the following combination, MySql.Data - 6.10.8 EntityFramework - 6.2.0