Skip to content

Commit

Permalink
Recalculate schema if requesting specific columns only
Browse files Browse the repository at this point in the history
Fixes #207
  • Loading branch information
MarkMpn committed May 28, 2022
1 parent b4ea3e3 commit 2432cb2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion MarkMpn.Sql4Cds.Engine/ExecutionPlan/FetchXmlScan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public InvalidPagingException(string message) : base(message)
private string _lastSchemaFetchXml;
private string _lastSchemaAlias;
private NodeSchema _lastSchema;
private bool _lastFullSchema;
private bool _resetPage;
private string _startingPage;

Expand Down Expand Up @@ -555,7 +556,7 @@ public override INodeSchema GetSchema(IDictionary<string, DataSource> dataSource
throw new NotSupportedQueryFragmentException("Missing datasource " + DataSource);

var fetchXmlString = FetchXmlString;
if (_lastSchema != null && Alias == _lastSchemaAlias && fetchXmlString == _lastSchemaFetchXml)
if (_lastSchema != null && Alias == _lastSchemaAlias && fetchXmlString == _lastSchemaFetchXml && ReturnFullSchema == _lastFullSchema)
return _lastSchema;

_primaryKeyColumns = new Dictionary<string, string>();
Expand All @@ -573,6 +574,7 @@ public override INodeSchema GetSchema(IDictionary<string, DataSource> dataSource
_lastSchema = schema;
_lastSchemaFetchXml = fetchXmlString;
_lastSchemaAlias = Alias;
_lastFullSchema = ReturnFullSchema;
return schema;
}

Expand Down

0 comments on commit 2432cb2

Please sign in to comment.