Skip to content

NullReferenceException for operations on cloned XQuery #572

@p-goodman

Description

@p-goodman

While the changes in #552 solved the issue with timeouts on update and delete operations, it also relies on the existance of a QueryFactory. Unfortunately the QueryFactory is not set on a cloned instance of a QueryFactory-derived Query, which is why a NullReferenceException is raised.

To reproduce:

var db = new QueryFactory(connection, new SqliteCompiler());

var baseQuery = db.Query().From("Users");
var clonedQuery = baseQuery.Clone();

var totalCount = clonedQuery.AsCount().First<int>();

// System.NullReferenceException in SqlKata.Execution/Query.Extensions.cs, line 369

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions