About Connector/Net 6.4.3
Posted by:
tom tom
Date: September 22, 2011 02:28AM
我在使用EF+mysql6.0的时候,总是会报告一些无法解释的异常,非常灵异,就好像撞上鬼一样
例如 :
select tl.[CreatedTime],tl.[Creater],tl.[DefaultPicID],tl.[DescID],tl.[ID],tl.[LastUpDateTime],tl.[MOQ],
tl.[ProductID],tl.[SaleFlag],tl.[Version],tl.[GiftOnly],tul.[username],
(select value pi.[productcode] from trdbEntities.[productinfo] as pi where pi.[id]=tl.[productid]) as [productcode],
(select value pp.[filename] from trdbEntities.[productpic] as pp where pp.[id]=tl.[defaultpicid]) as [filename],
(select value pd.[title] from trdbEntities.[productdesc] as pd where pd.[id]=tl.[descid]) as [title]
from trdbEntities.[listing] as tl,trdbEntities.[userlogin] as tul
where tul.[sysid]=tl.[creater] and tl.[productid]=2 and tl.[version]!=-1 order by tl.[id] skip(0) limit(20)
select tl.[CreatedTime],tl.[Creater],tl.[DefaultPicID],tl.[DescID],tl.[ID],tl.[LastUpDateTime],tl.[MOQ],
tl.[ProductID],tl.[SaleFlag],tl.[Version],tl.[GiftOnly],tul.[username],
(select value pi.[productcode] from trdbEntities.[productinfo] as pi where pi.[id]=tl.[productid]) as [productcode],
(select value pp.[filename] from trdbEntities.[productpic] as pp where pp.[id]=tl.[defaultpicid]) as [filename],
(select value pd.[title] from trdbEntities.[productdesc] as pd where pd.[id]=tl.[descid]) as [title]
from trdbEntities.[listing] as tl,trdbEntities.[userlogin] as tul
where tul.[sysid]=tl.[creater] and 1=1 and tl.[version]!=-1 order by tl.[id] skip(0) limit(20)
两条esql仅仅只有一个条件的区别,前者异常,后者正常,
前者报告:"未将对象引用至实例"
[NullReferenceException: 未将对象引用设置到对象的实例。]
MySql.Data.Entity.SelectStatement.AddDefaultColumns(Scope scope) +169
MySql.Data.Entity.SelectStatement.Wrap(Scope scope) +37
MySql.Data.Entity.SelectGenerator.WrapJoinInputIfNecessary(InputFragment fragment, Boolean isRightPart) +54
我很烦躁! 求解释