Sql generates without alias => produces exception "The multipart identifier "xxxxx.xxxx" could not be bound."

Posts   
 
    
OKP
User
Posts: 12
Joined: 03-Mar-2022
# Posted on: 24-Mar-2022 14:52:45   

Hi,

We use the latest version of llblgen (v5.9) with latest hotfix packages from nuget. The following occurs:

Llblgen query below. The bolded section is the part which somehow causes this error. If those are commented out the query generates ok.

PrefetchPath2 orderPrefetchPath = new PrefetchPath2(EntityType.OrdersEntity);  
IPrefetchPathElement2 billElement = orderPrefetchPath.Add(OrdersEntity.PrefetchPathBills);  
billElement.SubPath.Add(BillEntity.PrefetchPathCreditBills);       // <<
billElement.SubPath.Add(BillEntity.PrefetchPathTahits);  // <<
IRelationPredicateBucket filterBucket = new RelationPredicateBucket();
filterBucket.PredicateExpression.Add(OrdersFields.Nr >= fromOrderNr);  
filterBucket.PredicateExpression.Add(OrdersFields.Nr <= toOrderNr);  

llblgen generated query below. The bolded alias is not generated although it is used and that causes that exception in the thread title.

SELECT *
FROM [dbo].[TAHit] WHERE ( [dbo].[TAHit].[BILLNR] IN (SELECT [dbo].[Bill].[NR] AS [Nr] FROM [dbo].[Bill]
WHERE ( ( [**__LLBLPP**].[ORDERNR] IN (SELECT [dbo].[Orders].[NR] AS [Nr] FROM [dbo].[Orders]
WHERE ( ( [dbo].[Orders].[NR] >= @p1 AND [dbo].[Orders].[NR] <= @p2)))))))
Parameter: @p1 : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 621856.
Parameter: @p2 : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 724966.

This query is quite old and has not been modfied, it has worked with previous version (v5.2) ok. We migrated from 5.2 to 5.9. if this is a bug in the llblgen 5.9 we need it fixed asap.

Best Regards, OKP

(Edit: I've marked the 'bolded' lines with // << -- Otis)

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 24-Mar-2022 15:20:56   

To make sure a hotfix isn't the culprit could you try with the official 5.9.0 runtime?

It's about this fix:

[LLBLMAIN-2441] ( Runtime Libraries, ) [Fixed] - When a retry in a transient error recovery is performed with a prefetch path, duplicate entries might occur in subnode results

Our tests succeed, but it might be your query hits a situation where this fix is problematic.

(edit) We can't reproduce it, so you have to provide more code, i.e. all code that is used to fetch the query: the call how you fetch it, like in the test below:

[Test]
public void PrefetchPathWithMultipleSubNodesOnSubNode()
{
    var p = new PrefetchPath2(EntityType.CustomerEntity);
    var e = p.Add(CustomerEntity.PrefetchPathOrders);
    e.SubPath.Add(OrderEntity.PrefetchPathEmployees);
    e.SubPath.Add(OrderEntity.PrefetchPathOrderDetails);

    using(var adapter = new DataAccessAdapter())
    {
        adapter.ParameterisedPrefetchPathThreshold = 1;
        var toFetch = new EntityCollection<CustomerEntity>();
        adapter.FetchEntityCollection(toFetch, new RelationPredicateBucket(CustomerFields.Country=="USA"), p);
        Assert.AreEqual(13, toFetch.Count);
    }
}

The thing is, your query has an alias and that's not introduced in the queries, so this alias comes from somewhere else

Frans Bouma | Lead developer LLBLGen Pro
OKP
User
Posts: 12
Joined: 03-Mar-2022
# Posted on: 25-Mar-2022 08:01:44   

We changed the nuget packages to v5.9.0 (latest stable) and re-tested the code. The error still persists. Here's the whole example query


using (EntityCollection<OrdersEntity> orders = new EntityCollection<OrdersEntity>(new OrdersEntityFactory()))
{
    PrefetchPath2 orderPrefetchPath = new PrefetchPath2(EntityType.OrdersEntity);
    IPrefetchPathElement2 billElement = orderPrefetchPath.Add(OrdersEntity.PrefetchPathBills);
    billElement.SubPath.Add(BillEntity.PrefetchPathCreditBills);
    billElement.SubPath.Add(BillEntity.PrefetchPathTahits);

    IPrefetchPathElement2 paymentElement = orderPrefetchPath.Add(OrdersEntity.PrefetchPathPayments, s_PaymentFieldsIncluded);
    IPrefetchPathElement2 historyPrefetchPath = orderPrefetchPath.Add(OrdersEntity.PrefetchPathHistory, s_HistoryFieldsIncluded);
    historyPrefetchPath.SubPath.Add(HistoryEntity.PrefetchPathActmenu, s_ActmenuFieldsIncluded);
    historyPrefetchPath.SubPath.Add(HistoryEntity.PrefetchPathKirjehistoria, s_KirjehistoriaFieldsIncluded);

    orderPrefetchPath.Add(OrdersEntity.PrefetchPathUoTransit, s_UoTransitFieldsIncluded);
    orderPrefetchPath.Add(OrdersEntity.PrefetchPathHhOrders, s_HhOrderFieldsIncluded);
    orderPrefetchPath.Add(OrdersEntity.PrefetchPathClient, s_PartFieldsIncluded);
    orderPrefetchPath.Add(OrdersEntity.PrefetchPathDebtor, s_PartFieldsIncluded);

    IPrefetchPathElement2 orderGroupElement = orderPrefetchPath.Add(OrdersEntity.PrefetchPathOrderGroupOrders)
        .SubPath.Add(OrderGroupOrderEntity.PrefetchPathOrderGroup);
    orderGroupElement
        .SubPath.Add(OrderGroupEntity.PrefetchPathOrderGroupOrders)
        .SubPath.Add(OrderGroupOrderEntity.PrefetchPathOrder);
    AddUoTilitysPrefetchPaths(orderPrefetchPath, orderGroupElement);

    IRelationPredicateBucket filterBucket = new RelationPredicateBucket();
    filterBucket.PredicateExpression.Add(OrdersFields.Enddate == DBNull.Value);
    filterBucket.PredicateExpression.Add(OrdersFields.Phasenr != OrderPhase.CreditLoss);
    filterBucket.PredicateExpression.Add(OrdersFields.Phasenr != OrderPhase.Paid);
    filterBucket.PredicateExpression.Add(OrdersFields.Phasenr != OrderPhase.Ended);
    filterBucket.PredicateExpression.Add(OrdersFields.Phasenr != OrderPhase.Groundless);

    IPredicateExpression orderTypeExpression = new PredicateExpression(OrdersFields.Ordertype == DBNull.Value);
    orderTypeExpression.AddWithOr(OrdersFields.Ordertype != OrderType.Precollection);

    filterBucket.PredicateExpression.Add(orderTypeExpression); 

    filterBucket.PredicateExpression.Add(OrdersFields.Nr >= fromOrderNr);
    filterBucket.PredicateExpression.Add(OrdersFields.Nr <= toOrderNr);

    dataAccessAdapter.FetchEntityCollection(orders, filterBucket, 0, null, orderPrefetchPath, s_OrdersFieldsIncluded);
....
}

ExcludeIncludeFieldsLists used in the query like for example 's_HistoryFieldsIncluded' are defined like this:


private static ExcludeIncludeFieldsList s_HistoryFieldsIncluded =
            new ExcludeIncludeFieldsList(
                false,
                new IEntityFieldCore[]
                        {
                            HistoryFields.Registerdate,
                            HistoryFields.Actmenunr,
                            HistoryFields.Agreement,
                            HistoryFields.Memo,
                            HistoryFields.Kirjehistorianr,
                            HistoryFields.IgnoreOrderExpiration
                        });
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 25-Mar-2022 09:18:32   

Please remove any lines that don't make the query work, so if removing a line still makes the query fail, please remove that so the minimal query to reproduce this problem is left.

Furthermore, you use a lot of included fields sets which are static (and thus re-used per query). Are these used to exclude big fields? As you don't need to specify the fields to fetch. Sharing field objects like that, using static arrays, might not be a good idea.

If it's important in reproducing this problem, please explain what AddUoTilitysPrefetchPaths does.

If there's inheritance in play, please specify that and which type and which types inherit from what.

In short: we don't have your model/code in front of us. It is very time consuming to rebuild a repro case by puzzling together what your query might do. So ideally a repro case that reproduces the problem right away is ideal.

Frans Bouma | Lead developer LLBLGen Pro
OKP
User
Posts: 12
Joined: 03-Mar-2022
# Posted on: 25-Mar-2022 09:27:42   

I believe it is these two lines of code that produce the problem. If I comment those out, the query works.

billElement.SubPath.Add(BillEntity.PrefetchPathCreditBills);
billElement.SubPath.Add(BillEntity.PrefetchPathTahits);

More spesifically if you look at the failing query it fails when querying the second subpath.

SELECT *
FROM [dbo].[TAHit] WHERE ( [dbo].[TAHit].[BILLNR] IN (SELECT [dbo].[Bill].[NR] AS [Nr] FROM [dbo].[Bill]
WHERE ( ( [**__LLBLPP**].[ORDERNR] IN (SELECT [dbo].[Orders].[NR] AS [Nr] FROM [dbo].[Orders]
WHERE ( ( [dbo].[Orders].[NR] >= @p1 AND [dbo].[Orders].[NR] <= @p2)))))))

this is what adduotilitysprefetchpath is

internal static void AddUoTilitysPrefetchPaths(PrefetchPath2 orderPrefetchPath, IPrefetchPathElement2 orderGroupElement)
 {
            IPrefetchPathElement2 uoTilitysAsiaElement = orderPrefetchPath.Add(OrdersEntity.PrefetchPathUoTilitysAsias, s_UoTilitysAsiaFieldsIncluded);
            AddUoTilitysAsiaPrefetchPaths(uoTilitysAsiaElement);

            uoTilitysAsiaElement = orderGroupElement.SubPath.Add(OrderGroupEntity.PrefetchPathUoTilitysAsias, s_UoTilitysAsiaFieldsIncluded);
            AddUoTilitysAsiaPrefetchPaths(uoTilitysAsiaElement);
 }
private static void AddUoTilitysAsiaPrefetchPaths(IPrefetchPathElement2 uoTilitysAsiaElement)
        {
            uoTilitysAsiaElement.SubPath.Add(UoTilitysAsiaEntity.PrefetchPathUoTilitysErittely, s_UoTilitysErittelyFieldsIncluded)
                .SubPath.Add(UoTilitysErittelyEntity.PrefetchPathUoTilitysEsteerittely, s_UoTilitysEsteErittelyFieldsIncluded)
                .SubPath.Add(UoTilitysEsteerittelyEntity.PrefetchPathUoTilitysEste);
        }

I will try to figure out a more compact test case for you.

OKP
User
Posts: 12
Joined: 03-Mar-2022
# Posted on: 25-Mar-2022 15:04:11   

Hi,

I made a minimum viable test where the error occurs (see code below) Regarding prefetchpatches used. Both these prefetchpatches are relations which do NOT have foreign keys in the database. PrefetchPathCreditBills: This relation is a reference to a same table [Bill]. The Column Bill.Nr is the primary key and Bill.CreditNr is a column that points to another row (Bill.Nr) in the Bill -table.

PrefetchPathTahits: Tahit -table has a BillNr -column that points to a row in the Bill-table [Bill.Nr]

The error occurs only when data is found and EntityCollections are trying to be filled. Ie. Bill.CreditNr > 0 and and Tahit.BillNr > 0 and only both SubPath-clauses are used. Hope this helps to reproduce the bug.

[TestMethod]
        public void TestOrdersPrefetchPath()
        {
            int fromOrderNr = 700000;
            int toOrderNr = 700403;

            using (EntityCollection<OrdersEntity> orders = new EntityCollection<OrdersEntity>(new OrdersEntityFactory()))
            {
                PrefetchPath2 orderPrefetchPath = new PrefetchPath2(EntityType.OrdersEntity);
                IPrefetchPathElement2 billElement = orderPrefetchPath.Add(OrdersEntity.PrefetchPathBills);
                billElement.SubPath.Add(BillEntity.PrefetchPathCreditBills);
                billElement.SubPath.Add(BillEntity.PrefetchPathTahits);

                IRelationPredicateBucket filterBucket = new RelationPredicateBucket();                
                filterBucket.PredicateExpression.Add(OrdersFields.Nr >= fromOrderNr);
                filterBucket.PredicateExpression.Add(OrdersFields.Nr <= toOrderNr);

                try
                {
                    using (var dataAccessAdapter = 
                        new DataAccessAdapter("Data Source=xxx;Initial Catalog=xxx;User ID=xxxx;Password=xxxx;Connect Timeout=40"))
                    {
                        dataAccessAdapter.FetchEntityCollection(orders, filterBucket, 0, null, orderPrefetchPath, null);
                    }

                    Assert.IsTrue(orders.Count > 0);     
                }
                catch (ORMException ex)
                {
                    Assert.Fail(ex.Message);
                }
            }
        }
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 25-Mar-2022 15:24:16   

Thanks we'll look into it! Hopefully we'll have a fix by Monday.

PrefetchPathCreditBills: This relation is a reference to a same table [Bill]

This is likely the reason you see an alias in your query ( and which fails) and my initial repro case worked fine (as it has to auto-alias the entity).

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 25-Mar-2022 15:30:10   

Reproduced

[Test]
public void PrefetchPathWithMultipleSubNodesOnSubNodeWithRelationToSelf()
{
    var p = new PrefetchPath2(EntityType.OrderEntity);
    var e = p.Add(OrderEntity.PrefetchPathEmployees);
    e.SubPath.Add(EmployeeEntity.PrefetchPathManager);
    e.SubPath.Add(EmployeeEntity.PrefetchPathEmployeeTerritories);

    using(var adapter = new DataAccessAdapter())
    {
        adapter.ParameterisedPrefetchPathThreshold = 1;
        var toFetch = new EntityCollection<OrderEntity>();
        adapter.FetchEntityCollection(toFetch, new RelationPredicateBucket(OrderFields.ShipCountry=="USA"), p);
        Assert.AreEqual(121, toFetch.Count);
    }
}
SELECT [Northwind].[dbo].[EmployeeTerritories].[EmployeeID]  AS [EmployeeId],
       [Northwind].[dbo].[EmployeeTerritories].[TerritoryID] AS [TerritoryId]
FROM   [Northwind].[dbo].[EmployeeTerritories]
WHERE  ([Northwind].[dbo].[EmployeeTerritories].[EmployeeID] IN
        (SELECT [Northwind].[dbo].[Employees].[EmployeeID] AS [EmployeeId]
         FROM   [Northwind].[dbo].[Employees]
         WHERE  (([__LLBLPP].[EmployeeID] IN
                  (SELECT [Northwind].[dbo].[Orders].[EmployeeID] AS [EmployeeId]
                   FROM   [Northwind].[dbo].[Orders]
                   WHERE  (([Northwind].[dbo].[Orders].[ShipCountry] = @p1))))))) 

The filter is re-used as the subquery has to produce the same # of parents, but the filter has the alias set of the previous query:

SELECT [Northwind].[dbo].[Employees].[Address],
       [Northwind].[dbo].[Employees].[BirthDate],
       [Northwind].[dbo].[Employees].[City],
       [Northwind].[dbo].[Employees].[Country],
       [Northwind].[dbo].[Employees].[EmployeeID] AS [EmployeeId],
       [Northwind].[dbo].[Employees].[Extension],
       [Northwind].[dbo].[Employees].[FirstName],
       [Northwind].[dbo].[Employees].[HireDate],
       [Northwind].[dbo].[Employees].[HomePhone],
       [Northwind].[dbo].[Employees].[LastName],
       [Northwind].[dbo].[Employees].[Notes],
       [Northwind].[dbo].[Employees].[Photo],
       [Northwind].[dbo].[Employees].[PhotoPath],
       [Northwind].[dbo].[Employees].[PostalCode],
       [Northwind].[dbo].[Employees].[Region],
       [Northwind].[dbo].[Employees].[RegionID]   AS [RegionId],
       [Northwind].[dbo].[Employees].[ReportsTo],
       [Northwind].[dbo].[Employees].[Title],
       [Northwind].[dbo].[Employees].[TitleOfCourtesy]
FROM   [Northwind].[dbo].[Employees]
WHERE  ([Northwind].[dbo].[Employees].[EmployeeID] IN
        (SELECT [__LLBLPP].[ReportsTo]
         FROM   [Northwind].[dbo].[Employees] [__LLBLPP]
         WHERE  (([__LLBLPP].[EmployeeID] IN
                  (SELECT [Northwind].[dbo].[Orders].[EmployeeID] AS [EmployeeId]
                   FROM   [Northwind].[dbo].[Orders]
                   WHERE  (([Northwind].[dbo].[Orders].[ShipCountry] = @p1))))))) 

bug is in both v5.8.x and v5.9.x

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 25-Mar-2022 15:44:26   

I think if you switch the two path elements:

                billElement.SubPath.Add(BillEntity.PrefetchPathTahits);
                billElement.SubPath.Add(BillEntity.PrefetchPathCreditBills);

it'll fetch the same data but it'll work. This could at least keep you working till it's fixed.

Frans Bouma | Lead developer LLBLGen Pro
OKP
User
Posts: 12
Joined: 03-Mar-2022
# Posted on: 28-Mar-2022 07:52:00   

Great to hear you found the bug. And thank you for the workaround suggestion. However I have this problem in multiple queries in different parts of the solution. I have about a week to a next production release so I'll wait on your hotfix for now. simple_smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 28-Mar-2022 11:48:30   

Fixed in hotfix builds 5.8.5 and 5.9.1, which are now available.

Frans Bouma | Lead developer LLBLGen Pro
OKP
User
Posts: 12
Joined: 03-Mar-2022
# Posted on: 07-Apr-2022 09:04:14   

Hi,

I'm afraid I have to report this bug is not yet 100% fixed, it still exists with some combination. I try to create an example for you.

Kind regards, OKP

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 07-Apr-2022 09:41:34   

Interesting, as the reason for the bug should be gone for 100% (we clean the alias on the objects so it doesn't exist anymore for queries following the one where it was used).

Frans Bouma | Lead developer LLBLGen Pro
OKP
User
Posts: 12
Joined: 03-Mar-2022
# Posted on: 07-Apr-2022 10:37:10   

The error occurs if you use fieldcomparerangepredicate with large IN parameter set. For example if in my code example below the orderNumbers count would be say 5000, I need to fetch those in chunks of 1000 to prevent FieldCompareRange to hit maximum limit and error.

If you create the prefetchpath outside chunks loop it will produce this same error. (see code example below).

public EntityCollection<OrdersEntity> GetOrders(IEnumerable<int> orderNumbers)
{
    using (IDataAccessAdapter dataAccessAdapter = new DataAccessAdapter())
    {
        EntityCollection<OrdersEntity> ordersTemp = null;
        var orders = new EntityCollection<OrdersEntity>(new OrdersEntityFactory());

        //Prefetch path created here produces error
        IPrefetchPath2 orderPrefetchPath = new PrefetchPath2(EntityType.OrdersEntity);
        IPrefetchPathElement2 billsElement = orderPrefetchPath.Add(OrdersEntity.PrefetchPathBills);
        billsElement.SubPath.Add(BillEntity.PrefetchPathTahits)
            .SubPath.Add(TahitEntity.PrefetchPathPayment);
        
        try
        {
            int chunkNumber = 1;
            const int ChunkSize = 1000;

            IEnumerable<int> orderNumbersChunk = orderNumbers.Skip((chunkNumber - 1) * ChunkSize).Take(ChunkSize);

            while (orderNumbersChunk.Any())
            {
                ordersTemp = new EntityCollection<OrdersEntity>(new OrdersEntityFactory());
                
                //Prefetch path created here works
                
                IRelationPredicateBucket filter = new RelationPredicateBucket();
                filter.PredicateExpression.Add(new FieldCompareRangePredicate(OrdersFields.Nr, null, orderNumbersChunk.ToArray()));
                
                dataAccessAdapter.FetchEntityCollection(ordersTemp, filter, orderPrefetchPath);

                orders.AddRange(ordersTemp);

                ordersTemp.Dispose();
                ordersTemp = null;

                chunkNumber++;

                orderNumbersChunk = orderNumbers.Skip((chunkNumber - 1) * ChunkSize).Take(ChunkSize);
            }

            return orders;
        }
        catch (ORMException ex)
        {
            throw new FaultException(ex.Message);
        }
        finally
        {
            if (ordersTemp != null)
            {
                ordersTemp.Dispose();
            }
        }
    }
}
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 08-Apr-2022 09:18:28   

Ok, we'll look into it! simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 08-Apr-2022 10:22:36   

This prefetch path is different than the other one, I don't have specifics here, so I rebuilt it like this:

[Test]
public void PrefetchPathWithMultipleSubNodesOnSubNodeWithRelationToSelf2()
{
    var p = new PrefetchPath2(EntityType.OrderEntity);
    var e = p.Add(OrderEntity.PrefetchPathEmployees);
    e.SubPath.Add(EmployeeEntity.PrefetchPathManager);
    e.SubPath.Add(EmployeeEntity.PrefetchPathEmployeeTerritories);

    var orderIds = new List<int>();
    for(int i = 10254; i < 10400; i++)
    {
        orderIds.Add(i);
    }
    
    using(var adapter = new DataAccessAdapter())
    {
        adapter.ParameterisedPrefetchPathThreshold = 1;
        var toFetch = new EntityCollection<OrderEntity>();
        var toFetchTmp = new EntityCollection<OrderEntity>();
        
        int chunkNumber = 1;
        const int ChunkSize = 50;

        IEnumerable<int> orderNumbersChunk = orderIds.Skip((chunkNumber - 1) * ChunkSize).Take(ChunkSize);

        while (orderNumbersChunk.Any())
        {
            toFetchTmp = new EntityCollection<OrderEntity>();
        
            IRelationPredicateBucket filter = new RelationPredicateBucket();
            filter.PredicateExpression.Add(new FieldCompareRangePredicate(OrderFields.OrderId, null, orderNumbersChunk.ToArray()));
            adapter.FetchEntityCollection(toFetchTmp, filter, p);
            toFetch.AddRange(toFetchTmp);
            toFetchTmp.Dispose();
            toFetchTmp = null;
            chunkNumber++;
            orderNumbersChunk = orderIds.Skip((chunkNumber - 1) * ChunkSize).Take(ChunkSize);
        }
        Assert.AreEqual(146, toFetch.Count);
    }
}

On northwind. I step through 50 rows at a time, which shouldn't make a difference. I switched off optimizations as that would not trigger the error regardless. The test runs fine, queries are OK and the alias is cleaned up.

I have no idea what the exact error is on your side, and I can't reproduce the error here. (not on 5.8.5 not on 5.9.1) Queries produced: (3 batches)

SELECT [Northwind].[dbo].[Orders].[CustomerID] AS [CustomerId],
       [Northwind].[dbo].[Orders].[EmployeeID] AS [EmployeeId],
       [Northwind].[dbo].[Orders].[Freight],
       [Northwind].[dbo].[Orders].[OrderDate],
       [Northwind].[dbo].[Orders].[OrderID]    AS [OrderId],
       [Northwind].[dbo].[Orders].[RequiredDate],
       [Northwind].[dbo].[Orders].[ShipAddress],
       [Northwind].[dbo].[Orders].[ShipCity],
       [Northwind].[dbo].[Orders].[ShipCountry],
       [Northwind].[dbo].[Orders].[ShipName],
       [Northwind].[dbo].[Orders].[ShippedDate],
       [Northwind].[dbo].[Orders].[ShipPostalCode],
       [Northwind].[dbo].[Orders].[ShipRegion],
       [Northwind].[dbo].[Orders].[ShipVia]
FROM   [Northwind].[dbo].[Orders]
WHERE  ([Northwind].[dbo].[Orders].[OrderID] IN (@p1, @p2, @p3, @p4,
             @p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12, @p13, @p14, @p15, @p16,
             @p17, @p18, @p19, @p20, @p21, @p22, @p23, @p24, @p25, @p26, @p27, @p28,
             @p29, @p30, @p31, @p32, @p33, @p34, @p35, @p36, @p37, @p38, @p39, @p40,
             @p41, @p42, @p43, @p44, @p45, @p46, @p47, @p48, @p49, @p50)) 


SELECT [Northwind].[dbo].[Employees].[Address],
       [Northwind].[dbo].[Employees].[BirthDate],
       [Northwind].[dbo].[Employees].[City],
       [Northwind].[dbo].[Employees].[Country],
       [Northwind].[dbo].[Employees].[EmployeeID] AS [EmployeeId],
       [Northwind].[dbo].[Employees].[Extension],
       [Northwind].[dbo].[Employees].[FirstName],
       [Northwind].[dbo].[Employees].[HireDate],
       [Northwind].[dbo].[Employees].[HomePhone],
       [Northwind].[dbo].[Employees].[LastName],
       [Northwind].[dbo].[Employees].[Notes],
       [Northwind].[dbo].[Employees].[Photo],
       [Northwind].[dbo].[Employees].[PhotoPath],
       [Northwind].[dbo].[Employees].[PostalCode],
       [Northwind].[dbo].[Employees].[Region],
       [Northwind].[dbo].[Employees].[RegionID]   AS [RegionId],
       [Northwind].[dbo].[Employees].[ReportsTo],
       [Northwind].[dbo].[Employees].[Title],
       [Northwind].[dbo].[Employees].[TitleOfCourtesy]
FROM   [Northwind].[dbo].[Employees]
WHERE  ([Northwind].[dbo].[Employees].[EmployeeID] IN
        (SELECT [Northwind].[dbo].[Orders].[EmployeeID] AS [EmployeeId]
         FROM   [Northwind].[dbo].[Orders]
         WHERE  (([Northwind].[dbo].[Orders].[OrderID] IN (@p1, @p2, @p3, @p4,
            @p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12, @p13, @p14, @p15, @p16,
            @p17, @p18, @p19, @p20, @p21, @p22, @p23, @p24, @p25, @p26, @p27, @p28,
            @p29, @p30, @p31, @p32, @p33, @p34, @p35, @p36, @p37, @p38, @p39, @p40,
            @p41, @p42, @p43, @p44, @p45, @p46, @p47, @p48, @p49, @p50))))) 


SELECT [Northwind].[dbo].[Employees].[Address],
       [Northwind].[dbo].[Employees].[BirthDate],
       [Northwind].[dbo].[Employees].[City],
       [Northwind].[dbo].[Employees].[Country],
       [Northwind].[dbo].[Employees].[EmployeeID] AS [EmployeeId],
       [Northwind].[dbo].[Employees].[Extension],
       [Northwind].[dbo].[Employees].[FirstName],
       [Northwind].[dbo].[Employees].[HireDate],
       [Northwind].[dbo].[Employees].[HomePhone],
       [Northwind].[dbo].[Employees].[LastName],
       [Northwind].[dbo].[Employees].[Notes],
       [Northwind].[dbo].[Employees].[Photo],
       [Northwind].[dbo].[Employees].[PhotoPath],
       [Northwind].[dbo].[Employees].[PostalCode],
       [Northwind].[dbo].[Employees].[Region],
       [Northwind].[dbo].[Employees].[RegionID]   AS [RegionId],
       [Northwind].[dbo].[Employees].[ReportsTo],
       [Northwind].[dbo].[Employees].[Title],
       [Northwind].[dbo].[Employees].[TitleOfCourtesy]
FROM   [Northwind].[dbo].[Employees]
WHERE  ([Northwind].[dbo].[Employees].[EmployeeID] IN
        (SELECT [__LLBLPP].[ReportsTo]
         FROM   [Northwind].[dbo].[Employees] [__LLBLPP]
         WHERE  (([__LLBLPP].[EmployeeID] IN
                  (SELECT [Northwind].[dbo].[Orders].[EmployeeID] AS [EmployeeId]
                   FROM   [Northwind].[dbo].[Orders]
                   WHERE  (([Northwind].[dbo].[Orders].[OrderID] IN (@p1, @p2, @p3, @p4,
    @p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12, @p13, @p14, @p15, @p16, @p17, @p18, @p19, @p20,
    @p21, @p22, @p23, @p24, @p25, @p26, @p27, @p28, @p29, @p30, @p31, @p32, @p33, @p34, @p35, @p36,
    @p37, @p38, @p39, @p40, @p41, @p42, @p43, @p44, @p45, @p46, @p47, @p48, @p49, @p50)))))))) 

SELECT [Northwind].[dbo].[EmployeeTerritories].[EmployeeID]  AS [EmployeeId],
       [Northwind].[dbo].[EmployeeTerritories].[TerritoryID] AS [TerritoryId]
FROM   [Northwind].[dbo].[EmployeeTerritories]
WHERE  ([Northwind].[dbo].[EmployeeTerritories].[EmployeeID] IN
        (SELECT [Northwind].[dbo].[Employees].[EmployeeID] AS [EmployeeId]
         FROM   [Northwind].[dbo].[Employees]
         WHERE  (([Northwind].[dbo].[Employees].[EmployeeID] IN
                  (SELECT [Northwind].[dbo].[Orders].[EmployeeID] AS [EmployeeId]
                   FROM   [Northwind].[dbo].[Orders]
                   WHERE  (([Northwind].[dbo].[Orders].[OrderID] IN (@p1, @p2, @p3, @p4,
     @p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12, @p13, @p14, @p15, @p16, @p17, @p18, @p19, @p20,
     @p21, @p22, @p23, @p24, @p25, @p26, @p27, @p28, @p29, @p30, @p31, @p32, @p33, @p34, @p35, @p36,
     @p37, @p38, @p39, @p40, @p41, @p42, @p43, @p44, @p45, @p46, @p47, @p48, @p49, @p50)))))))) 
Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 24-Jun-2022 12:23:53   

We have identified another issue related to this, which is likely what you ran into, we're investigating this and hopefully manage to fix it in 5.9.2 hotfix.

(edit) fix is now available (in latest v5.9.2 hotfix build, released today)

Frans Bouma | Lead developer LLBLGen Pro