Bug #73209 Bad SQL Query

Submitted: 5 Jul 2014 18:20 Modified: 29 Oct 2014 22:08
Reporter: Riyasat Ali Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:6.8 OS:Windows (8)
Assigned to: Assigned Account CPU Architecture:Any

[5 Jul 2014 18:20] Riyasat Ali
Description:
Hi, 
I have db which has around 400k records, I have created view in SQL with some joins, when I try to fetch data with that view I got query 
{SELECT
`Extent1`.`ParticipantName`, 
`Extent1`.`ParticipantFullAddress`, 
`Extent1`.`TeamNameWithoutSpaces`, 
`Extent1`.`idevent_participants`, 
`Extent1`.`EventId`, 
`Extent1`.`MainClass`, 
`Extent1`.`Subclass`, 
`Extent1`.`part_participantId`, 
`Extent1`.`eventTeamId`, 
`Extent1`.`Version`, 
`Extent1`.`IsDeleted`, 
`Extent1`.`DeletionDate`, 
`Extent1`.`OrderNumber`

FROM (SELECT
`participantfieldsdtoview`.`ParticipantName`, 
`participantfieldsdtoview`.`ParticipantFullAddress`, 
`participantfieldsdtoview`.`TeamNameWithoutSpaces`, 
`participantfieldsdtoview`.`idevent_participants`, 
`participantfieldsdtoview`.`EventId`, 
`participantfieldsdtoview`.`MainClass`, 
`participantfieldsdtoview`.`Subclass`, 
`participantfieldsdtoview`.`part_participantId`, 
`participantfieldsdtoview`.`eventTeamId`, 
`participantfieldsdtoview`.`Version`, 
`participantfieldsdtoview`.`IsDeleted`, 
`participantfieldsdtoview`.`DeletionDate`, 
`participantfieldsdtoview`.`OrderNumber`
FROM `participantfieldsdtoview` AS `participantfieldsdtoview`) AS `Extent1`}

Because of this I am getting Timeout Exception 

but when I use the same view in workbench it works perfectly, within 2 2nd display 1000 Rec.

SELECT * FROM participantfieldsdtoview 

How to repeat:
1 - Create View in DB
2 - Import in C# MVC project with Entity Framwork 5 DB first
3 - Make Query

var parts= _parts.GetAll()

Suggested fix:
it would be perfect to make query as simple as it is with some where clause if they are there

SELECT
`participantfieldsdtoview`.`ParticipantName`, 
`participantfieldsdtoview`.`ParticipantFullAddress`, 
`participantfieldsdtoview`.`TeamNameWithoutSpaces`, 
`participantfieldsdtoview`.`idevent_participants`, 
`participantfieldsdtoview`.`EventId`, 
`participantfieldsdtoview`.`MainClass`, 
`participantfieldsdtoview`.`Subclass`, 
`participantfieldsdtoview`.`part_participantId`, 
`participantfieldsdtoview`.`eventTeamId`, 
`participantfieldsdtoview`.`Version`, 
`participantfieldsdtoview`.`IsDeleted`, 
`participantfieldsdtoview`.`DeletionDate`, 
`participantfieldsdtoview`.`OrderNumber`
FROM `participantfieldsdtoview`
[29 Sep 2014 22:08] Fernando Gonzalez.Sanchez
Thank you for your bug report,

However, I cannot reproduce this, please provide a sample project that shows the problem, or at least sample query with code first model used, EF version, VS version and .NET version used.

This seems identical to
http://bugs.mysql.com/bug.php?id=65723

Which was already fixed (the scenarios documented there work fine now).

Thanks.
[29 Sep 2014 22:09] Fernando Gonzalez.Sanchez
And Connector/NET version used too, thanks : )
[30 Oct 2014 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.057 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.