From 9166b58a31928c4f3ea9d1a390287f267dee2245 Mon Sep 17 00:00:00 2001 From: Brandon Chong Date: Wed, 27 Nov 2019 12:00:38 -0800 Subject: [PATCH 1/5] fixed indexing error --- .../src/Query/Core/DistinctMap.UnorderedDistinctMap.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/DistinctMap.UnorderedDistinctMap.cs b/Microsoft.Azure.Cosmos/src/Query/Core/DistinctMap.UnorderedDistinctMap.cs index cea154fe3e..54a3712791 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/DistinctMap.UnorderedDistinctMap.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/DistinctMap.UnorderedDistinctMap.cs @@ -377,7 +377,7 @@ private bool AddStringValue(string value) { // Zero out the array since you want all trailing bytes to be 0 for the conversions that happen next. Array.Clear(this.utf8Buffer, 0, this.utf8Buffer.Length); - Encoding.UTF8.GetBytes(value, 0, utf8Length, this.utf8Buffer, 0); + Encoding.UTF8.GetBytes(value, 0, value.Length, this.utf8Buffer, 0); if (utf8Length == 0) { From c6c1e2a86f27746e79477669c1b24df9f6441d51 Mon Sep 17 00:00:00 2001 From: Brandon Chong Date: Wed, 27 Nov 2019 12:03:33 -0800 Subject: [PATCH 2/5] updated changelog" --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index eb3e55eeef..10b72f27e2 100644 --- a/changelog.md +++ b/changelog.md @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#1036](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1036) Fixed query responses to return null Content if it is a failure - [#1045](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1045) Added stack trace and innner exception to CosmosException - [#1050](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1050) Add mocking constructors to TransactionalBatchOperationResult +- [#1060](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1060) Fixed encoding bug in DISTINCT queries. ## [3.4.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.4.1) - 2019-11-06 From e8acaf772c6e27b50a23a9097b0166c6ebe0c1a8 Mon Sep 17 00:00:00 2001 From: Brandon Chong Date: Wed, 4 Dec 2019 09:16:58 -0800 Subject: [PATCH 3/5] added test --- .../CrossPartitionQueryTests.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CrossPartitionQueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CrossPartitionQueryTests.cs index e8cf36a1d5..fbb55a18f9 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CrossPartitionQueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CrossPartitionQueryTests.cs @@ -4811,6 +4811,8 @@ private static string GetRandomName(Random rand) stringBuilder.Append('a' + rand.Next(0, 26)); } + stringBuilder.Append("💩"); + return stringBuilder.ToString(); } From 5e6d2bbe5ddbe3eec3f59ea7466a50e83327647f Mon Sep 17 00:00:00 2001 From: Brandon Chong Date: Wed, 4 Dec 2019 09:19:25 -0800 Subject: [PATCH 4/5] updated changelog --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 10b72f27e2..c12d32673b 100644 --- a/changelog.md +++ b/changelog.md @@ -30,7 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#1036](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1036) Fixed query responses to return null Content if it is a failure - [#1045](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1045) Added stack trace and innner exception to CosmosException - [#1050](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1050) Add mocking constructors to TransactionalBatchOperationResult -- [#1060](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1060) Fixed encoding bug in DISTINCT queries. +- [#1060](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1060) Fixed unicode encoding bug in DISTINCT queries. ## [3.4.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.4.1) - 2019-11-06 From a8245004fad4163287b4b2690a387dea407a5c88 Mon Sep 17 00:00:00 2001 From: Brandon Chong Date: Wed, 4 Dec 2019 13:15:24 -0800 Subject: [PATCH 5/5] updated changelog --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index e4378b7d05..1b83c1a012 100644 --- a/changelog.md +++ b/changelog.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - [#1070](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1070) CreateItem will only retry for auto-extracted partition key in-case of collection re-creation +- [#1060](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1060) Fixed unicode encoding bug in DISTINCT queries. ## [3.5.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.5.0) - 2019-12-03 @@ -33,7 +34,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#1036](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1036) Fixed query responses to return null Content if it is a failure - [#1045](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1045) Added stack trace and innner exception to CosmosException - [#1050](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1050) Add mocking constructors to TransactionalBatchOperationResult -- [#1060](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1060) Fixed unicode encoding bug in DISTINCT queries. ## [3.4.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.4.1) - 2019-11-06