From 4c6d3137610351bc355e274b603c1c893cfc9d88 Mon Sep 17 00:00:00 2001 From: Mark Carrington <31017244+MarkMpn@users.noreply.github.com> Date: Tue, 9 Jul 2024 21:10:57 +0100 Subject: [PATCH 1/3] Fixed generating error on invalid lookup/optionset comparison to string Fixes #506 --- MarkMpn.Sql4Cds.Engine/Ado/Sql4CdsError.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MarkMpn.Sql4Cds.Engine/Ado/Sql4CdsError.cs b/MarkMpn.Sql4Cds.Engine/Ado/Sql4CdsError.cs index 629d1639..19e2c564 100644 --- a/MarkMpn.Sql4Cds.Engine/Ado/Sql4CdsError.cs +++ b/MarkMpn.Sql4Cds.Engine/Ado/Sql4CdsError.cs @@ -219,7 +219,7 @@ internal static Sql4CdsError AmbiguousColumnName(ColumnReferenceExpression colum internal static Sql4CdsError ConversionFailed(DataTypeReference sourceType, Literal sourceValue, DataTypeReference targetType) { - return Create(245, sourceValue, GetTypeName(sourceType), (SqlInt32)sourceValue.Value.Length, Collation.USEnglish.ToSqlString(sourceValue.Value), GetTypeName(targetType)); + return Create(245, sourceValue, Collation.USEnglish.ToSqlString(GetTypeName(sourceType)), (SqlInt32)sourceValue.Value.Length, Collation.USEnglish.ToSqlString(sourceValue.Value), Collation.USEnglish.ToSqlString(GetTypeName(targetType))); } internal static Sql4CdsError CollationConflict(TSqlFragment fragment, Collation source, Collation target, string operationName) From 1a86ada6bba949654a8e77e6cfc86a1b8c2b5748 Mon Sep 17 00:00:00 2001 From: Mark Carrington <31017244+MarkMpn@users.noreply.github.com> Date: Tue, 9 Jul 2024 21:19:19 +0100 Subject: [PATCH 2/3] Updated release notes and dependencies --- AzureDataStudioExtension/CHANGELOG.md | 21 ++++++++ .../MarkMpn.Sql4Cds.Engine.nuspec | 34 +++++++------ MarkMpn.Sql4Cds/MarkMpn.SQL4CDS.nuspec | 50 ++++++++++++++----- 3 files changed, 77 insertions(+), 28 deletions(-) diff --git a/AzureDataStudioExtension/CHANGELOG.md b/AzureDataStudioExtension/CHANGELOG.md index cebc68cb..e2ba5e66 100644 --- a/AzureDataStudioExtension/CHANGELOG.md +++ b/AzureDataStudioExtension/CHANGELOG.md @@ -1,5 +1,26 @@ # Change Log +## [v9.2.0](https://github.com/MarkMpn/Sql4Cds/releases/tag/v9.2.0) - 2024-07-10 + +Added export to CSV/Excel/JSON/Markdown/XML +Simplify filters that can easily be identified as tautologies or contradictions +Fixed incorrectly matching `null` values in hash joins +Fixed identification of nullable columns in outer joins +Handle `createdon` column being null in some system tables +Fixed use of metadata queries within loops +Fixed filtering and aggregation special cases with `audit` entity +Fixed incorrect type conversion errors when using specialized FetchXML condition operators +Fixed use of `CAST` and `CONVERT` with string types +Fixed paging when using semi-joins +Various fixes when querying virtual entities with unreliable providers: +* values returned as different types +* attributes using names with different case +* not honouring `top`, `offset`, `count`, `order` +Improved error reporting: +* when using `*` instead of column name +* when passing incorrect number of parameters to aggregate functions +* when comparing lookup/optionset columns to invalid string values + ## [v9.1.0](https://github.com/MarkMpn/Sql4Cds/releases/tag/v9.1.0) - 2024-06-10 Enabled access to recycle bin records via the `bin` schema diff --git a/MarkMpn.Sql4Cds.Engine/MarkMpn.Sql4Cds.Engine.nuspec b/MarkMpn.Sql4Cds.Engine/MarkMpn.Sql4Cds.Engine.nuspec index df6bd2c9..e0ec1915 100644 --- a/MarkMpn.Sql4Cds.Engine/MarkMpn.Sql4Cds.Engine.nuspec +++ b/MarkMpn.Sql4Cds.Engine/MarkMpn.Sql4Cds.Engine.nuspec @@ -11,21 +11,23 @@ https://markcarrington.dev/sql4cds-icon/ Convert SQL queries to FetchXml and execute them against Dataverse / D365 Convert SQL queries to FetchXml and execute them against Dataverse / D365 - Enabled access to recycle bin records via the `bin` schema -Enabled `INSERT`, `UPDATE` and `DELETE` statements on `principalobjectaccess` table -Enabled use of subqueries within `ON` clause of `JOIN` statements -Added support for `___pid` virtual column for lookups to elastic tables -Improved folding of queries using index spools -Improved primary key calculation when using joins on non-key columns -Apply column order setting to parameters for stored procedures and table-valued functions -Fixed error with DeleteMultiple requests -Fixed paging error with `DISTINCT` queries causing results to be limited to 50,000 records -Fixed paging errors when sorting by optionset values causing some results to be skipped -Fixed errors when using joins inside `[NOT] EXISTS` subqueries -Fixed incorrect results when applying aliases to `___name` and `___type` virtual columns -Fixed max length calculation for string columns -Added debug visualizer to inspect query plans within Visual Studio -Fixed "invalid program" errors when combining type conversions with `AND` or `OR` in .NET Core applications + Simplify filters that can easily be identified as tautologies or contradictions +Fixed incorrectly matching `null` values in hash joins +Fixed identification of nullable columns in outer joins +Handle `createdon` column being null in some system tables +Fixed use of metadata queries within loops +Fixed filtering and aggregation special cases with `audit` entity +Fixed incorrect type conversion errors when using specialized FetchXML condition operators +Fixed use of `CAST` and `CONVERT` with string types +Fixed paging when using semi-joins +Various fixes when querying virtual entities with unreliable providers: +* values returned as different types +* attributes using names with different case +* not honouring `top`, `offset`, `count`, `order` +Improved error reporting: +* when using `*` instead of column name +* when passing incorrect number of parameters to aggregate functions +* when comparing lookup/optionset columns to invalid string values Copyright © 2020 Mark Carrington en-GB @@ -36,6 +38,7 @@ Fixed "invalid program" errors when combining type conversions with `AND` or `OR + @@ -43,6 +46,7 @@ Fixed "invalid program" errors when combining type conversions with `AND` or `OR + diff --git a/MarkMpn.Sql4Cds/MarkMpn.SQL4CDS.nuspec b/MarkMpn.Sql4Cds/MarkMpn.SQL4CDS.nuspec index 20563200..93fa9437 100644 --- a/MarkMpn.Sql4Cds/MarkMpn.SQL4CDS.nuspec +++ b/MarkMpn.Sql4Cds/MarkMpn.SQL4CDS.nuspec @@ -23,19 +23,29 @@ plugins or integrations by writing familiar SQL and converting it. Queries can also run using the preview TDS Endpoint. A wide range of SQL functionality is also built in to allow running queries that aren't directly supported by either FetchXML or the TDS Endpoint. Convert SQL queries to FetchXML and execute them against Dataverse / D365 - Enabled access to recycle bin records via the `bin` schema -Enabled `INSERT`, `UPDATE` and `DELETE` statements on `principalobjectaccess` table -Enabled use of subqueries within `ON` clause of `JOIN` statements -Added support for `___pid` virtual column for lookups to elastic tables -Improved folding of queries using index spools -Improved primary key calculation when using joins on non-key columns -Apply column order setting to parameters for stored procedures and table-valued functions -Fixed error with DeleteMultiple requests -Fixed paging error with `DISTINCT` queries causing results to be limited to 50,000 records -Fixed paging errors when sorting by optionset values causing some results to be skipped -Fixed errors when using joins inside `[NOT] EXISTS` subqueries -Fixed incorrect results when applying aliases to `___name` and `___type` virtual columns -Fixed max length calculation for string columns + Added Copilot +Added "Script Table/Function/Prcedure As" menu options +Improved startup performance +Added option to change editor font and size +Added keyboard shortcuts to switch (`Ctrl+[`, `Ctrl+]`) and close (`Ctrl+W`) tabs +Added export to CSV/Excel +Simplify filters that can easily be identified as tautologies or contradictions +Fixed incorrectly matching `null` values in hash joins +Fixed identification of nullable columns in outer joins +Handle `createdon` column being null in some system tables +Fixed use of metadata queries within loops +Fixed filtering and aggregation special cases with `audit` entity +Fixed incorrect type conversion errors when using specialized FetchXML condition operators +Fixed use of `CAST` and `CONVERT` with string types +Fixed paging when using semi-joins +Various fixes when querying virtual entities with unreliable providers: +* values returned as different types +* attributes using names with different case +* not honouring `top`, `offset`, `count`, `order` +Improved error reporting: +* when using `*` instead of column name +* when passing incorrect number of parameters to aggregate functions +* when comparing lookup/optionset columns to invalid string values Copyright © 2019 Mark Carrington en-GB @@ -56,5 +66,19 @@ Fixed max length calculation for string columns + + + + + + + + + + + + + + \ No newline at end of file From e56960e7f5df37c819205fadfd66ef109f2831e2 Mon Sep 17 00:00:00 2001 From: Mark Carrington <31017244+MarkMpn@users.noreply.github.com> Date: Wed, 10 Jul 2024 08:29:07 +0100 Subject: [PATCH 3/3] Removed System.Text.Json dependency --- .../MarkMpn.Sql4Cds.Engine.Tests.csproj | 3 --- 1 file changed, 3 deletions(-) diff --git a/MarkMpn.Sql4Cds.Engine.Tests/MarkMpn.Sql4Cds.Engine.Tests.csproj b/MarkMpn.Sql4Cds.Engine.Tests/MarkMpn.Sql4Cds.Engine.Tests.csproj index f19791ce..4f1f95e9 100644 --- a/MarkMpn.Sql4Cds.Engine.Tests/MarkMpn.Sql4Cds.Engine.Tests.csproj +++ b/MarkMpn.Sql4Cds.Engine.Tests/MarkMpn.Sql4Cds.Engine.Tests.csproj @@ -126,9 +126,6 @@ 6.0.0 - - 6.0.7 -