You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have run into some unexpected behavior of SqlBuilder.
When I create sql builder from scratch, sometimes it returns empty group by / having clauses from ToSqlString() method.
"SELECT [LocalizedContentItemIndex_a1].[LocalizationSet] FROM [LocalizedContentItemIndex] AS [b] WHERE [b].[Culture] = 'cs-cz' AND [b].[Published] = 1 AND [b].[Published] = 1 AND [LocalizedContentItemIndex_a1].[LocalizationSet] = [b].[LocalizationSet] GROUP BY HAVING "
It can be fixed by calling ClearGroupBy(), which sets internal _group and _having property to null instead of empty array.
I do not understand why it happens, as it does happens unpredictably.
Here is full code:
It seems that it happens always when sqlBuilder object is viewed in debugger
Fix could be using Count instead of null comparison here
I have run into some unexpected behavior of SqlBuilder.
When I create sql builder from scratch, sometimes it returns empty group by / having clauses from ToSqlString() method.
"SELECT [LocalizedContentItemIndex_a1].[LocalizationSet] FROM [LocalizedContentItemIndex] AS [b] WHERE [b].[Culture] = 'cs-cz' AND [b].[Published] = 1 AND [b].[Published] = 1 AND [LocalizedContentItemIndex_a1].[LocalizationSet] = [b].[LocalizationSet] GROUP BY HAVING "
It can be fixed by calling ClearGroupBy(), which sets internal _group and _having property to null instead of empty array.
I do not understand why it happens, as it does happens unpredictably.
Here is full code:
It seems that it happens always when sqlBuilder object is viewed in debugger
Fix could be using Count instead of null comparison here
yessql/src/YesSql.Core/Sql/SqlBuilder.cs
Line 383 in 01fea28
The text was updated successfully, but these errors were encountered: