This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Only seen using the Access.Database connector. The bug causes Query Folding to erroneously add the condition "where 0 = 1" to the SQL query so no rows are returned.
To reproduce the issue:
The incorrectly folded query looks like the below. The error is on the last line, "where 0 = 1"
select [_].[ID],
[_].[Title],
[_].[Custom]
from
(
select [_].[ID] as [ID],
[_].[Title] as [Title],
switch(
[_].[ID] MOD 2 = 0 and [_].[ID] MOD 2 is not null, true,
1, false
) as [Custom]
from [Table1] as [_]
) as [_]
where 0 = 1
If you use any values other than 0 for false and -1 for true, the query will fold correctly, e.g:
select [_].[ID],
[_].[Title],
[_].[Custom]
from
(
select [_].[ID] as [ID],
[_].[Title] as [Title],
switch(
[_].[ID] MOD 2 = 0 and [_].[ID] MOD 2 is not null, -2,
1, -1
) as [Custom]
from [Table1] as [_]
) as [_]
where [_].[Custom] = -1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.