diff --git a/sdk/tables/Azure.Data.Tables/src/TableClient.cs b/sdk/tables/Azure.Data.Tables/src/TableClient.cs index 0026ae3cdd57c..0e587cb4fcbe3 100644 --- a/sdk/tables/Azure.Data.Tables/src/TableClient.cs +++ b/sdk/tables/Azure.Data.Tables/src/TableClient.cs @@ -321,7 +321,7 @@ public virtual Response Create(CancellationToken cancellationToken = try { var response = _tableOperations.Create( - new TableProperties() { TableName = Name }, + new TableProperties { TableName = Name }, null, _defaultQueryOptions, cancellationToken); @@ -347,7 +347,7 @@ public virtual async Task> CreateAsync(CancellationToken can try { var response = await _tableOperations.CreateAsync( - new TableProperties() { TableName = Name }, + new TableProperties { TableName = Name }, null, _defaultQueryOptions, cancellationToken) @@ -374,7 +374,7 @@ public virtual Response CreateIfNotExists(CancellationToken cancellat try { var response = _tableOperations.Create( - new TableProperties() { TableName = Name }, + new TableProperties { TableName = Name }, null, _defaultQueryOptions, cancellationToken); @@ -404,7 +404,7 @@ public virtual async Task> CreateIfNotExistsAsync(Cancellati try { var response = await _tableOperations.CreateAsync( - new TableProperties() { TableName = Name }, + new TableProperties { TableName = Name }, null, _defaultQueryOptions, cancellationToken) @@ -577,7 +577,7 @@ public virtual Response GetEntity(string partitionKey, string rowKey, IEnu Name, partitionKey, rowKey, - queryOptions: new QueryOptions() { Format = _defaultQueryOptions.Format, Select = selectArg }, + queryOptions: new QueryOptions { Format = _defaultQueryOptions.Format, Select = selectArg }, cancellationToken: cancellationToken); var result = ((Dictionary)response.Value).ToTableEntity(); @@ -620,7 +620,7 @@ public virtual async Task> GetEntityAsync( Name, partitionKey, rowKey, - queryOptions: new QueryOptions() { Format = _defaultQueryOptions.Format, Select = selectArg }, + queryOptions: new QueryOptions { Format = _defaultQueryOptions.Format, Select = selectArg }, cancellationToken: cancellationToken) .ConfigureAwait(false); @@ -660,16 +660,16 @@ public virtual async Task UpsertEntityAsync( { TableUpdateMode.Replace => await _tableOperations.UpdateEntityAsync( Name, - entity!.PartitionKey, - entity.RowKey, + TableOdataFilter.EscapeStringValue(entity!.PartitionKey), + TableOdataFilter.EscapeStringValue(entity.RowKey), tableEntityProperties: entity.ToOdataAnnotatedDictionary(), queryOptions: _defaultQueryOptions, cancellationToken: cancellationToken) .ConfigureAwait(false), TableUpdateMode.Merge => await _tableOperations.MergeEntityAsync( Name, - entity!.PartitionKey, - entity.RowKey, + TableOdataFilter.EscapeStringValue(entity!.PartitionKey), + TableOdataFilter.EscapeStringValue(entity.RowKey), tableEntityProperties: entity.ToOdataAnnotatedDictionary(), queryOptions: _defaultQueryOptions, cancellationToken: cancellationToken) @@ -708,15 +708,15 @@ public virtual Response UpsertEntity(T entity, TableUpdateMode mode = TableUp { TableUpdateMode.Replace => _tableOperations.UpdateEntity( Name, - entity!.PartitionKey, - entity.RowKey, + TableOdataFilter.EscapeStringValue(entity!.PartitionKey), + TableOdataFilter.EscapeStringValue(entity.RowKey), tableEntityProperties: entity.ToOdataAnnotatedDictionary(), queryOptions: _defaultQueryOptions, cancellationToken: cancellationToken), TableUpdateMode.Merge => _tableOperations.MergeEntity( Name, - entity!.PartitionKey, - entity.RowKey, + TableOdataFilter.EscapeStringValue(entity!.PartitionKey), + TableOdataFilter.EscapeStringValue(entity.RowKey), tableEntityProperties: entity.ToOdataAnnotatedDictionary(), queryOptions: _defaultQueryOptions, cancellationToken: cancellationToken), @@ -770,8 +770,8 @@ public virtual async Task UpdateEntityAsync( { return await _tableOperations.UpdateEntityAsync( Name, - entity.PartitionKey, - entity.RowKey, + TableOdataFilter.EscapeStringValue(entity.PartitionKey), + TableOdataFilter.EscapeStringValue(entity.RowKey), tableEntityProperties: entity.ToOdataAnnotatedDictionary(), ifMatch: ifMatch.ToString(), queryOptions: _defaultQueryOptions, @@ -782,8 +782,8 @@ public virtual async Task UpdateEntityAsync( { return await _tableOperations.MergeEntityAsync( Name, - entity!.PartitionKey, - entity.RowKey, + TableOdataFilter.EscapeStringValue(entity!.PartitionKey), + TableOdataFilter.EscapeStringValue(entity.RowKey), tableEntityProperties: entity.ToOdataAnnotatedDictionary(), ifMatch: ifMatch.ToString(), queryOptions: _defaultQueryOptions, @@ -836,8 +836,8 @@ public virtual Response UpdateEntity(T entity, ETag ifMatch, TableUpdateMode { return _tableOperations.UpdateEntity( Name, - entity!.PartitionKey, - entity!.RowKey, + TableOdataFilter.EscapeStringValue(entity!.PartitionKey), + TableOdataFilter.EscapeStringValue(entity!.RowKey), tableEntityProperties: entity.ToOdataAnnotatedDictionary(), ifMatch: ifMatch.ToString(), queryOptions: _defaultQueryOptions, @@ -847,8 +847,8 @@ public virtual Response UpdateEntity(T entity, ETag ifMatch, TableUpdateMode { return _tableOperations.MergeEntity( Name, - entity.PartitionKey, - entity.RowKey, + TableOdataFilter.EscapeStringValue(entity.PartitionKey), + TableOdataFilter.EscapeStringValue(entity.RowKey), tableEntityProperties: entity.ToOdataAnnotatedDictionary(), ifMatch: ifMatch.ToString(), queryOptions: _defaultQueryOptions, @@ -975,7 +975,7 @@ public virtual AsyncPageable QueryAsync( { var response = await _tableOperations.QueryEntitiesAsync( Name, - queryOptions: new QueryOptions() { Format = _defaultQueryOptions.Format, Top = pageSizeHint, Filter = filter, Select = selectArg }, + queryOptions: new QueryOptions { Format = _defaultQueryOptions.Format, Top = pageSizeHint, Filter = filter, Select = selectArg }, cancellationToken: cancellationToken) .ConfigureAwait(false); @@ -1000,7 +1000,7 @@ public virtual AsyncPageable QueryAsync( var response = await _tableOperations.QueryEntitiesAsync( Name, - queryOptions: new QueryOptions() { Format = _defaultQueryOptions.Format, Top = pageSizeHint, Filter = filter, Select = selectArg }, + queryOptions: new QueryOptions { Format = _defaultQueryOptions.Format, Top = pageSizeHint, Filter = filter, Select = selectArg }, nextPartitionKey: NextPartitionKey, nextRowKey: NextRowKey, cancellationToken: cancellationToken) @@ -1054,7 +1054,7 @@ public virtual Pageable Query( scope.Start(); try { - var queryOptions = new QueryOptions() { Format = _defaultQueryOptions.Format, Top = pageSizeHint, Filter = filter, Select = selectArg }; + var queryOptions = new QueryOptions { Format = _defaultQueryOptions.Format, Top = pageSizeHint, Filter = filter, Select = selectArg }; var response = _tableOperations.QueryEntities( Name, @@ -1080,7 +1080,7 @@ public virtual Pageable Query( { var (NextPartitionKey, NextRowKey) = ParseContinuationToken(continuationToken); - var queryOptions = new QueryOptions() { Format = _defaultQueryOptions.Format, Top = pageSizeHint, Filter = filter, Select = selectArg }; + var queryOptions = new QueryOptions { Format = _defaultQueryOptions.Format, Top = pageSizeHint, Filter = filter, Select = selectArg }; var response = _tableOperations.QueryEntities( Name, @@ -1422,8 +1422,8 @@ private MultipartContent BuildChangeSet( new QueryOptions { Format = _defaultQueryOptions.Format!.Value }), TableTransactionActionType.Delete => batchOperations.CreateDeleteEntityRequest( Name, - item.Entity.PartitionKey, - item.Entity.RowKey, + TableOdataFilter.EscapeStringValue(item.Entity.PartitionKey), + TableOdataFilter.EscapeStringValue(item.Entity.RowKey), item.ETag == default ? ETag.All.ToString() : item.ETag.ToString(), null, new QueryOptions { Format = _defaultQueryOptions.Format!.Value }), @@ -1445,16 +1445,16 @@ private HttpMessage CreateUpdateOrMergeRequest(TableRestClient batchOperations, { TableUpdateMode.Replace => batchOperations.CreateUpdateEntityRequest( Name, - entity.PartitionKey, - entity.RowKey, + TableOdataFilter.EscapeStringValue(entity.PartitionKey), + TableOdataFilter.EscapeStringValue(entity.RowKey), null, ifMatch == default ? null : ifMatch.ToString(), entity.ToOdataAnnotatedDictionary(), new QueryOptions { Format = _defaultQueryOptions.Format!.Value }), TableUpdateMode.Merge => batchOperations.CreateMergeEntityRequest( Name, - entity.PartitionKey, - entity.RowKey, + TableOdataFilter.EscapeStringValue(entity.PartitionKey), + TableOdataFilter.EscapeStringValue(entity.RowKey), null, ifMatch == default ? null : ifMatch.ToString(), entity.ToOdataAnnotatedDictionary(), diff --git a/sdk/tables/Azure.Data.Tables/src/TableOdataFilter.cs b/sdk/tables/Azure.Data.Tables/src/TableOdataFilter.cs index 336c3da5ab545..7bb7bccfe4e00 100644 --- a/sdk/tables/Azure.Data.Tables/src/TableOdataFilter.cs +++ b/sdk/tables/Azure.Data.Tables/src/TableOdataFilter.cs @@ -68,9 +68,9 @@ public static string Create(FormattableString filter) DateTime x => $"{XmlConstants.LiteralPrefixDateTime}'{XmlConvert.ToString(x.ToUniversalTime(), XmlDateTimeSerializationMode.RoundtripKind)}'", // Text - string x => $"'{x.Replace("'", "''")}'", - char x => $"'{x.ToString().Replace("'", "''")}'", - StringBuilder x => $"'{x.Replace("'", "''")}'", + string x => $"'{EscapeStringValue(x)}'", + char x => $"'{EscapeStringValue(x)}'", + StringBuilder x => $"'{EscapeStringValue(x)}'", // Everything else object x => throw new ArgumentException( @@ -80,5 +80,15 @@ public static string Create(FormattableString filter) return string.Format(CultureInfo.InvariantCulture, filter.Format, args); } + + internal static string EscapeStringValue(string s) => s.Replace("'", "''"); + internal static StringBuilder EscapeStringValue(StringBuilder s) => s.Replace("'", "''"); + + internal static string EscapeStringValue(char s) => + s switch + { + _ when s == '\'' => "''", + _ => s.ToString() + }; } } diff --git a/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(CosmosTable)/UpsertAndQueryWithSingleQuoteNames(False).json b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(CosmosTable)/UpsertAndQueryWithSingleQuoteNames(False).json new file mode 100644 index 0000000000000..ec8379aba8b11 --- /dev/null +++ b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(CosmosTable)/UpsertAndQueryWithSingleQuoteNames(False).json @@ -0,0 +1,166 @@ +{ + "Entries": [ + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/Tables?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json; odata=minimalmetadata", + "Authorization": "Sanitized", + "Content-Length": "33", + "Content-Type": "application/json; odata=nometadata", + "DataServiceVersion": "3.0", + "traceparent": "00-112d15648816ee418fe929eb6ffe4b96-b435b06ce338b04a-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "3ed4e2c1206b5d916aedc7c7b280d88c", + "x-ms-date": "Mon, 07 Jun 2021 15:29:07 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "TableName": "testtable1988oj5n" + }, + "StatusCode": 201, + "ResponseHeaders": { + "Content-Type": "application/json; odata=minimalmetadata", + "Date": "Mon, 07 Jun 2021 15:29:06 GMT", + "ETag": "W/\u0022datetime\u00272021-06-07T15%3A29%3A06.8553224Z\u0027\u0022", + "Location": "https://chrisstablesprim.table.cosmos.azure.com/Tables(\u0027testtable1988oj5n\u0027)", + "Transfer-Encoding": "chunked", + "x-ms-request-id": "41cae5cb-9a8b-4d84-9fd3-9b08d25e36e3" + }, + "ResponseBody": { + "TableName": "testtable1988oj5n", + "odata.metadata": "https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element" + } + }, + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/testtable1988oj5n(PartitionKey=\u0027PartitionWithi%27%27%27%27singleQuote\u0027,RowKey=\u002701%27%27%27%27\u0027)?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "636", + "Content-Type": "application/json", + "DataServiceVersion": "3.0", + "traceparent": "00-bd3871395ac10b4198b60ba34842be8b-582dce0f22829b40-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "X-HTTP-Method": "MERGE", + "x-ms-client-request-id": "00f2ac152611a195102b58a7ee0b04ee", + "x-ms-date": "Mon, 07 Jun 2021 15:29:08 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "PartitionKey": "PartitionWithi\u0027\u0027singleQuote", + "RowKey": "01\u0027\u0027", + "SomeStringProperty": "This is table entity number 01", + "SomeDateProperty": "2020-01-01T01:02:00.0000000Z", + "SomeDateProperty@odata.type": "Edm.DateTime", + "SomeGuidProperty": "0d391d16-97f1-4b9a-be68-4cc871f90001", + "SomeGuidProperty@odata.type": "Edm.Guid", + "SomeBinaryProperty": "AQIDBAU=", + "SomeBinaryProperty@odata.type": "Edm.Binary", + "SomeInt64Property": "1", + "SomeInt64Property@odata.type": "Edm.Int64", + "SomeDoubleProperty0": 1, + "SomeDoubleProperty0@odata.type": "Edm.Double", + "SomeDoubleProperty1": 1.5, + "SomeDoubleProperty1@odata.type": "Edm.Double", + "SomeIntProperty": 1 + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Mon, 07 Jun 2021 15:29:06 GMT", + "ETag": "W/\u0022datetime\u00272021-06-07T15%3A29%3A07.5346440Z\u0027\u0022", + "x-ms-request-id": "bc2da083-df84-4367-ae78-79e40c76bdc0" + }, + "ResponseBody": [] + }, + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/testtable1988oj5n()?$format=application%2Fjson%3Bodata%3Dminimalmetadata\u0026$filter=PartitionKey%20eq%20%27PartitionWithi%27%27%27%27singleQuote%27%20and%20RowKey%20eq%20%2701%27%27%27%27%27", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; odata=minimalmetadata", + "Authorization": "Sanitized", + "DataServiceVersion": "3.0", + "traceparent": "00-d672386c61d28a40a0178046b3786617-fa0da2634ef20340-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "0574cc77ae06613225523c5a65136764", + "x-ms-date": "Mon, 07 Jun 2021 15:29:08 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; odata=minimalmetadata", + "Date": "Mon, 07 Jun 2021 15:29:06 GMT", + "Transfer-Encoding": "chunked", + "x-ms-request-id": "9cc54e8c-4410-45c9-b054-0df2dff84e8a" + }, + "ResponseBody": { + "value": [ + { + "odata.etag": "W/\u0022datetime\u00272021-06-07T15%3A29%3A07.5346440Z\u0027\u0022", + "PartitionKey": "PartitionWithi\u0027\u0027singleQuote", + "RowKey": "01\u0027\u0027", + "SomeStringProperty": "This is table entity number 01", + "SomeDateProperty@odata.type": "Edm.DateTime", + "SomeDateProperty": "2020-01-01T01:02:00.0000000Z", + "SomeGuidProperty@odata.type": "Edm.Guid", + "SomeGuidProperty": "0d391d16-97f1-4b9a-be68-4cc871f90001", + "SomeBinaryProperty@odata.type": "Edm.Binary", + "SomeBinaryProperty": "AQIDBAU=", + "SomeInt64Property@odata.type": "Edm.Int64", + "SomeInt64Property": "1", + "SomeDoubleProperty0": 1.0, + "SomeDoubleProperty1": 1.5, + "SomeIntProperty": 1, + "Timestamp": "2021-06-07T15:29:07.5346440Z" + } + ], + "odata.metadata": "https://chrisstablesprim.table.cosmos.azure.com/$metadata#testtable1988oj5n" + } + }, + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/Tables(\u0027testtable1988oj5n\u0027)", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-ab89bfc356a74c4d83da7351ec84a048-94649903178ae04f-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "72b8010c335b9a8a4d332e3fc7e96e5e", + "x-ms-date": "Mon, 07 Jun 2021 15:29:08 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Date": "Mon, 07 Jun 2021 15:29:06 GMT", + "x-ms-request-id": "863254b9-c6a2-4348-a9c4-914f4026b04c" + }, + "ResponseBody": [] + } + ], + "Variables": { + "COSMOS_TABLES_ENDPOINT_SUFFIX": null, + "RandomSeed": "1795875911", + "TABLES_COSMOS_ACCOUNT_NAME": "chrisstablesprim", + "TABLES_PRIMARY_COSMOS_ACCOUNT_KEY": "Kg==" + } +} \ No newline at end of file diff --git a/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(CosmosTable)/UpsertAndQueryWithSingleQuoteNames(False)Async.json b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(CosmosTable)/UpsertAndQueryWithSingleQuoteNames(False)Async.json new file mode 100644 index 0000000000000..58fae78360a3c --- /dev/null +++ b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(CosmosTable)/UpsertAndQueryWithSingleQuoteNames(False)Async.json @@ -0,0 +1,166 @@ +{ + "Entries": [ + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/Tables?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json; odata=minimalmetadata", + "Authorization": "Sanitized", + "Content-Length": "33", + "Content-Type": "application/json; odata=nometadata", + "DataServiceVersion": "3.0", + "traceparent": "00-d128f325e95cca4aa71ba4ffd306aa1a-4ed0ec6c2cb61042-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "01d8a3403337f60145e122bba157209f", + "x-ms-date": "Mon, 07 Jun 2021 15:29:11 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "TableName": "testtable38sd1gss" + }, + "StatusCode": 201, + "ResponseHeaders": { + "Content-Type": "application/json; odata=minimalmetadata", + "Date": "Mon, 07 Jun 2021 15:29:10 GMT", + "ETag": "W/\u0022datetime\u00272021-06-07T15%3A29%3A10.8752392Z\u0027\u0022", + "Location": "https://chrisstablesprim.table.cosmos.azure.com/Tables(\u0027testtable38sd1gss\u0027)", + "Transfer-Encoding": "chunked", + "x-ms-request-id": "ae0bd911-456b-48dc-8f00-94b059ea3723" + }, + "ResponseBody": { + "TableName": "testtable38sd1gss", + "odata.metadata": "https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element" + } + }, + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/testtable38sd1gss(PartitionKey=\u0027PartitionWithi%27%27%27%27singleQuote\u0027,RowKey=\u002701%27%27%27%27\u0027)?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "636", + "Content-Type": "application/json", + "DataServiceVersion": "3.0", + "traceparent": "00-add15d6fb7a50b4598703c00ffd5f688-03f194d4cb36274f-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "X-HTTP-Method": "MERGE", + "x-ms-client-request-id": "3de300438965838a073ac14090929d4d", + "x-ms-date": "Mon, 07 Jun 2021 15:29:12 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "PartitionKey": "PartitionWithi\u0027\u0027singleQuote", + "RowKey": "01\u0027\u0027", + "SomeStringProperty": "This is table entity number 01", + "SomeDateProperty": "2020-01-01T01:02:00.0000000Z", + "SomeDateProperty@odata.type": "Edm.DateTime", + "SomeGuidProperty": "0d391d16-97f1-4b9a-be68-4cc871f90001", + "SomeGuidProperty@odata.type": "Edm.Guid", + "SomeBinaryProperty": "AQIDBAU=", + "SomeBinaryProperty@odata.type": "Edm.Binary", + "SomeInt64Property": "1", + "SomeInt64Property@odata.type": "Edm.Int64", + "SomeDoubleProperty0": 1, + "SomeDoubleProperty0@odata.type": "Edm.Double", + "SomeDoubleProperty1": 1.5, + "SomeDoubleProperty1@odata.type": "Edm.Double", + "SomeIntProperty": 1 + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Mon, 07 Jun 2021 15:29:10 GMT", + "ETag": "W/\u0022datetime\u00272021-06-07T15%3A29%3A11.6416008Z\u0027\u0022", + "x-ms-request-id": "4980a1da-94e5-4d15-b30c-97893eecde05" + }, + "ResponseBody": [] + }, + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/testtable38sd1gss()?$format=application%2Fjson%3Bodata%3Dminimalmetadata\u0026$filter=PartitionKey%20eq%20%27PartitionWithi%27%27%27%27singleQuote%27%20and%20RowKey%20eq%20%2701%27%27%27%27%27", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; odata=minimalmetadata", + "Authorization": "Sanitized", + "DataServiceVersion": "3.0", + "traceparent": "00-fb69fb14818bc34099a1f90189f3e332-f486e18b03d26c40-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "6841235e2ebdb734829f3aaaa352c2df", + "x-ms-date": "Mon, 07 Jun 2021 15:29:12 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; odata=minimalmetadata", + "Date": "Mon, 07 Jun 2021 15:29:10 GMT", + "Transfer-Encoding": "chunked", + "x-ms-request-id": "2f81254f-653e-40f2-a81b-af45b70f93a6" + }, + "ResponseBody": { + "value": [ + { + "odata.etag": "W/\u0022datetime\u00272021-06-07T15%3A29%3A11.6416008Z\u0027\u0022", + "PartitionKey": "PartitionWithi\u0027\u0027singleQuote", + "RowKey": "01\u0027\u0027", + "SomeStringProperty": "This is table entity number 01", + "SomeDateProperty@odata.type": "Edm.DateTime", + "SomeDateProperty": "2020-01-01T01:02:00.0000000Z", + "SomeGuidProperty@odata.type": "Edm.Guid", + "SomeGuidProperty": "0d391d16-97f1-4b9a-be68-4cc871f90001", + "SomeBinaryProperty@odata.type": "Edm.Binary", + "SomeBinaryProperty": "AQIDBAU=", + "SomeInt64Property@odata.type": "Edm.Int64", + "SomeInt64Property": "1", + "SomeDoubleProperty0": 1.0, + "SomeDoubleProperty1": 1.5, + "SomeIntProperty": 1, + "Timestamp": "2021-06-07T15:29:11.6416008Z" + } + ], + "odata.metadata": "https://chrisstablesprim.table.cosmos.azure.com/$metadata#testtable38sd1gss" + } + }, + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/Tables(\u0027testtable38sd1gss\u0027)", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-4c899023031887498e71182648a5a7c1-59de5a8bbb6ad94c-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "c1eebd818f07b6901955f9fc71c166b3", + "x-ms-date": "Mon, 07 Jun 2021 15:29:12 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Date": "Mon, 07 Jun 2021 15:29:11 GMT", + "x-ms-request-id": "27b02360-a47c-4966-bf29-5cb1c8558ea2" + }, + "ResponseBody": [] + } + ], + "Variables": { + "COSMOS_TABLES_ENDPOINT_SUFFIX": null, + "RandomSeed": "1882392115", + "TABLES_COSMOS_ACCOUNT_NAME": "chrisstablesprim", + "TABLES_PRIMARY_COSMOS_ACCOUNT_KEY": "Kg==" + } +} \ No newline at end of file diff --git a/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(CosmosTable)/UpsertAndQueryWithSingleQuoteNames(True).json b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(CosmosTable)/UpsertAndQueryWithSingleQuoteNames(True).json new file mode 100644 index 0000000000000..07c59b5c276b6 --- /dev/null +++ b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(CosmosTable)/UpsertAndQueryWithSingleQuoteNames(True).json @@ -0,0 +1,166 @@ +{ + "Entries": [ + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/Tables?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json; odata=minimalmetadata", + "Authorization": "Sanitized", + "Content-Length": "33", + "Content-Type": "application/json; odata=nometadata", + "DataServiceVersion": "3.0", + "traceparent": "00-3b75e4346496064286fd40c52e66bb77-68cdacceebfe6d42-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "076e7f9e71ae3d1db2c9fcd2e350ce14", + "x-ms-date": "Mon, 07 Jun 2021 15:29:05 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "TableName": "testtableld4mlsb1" + }, + "StatusCode": 201, + "ResponseHeaders": { + "Content-Type": "application/json; odata=minimalmetadata", + "Date": "Mon, 07 Jun 2021 15:29:05 GMT", + "ETag": "W/\u0022datetime\u00272021-06-07T15%3A29%3A05.4513160Z\u0027\u0022", + "Location": "https://chrisstablesprim.table.cosmos.azure.com/Tables(\u0027testtableld4mlsb1\u0027)", + "Transfer-Encoding": "chunked", + "x-ms-request-id": "24b8f4e1-60f7-4562-acc1-0ed806799001" + }, + "ResponseBody": { + "TableName": "testtableld4mlsb1", + "odata.metadata": "https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element" + } + }, + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/testtableld4mlsb1(PartitionKey=\u0027PartitionWithi%27%27%27%27singleQuote\u0027,RowKey=\u002701%27%27%27%27\u0027)?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "636", + "Content-Type": "application/json", + "DataServiceVersion": "3.0", + "traceparent": "00-0d1c5ed32f85bc488879c43c49e15c54-b4bd098fdea9b643-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "X-HTTP-Method": "MERGE", + "x-ms-client-request-id": "889f9d65e1b5b84502df392e64de4803", + "x-ms-date": "Mon, 07 Jun 2021 15:29:06 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "PartitionKey": "PartitionWithi\u0027\u0027singleQuote", + "RowKey": "01\u0027\u0027", + "SomeStringProperty": "This is table entity number 01", + "SomeDateProperty": "2020-01-01T01:02:00.0000000Z", + "SomeDateProperty@odata.type": "Edm.DateTime", + "SomeGuidProperty": "0d391d16-97f1-4b9a-be68-4cc871f90001", + "SomeGuidProperty@odata.type": "Edm.Guid", + "SomeBinaryProperty": "AQIDBAU=", + "SomeBinaryProperty@odata.type": "Edm.Binary", + "SomeInt64Property": "1", + "SomeInt64Property@odata.type": "Edm.Int64", + "SomeDoubleProperty0": 1, + "SomeDoubleProperty0@odata.type": "Edm.Double", + "SomeDoubleProperty1": 1.5, + "SomeDoubleProperty1@odata.type": "Edm.Double", + "SomeIntProperty": 1 + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Mon, 07 Jun 2021 15:29:05 GMT", + "ETag": "W/\u0022datetime\u00272021-06-07T15%3A29%3A06.2231048Z\u0027\u0022", + "x-ms-request-id": "f9cfbe85-fffc-4bea-b986-b476692742fe" + }, + "ResponseBody": [] + }, + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/testtableld4mlsb1()?$format=application%2Fjson%3Bodata%3Dminimalmetadata\u0026$filter=%28PartitionKey%20eq%20%27PartitionWithi%27%27%27%27singleQuote%27%29%20and%20%28RowKey%20eq%20%2701%27%27%27%27%27%29", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; odata=minimalmetadata", + "Authorization": "Sanitized", + "DataServiceVersion": "3.0", + "traceparent": "00-33038df151c8364797e873c88a383b01-5f19c174bd94494e-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "c4adaf92afd368c45cb8a67ea01c48f2", + "x-ms-date": "Mon, 07 Jun 2021 15:29:06 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; odata=minimalmetadata", + "Date": "Mon, 07 Jun 2021 15:29:05 GMT", + "Transfer-Encoding": "chunked", + "x-ms-request-id": "6d0cf8b5-e588-4c7d-b805-eca6557ab165" + }, + "ResponseBody": { + "value": [ + { + "odata.etag": "W/\u0022datetime\u00272021-06-07T15%3A29%3A06.2231048Z\u0027\u0022", + "PartitionKey": "PartitionWithi\u0027\u0027singleQuote", + "RowKey": "01\u0027\u0027", + "SomeStringProperty": "This is table entity number 01", + "SomeDateProperty@odata.type": "Edm.DateTime", + "SomeDateProperty": "2020-01-01T01:02:00.0000000Z", + "SomeGuidProperty@odata.type": "Edm.Guid", + "SomeGuidProperty": "0d391d16-97f1-4b9a-be68-4cc871f90001", + "SomeBinaryProperty@odata.type": "Edm.Binary", + "SomeBinaryProperty": "AQIDBAU=", + "SomeInt64Property@odata.type": "Edm.Int64", + "SomeInt64Property": "1", + "SomeDoubleProperty0": 1.0, + "SomeDoubleProperty1": 1.5, + "SomeIntProperty": 1, + "Timestamp": "2021-06-07T15:29:06.2231048Z" + } + ], + "odata.metadata": "https://chrisstablesprim.table.cosmos.azure.com/$metadata#testtableld4mlsb1" + } + }, + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/Tables(\u0027testtableld4mlsb1\u0027)", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-2107b488eae3b64c8bfb667329a529ea-394e30f889742340-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "228905303134bd6e3ab505ce37eed8d4", + "x-ms-date": "Mon, 07 Jun 2021 15:29:06 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Date": "Mon, 07 Jun 2021 15:29:05 GMT", + "x-ms-request-id": "c2fe1f6c-7a7a-4739-9b5e-d4ed6789d486" + }, + "ResponseBody": [] + } + ], + "Variables": { + "COSMOS_TABLES_ENDPOINT_SUFFIX": null, + "RandomSeed": "740685547", + "TABLES_COSMOS_ACCOUNT_NAME": "chrisstablesprim", + "TABLES_PRIMARY_COSMOS_ACCOUNT_KEY": "Kg==" + } +} \ No newline at end of file diff --git a/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(CosmosTable)/UpsertAndQueryWithSingleQuoteNames(True)Async.json b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(CosmosTable)/UpsertAndQueryWithSingleQuoteNames(True)Async.json new file mode 100644 index 0000000000000..955d84acbe35f --- /dev/null +++ b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(CosmosTable)/UpsertAndQueryWithSingleQuoteNames(True)Async.json @@ -0,0 +1,166 @@ +{ + "Entries": [ + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/Tables?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json; odata=minimalmetadata", + "Authorization": "Sanitized", + "Content-Length": "33", + "Content-Type": "application/json; odata=nometadata", + "DataServiceVersion": "3.0", + "traceparent": "00-1c36a2923479414896f659910764e20b-eb658889d1d1e54b-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "6138ad43e6102e437472e2b072974186", + "x-ms-date": "Mon, 07 Jun 2021 15:29:10 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "TableName": "testtablembq8jree" + }, + "StatusCode": 201, + "ResponseHeaders": { + "Content-Type": "application/json; odata=minimalmetadata", + "Date": "Mon, 07 Jun 2021 15:29:09 GMT", + "ETag": "W/\u0022datetime\u00272021-06-07T15%3A29%3A09.5654408Z\u0027\u0022", + "Location": "https://chrisstablesprim.table.cosmos.azure.com/Tables(\u0027testtablembq8jree\u0027)", + "Transfer-Encoding": "chunked", + "x-ms-request-id": "e7a0fbb7-3bba-4868-b1d5-56a5771b3545" + }, + "ResponseBody": { + "TableName": "testtablembq8jree", + "odata.metadata": "https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element" + } + }, + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/testtablembq8jree(PartitionKey=\u0027PartitionWithi%27%27%27%27singleQuote\u0027,RowKey=\u002701%27%27%27%27\u0027)?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "636", + "Content-Type": "application/json", + "DataServiceVersion": "3.0", + "traceparent": "00-eef22f61fb87bc49a30b19e895952594-4a05cece9e099545-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "X-HTTP-Method": "MERGE", + "x-ms-client-request-id": "f00c9ca3824195e6972e278dcbbff7bd", + "x-ms-date": "Mon, 07 Jun 2021 15:29:10 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "PartitionKey": "PartitionWithi\u0027\u0027singleQuote", + "RowKey": "01\u0027\u0027", + "SomeStringProperty": "This is table entity number 01", + "SomeDateProperty": "2020-01-01T01:02:00.0000000Z", + "SomeDateProperty@odata.type": "Edm.DateTime", + "SomeGuidProperty": "0d391d16-97f1-4b9a-be68-4cc871f90001", + "SomeGuidProperty@odata.type": "Edm.Guid", + "SomeBinaryProperty": "AQIDBAU=", + "SomeBinaryProperty@odata.type": "Edm.Binary", + "SomeInt64Property": "1", + "SomeInt64Property@odata.type": "Edm.Int64", + "SomeDoubleProperty0": 1, + "SomeDoubleProperty0@odata.type": "Edm.Double", + "SomeDoubleProperty1": 1.5, + "SomeDoubleProperty1@odata.type": "Edm.Double", + "SomeIntProperty": 1 + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Mon, 07 Jun 2021 15:29:09 GMT", + "ETag": "W/\u0022datetime\u00272021-06-07T15%3A29%3A10.3014920Z\u0027\u0022", + "x-ms-request-id": "2ac9a952-c292-4084-a6eb-c78578d23afd" + }, + "ResponseBody": [] + }, + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/testtablembq8jree()?$format=application%2Fjson%3Bodata%3Dminimalmetadata\u0026$filter=%28PartitionKey%20eq%20%27PartitionWithi%27%27%27%27singleQuote%27%29%20and%20%28RowKey%20eq%20%2701%27%27%27%27%27%29", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; odata=minimalmetadata", + "Authorization": "Sanitized", + "DataServiceVersion": "3.0", + "traceparent": "00-ed848944718b9f4cb28b56668be7ec95-fb103805c1c25346-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "cc23c98a84a3a581b44a9eddc7592fd9", + "x-ms-date": "Mon, 07 Jun 2021 15:29:10 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; odata=minimalmetadata", + "Date": "Mon, 07 Jun 2021 15:29:09 GMT", + "Transfer-Encoding": "chunked", + "x-ms-request-id": "333e99f8-50f2-41c8-8162-e15e71740087" + }, + "ResponseBody": { + "value": [ + { + "odata.etag": "W/\u0022datetime\u00272021-06-07T15%3A29%3A10.3014920Z\u0027\u0022", + "PartitionKey": "PartitionWithi\u0027\u0027singleQuote", + "RowKey": "01\u0027\u0027", + "SomeStringProperty": "This is table entity number 01", + "SomeDateProperty@odata.type": "Edm.DateTime", + "SomeDateProperty": "2020-01-01T01:02:00.0000000Z", + "SomeGuidProperty@odata.type": "Edm.Guid", + "SomeGuidProperty": "0d391d16-97f1-4b9a-be68-4cc871f90001", + "SomeBinaryProperty@odata.type": "Edm.Binary", + "SomeBinaryProperty": "AQIDBAU=", + "SomeInt64Property@odata.type": "Edm.Int64", + "SomeInt64Property": "1", + "SomeDoubleProperty0": 1.0, + "SomeDoubleProperty1": 1.5, + "SomeIntProperty": 1, + "Timestamp": "2021-06-07T15:29:10.3014920Z" + } + ], + "odata.metadata": "https://chrisstablesprim.table.cosmos.azure.com/$metadata#testtablembq8jree" + } + }, + { + "RequestUri": "https://chrisstablesprim.table.cosmos.azure.com/Tables(\u0027testtablembq8jree\u0027)", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-eaaf407e35e3254d9ca6c81221b3b51f-f4f850d364348c4e-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "3c5c91fb5a3ac0d9c6a3cae1bfb562b5", + "x-ms-date": "Mon, 07 Jun 2021 15:29:11 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Date": "Mon, 07 Jun 2021 15:29:09 GMT", + "x-ms-request-id": "abd348df-b82a-4ffa-9954-0ad625393204" + }, + "ResponseBody": [] + } + ], + "Variables": { + "COSMOS_TABLES_ENDPOINT_SUFFIX": null, + "RandomSeed": "229636387", + "TABLES_COSMOS_ACCOUNT_NAME": "chrisstablesprim", + "TABLES_PRIMARY_COSMOS_ACCOUNT_KEY": "Kg==" + } +} \ No newline at end of file diff --git a/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(Storage)/UpsertAndQueryWithSingleQuoteNames(False).json b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(Storage)/UpsertAndQueryWithSingleQuoteNames(False).json new file mode 100644 index 0000000000000..f0cf9002e6664 --- /dev/null +++ b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(Storage)/UpsertAndQueryWithSingleQuoteNames(False).json @@ -0,0 +1,197 @@ +{ + "Entries": [ + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/Tables?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json; odata=minimalmetadata", + "Authorization": "Sanitized", + "Content-Length": "33", + "Content-Type": "application/json; odata=nometadata", + "DataServiceVersion": "3.0", + "traceparent": "00-33da2c34cedecb4a9681205b5726a4c4-9d4838101c9a8c4f-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "f4d81477c6bbb12dc4e035d98d332705", + "x-ms-date": "Mon, 07 Jun 2021 15:29:09 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "TableName": "testtableabac7ec1" + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Type": "application/json; odata=minimalmetadata; streaming=true; charset=utf-8", + "Date": "Mon, 07 Jun 2021 15:29:08 GMT", + "Location": "https://chrisstablesprim.table.core.windows.net/Tables(\u0027testtableabac7ec1\u0027)", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "Transfer-Encoding": "chunked", + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "f4d81477c6bbb12dc4e035d98d332705", + "x-ms-request-id": "4d67f4a7-b002-0014-26b1-5b7c7b000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": { + "odata.metadata": "https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element", + "TableName": "testtableabac7ec1" + } + }, + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/testtableabac7ec1(PartitionKey=\u0027PartitionWithi%27%27%27%27singleQuote\u0027,RowKey=\u002701%27%27%27%27\u0027)?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "636", + "Content-Type": "application/json", + "DataServiceVersion": "3.0", + "traceparent": "00-1bd5663b95d112488ebd4ee79f7b0cfc-456c73e6fb0f9349-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "ce8c16389300f1243e1b1c73b6cb2eec", + "x-ms-date": "Mon, 07 Jun 2021 15:29:09 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "PartitionKey": "PartitionWithi\u0027\u0027singleQuote", + "RowKey": "01\u0027\u0027", + "SomeStringProperty": "This is table entity number 01", + "SomeDateProperty": "2020-01-01T01:02:00.0000000Z", + "SomeDateProperty@odata.type": "Edm.DateTime", + "SomeGuidProperty": "0d391d16-97f1-4b9a-be68-4cc871f90001", + "SomeGuidProperty@odata.type": "Edm.Guid", + "SomeBinaryProperty": "AQIDBAU=", + "SomeBinaryProperty@odata.type": "Edm.Binary", + "SomeInt64Property": "1", + "SomeInt64Property@odata.type": "Edm.Int64", + "SomeDoubleProperty0": 1, + "SomeDoubleProperty0@odata.type": "Edm.Double", + "SomeDoubleProperty1": 1.5, + "SomeDoubleProperty1@odata.type": "Edm.Double", + "SomeIntProperty": 1 + }, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Mon, 07 Jun 2021 15:29:08 GMT", + "ETag": "W/\u0022datetime\u00272021-06-07T15%3A29%3A09.0395621Z\u0027\u0022", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "ce8c16389300f1243e1b1c73b6cb2eec", + "x-ms-request-id": "4d67f4b1-b002-0014-2fb1-5b7c7b000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + }, + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/testtableabac7ec1()?$format=application%2Fjson%3Bodata%3Dminimalmetadata\u0026$filter=PartitionKey%20eq%20%27PartitionWithi%27%27%27%27singleQuote%27%20and%20RowKey%20eq%20%2701%27%27%27%27%27", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; odata=minimalmetadata", + "Authorization": "Sanitized", + "DataServiceVersion": "3.0", + "traceparent": "00-43401a4febe54248b2482b55233d68f6-9bdfd0d83b73db4d-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "0ffc1f4cc41432e2924b938e5e3faed2", + "x-ms-date": "Mon, 07 Jun 2021 15:29:09 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Type": "application/json; odata=minimalmetadata; streaming=true; charset=utf-8", + "Date": "Mon, 07 Jun 2021 15:29:08 GMT", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "Transfer-Encoding": "chunked", + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "0ffc1f4cc41432e2924b938e5e3faed2", + "x-ms-request-id": "4d67f4b9-b002-0014-37b1-5b7c7b000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": { + "odata.metadata": "https://chrisstablesprim.table.core.windows.net/$metadata#testtableabac7ec1", + "value": [ + { + "odata.etag": "W/\u0022datetime\u00272021-06-07T15%3A29%3A09.0395621Z\u0027\u0022", + "PartitionKey": "PartitionWithi\u0027\u0027singleQuote", + "RowKey": "01\u0027\u0027", + "Timestamp": "2021-06-07T15:29:09.0395621Z", + "SomeBinaryProperty@odata.type": "Edm.Binary", + "SomeBinaryProperty": "AQIDBAU=", + "SomeDateProperty@odata.type": "Edm.DateTime", + "SomeDateProperty": "2020-01-01T01:02:00Z", + "SomeDoubleProperty0": 1.0, + "SomeDoubleProperty1": 1.5, + "SomeGuidProperty@odata.type": "Edm.Guid", + "SomeGuidProperty": "0d391d16-97f1-4b9a-be68-4cc871f90001", + "SomeInt64Property@odata.type": "Edm.Int64", + "SomeInt64Property": "1", + "SomeIntProperty": 1, + "SomeStringProperty": "This is table entity number 01" + } + ] + } + }, + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/Tables(\u0027testtableabac7ec1\u0027)", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-0e26d59cd8a89d4b9fb40bab4655cf6d-38201b3dc72df64b-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "891463cf5139e46ff0e6b6a0aabafbf9", + "x-ms-date": "Mon, 07 Jun 2021 15:29:09 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Mon, 07 Jun 2021 15:29:08 GMT", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "891463cf5139e46ff0e6b6a0aabafbf9", + "x-ms-request-id": "4d67f4c4-b002-0014-41b1-5b7c7b000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + } + ], + "Variables": { + "RandomSeed": "1360667883", + "STORAGE_ENDPOINT_SUFFIX": "core.windows.net", + "TABLES_PRIMARY_STORAGE_ACCOUNT_KEY": "Kg==", + "TABLES_STORAGE_ACCOUNT_NAME": "chrisstablesprim" + } +} \ No newline at end of file diff --git a/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(Storage)/UpsertAndQueryWithSingleQuoteNames(False)Async.json b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(Storage)/UpsertAndQueryWithSingleQuoteNames(False)Async.json new file mode 100644 index 0000000000000..3b73bfb6dfef2 --- /dev/null +++ b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(Storage)/UpsertAndQueryWithSingleQuoteNames(False)Async.json @@ -0,0 +1,197 @@ +{ + "Entries": [ + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/Tables?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json; odata=minimalmetadata", + "Authorization": "Sanitized", + "Content-Length": "33", + "Content-Type": "application/json; odata=nometadata", + "DataServiceVersion": "3.0", + "traceparent": "00-cf9d7ec368fc84409b48109bd74a1aaf-e4ef711c172c4e45-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "bd159efbdaf17c1301a8986b0fc64af1", + "x-ms-date": "Mon, 07 Jun 2021 15:29:13 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "TableName": "testtablef75jgdzj" + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Type": "application/json; odata=minimalmetadata; streaming=true; charset=utf-8", + "Date": "Mon, 07 Jun 2021 15:29:12 GMT", + "Location": "https://chrisstablesprim.table.core.windows.net/Tables(\u0027testtablef75jgdzj\u0027)", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "Transfer-Encoding": "chunked", + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "bd159efbdaf17c1301a8986b0fc64af1", + "x-ms-request-id": "4d67f669-b002-0014-52b1-5b7c7b000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": { + "odata.metadata": "https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element", + "TableName": "testtablef75jgdzj" + } + }, + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/testtablef75jgdzj(PartitionKey=\u0027PartitionWithi%27%27%27%27singleQuote\u0027,RowKey=\u002701%27%27%27%27\u0027)?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "636", + "Content-Type": "application/json", + "DataServiceVersion": "3.0", + "traceparent": "00-eefb08d4242a964cbe86d77f41e9efb5-80c831504ac83943-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "a17500cef2bff00c4d86d542a53054c1", + "x-ms-date": "Mon, 07 Jun 2021 15:29:13 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "PartitionKey": "PartitionWithi\u0027\u0027singleQuote", + "RowKey": "01\u0027\u0027", + "SomeStringProperty": "This is table entity number 01", + "SomeDateProperty": "2020-01-01T01:02:00.0000000Z", + "SomeDateProperty@odata.type": "Edm.DateTime", + "SomeGuidProperty": "0d391d16-97f1-4b9a-be68-4cc871f90001", + "SomeGuidProperty@odata.type": "Edm.Guid", + "SomeBinaryProperty": "AQIDBAU=", + "SomeBinaryProperty@odata.type": "Edm.Binary", + "SomeInt64Property": "1", + "SomeInt64Property@odata.type": "Edm.Int64", + "SomeDoubleProperty0": 1, + "SomeDoubleProperty0@odata.type": "Edm.Double", + "SomeDoubleProperty1": 1.5, + "SomeDoubleProperty1@odata.type": "Edm.Double", + "SomeIntProperty": 1 + }, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Mon, 07 Jun 2021 15:29:12 GMT", + "ETag": "W/\u0022datetime\u00272021-06-07T15%3A29%3A12.7181978Z\u0027\u0022", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "a17500cef2bff00c4d86d542a53054c1", + "x-ms-request-id": "4d67f674-b002-0014-5ab1-5b7c7b000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + }, + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/testtablef75jgdzj()?$format=application%2Fjson%3Bodata%3Dminimalmetadata\u0026$filter=PartitionKey%20eq%20%27PartitionWithi%27%27%27%27singleQuote%27%20and%20RowKey%20eq%20%2701%27%27%27%27%27", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; odata=minimalmetadata", + "Authorization": "Sanitized", + "DataServiceVersion": "3.0", + "traceparent": "00-cd41158abf116746bd4a290a3e84fe56-9cd0339bd1344546-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "1cdf0e9f1103443c3478e00a2cfd5461", + "x-ms-date": "Mon, 07 Jun 2021 15:29:13 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Type": "application/json; odata=minimalmetadata; streaming=true; charset=utf-8", + "Date": "Mon, 07 Jun 2021 15:29:12 GMT", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "Transfer-Encoding": "chunked", + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "1cdf0e9f1103443c3478e00a2cfd5461", + "x-ms-request-id": "4d67f67c-b002-0014-61b1-5b7c7b000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": { + "odata.metadata": "https://chrisstablesprim.table.core.windows.net/$metadata#testtablef75jgdzj", + "value": [ + { + "odata.etag": "W/\u0022datetime\u00272021-06-07T15%3A29%3A12.7181978Z\u0027\u0022", + "PartitionKey": "PartitionWithi\u0027\u0027singleQuote", + "RowKey": "01\u0027\u0027", + "Timestamp": "2021-06-07T15:29:12.7181978Z", + "SomeBinaryProperty@odata.type": "Edm.Binary", + "SomeBinaryProperty": "AQIDBAU=", + "SomeDateProperty@odata.type": "Edm.DateTime", + "SomeDateProperty": "2020-01-01T01:02:00Z", + "SomeDoubleProperty0": 1.0, + "SomeDoubleProperty1": 1.5, + "SomeGuidProperty@odata.type": "Edm.Guid", + "SomeGuidProperty": "0d391d16-97f1-4b9a-be68-4cc871f90001", + "SomeInt64Property@odata.type": "Edm.Int64", + "SomeInt64Property": "1", + "SomeIntProperty": 1, + "SomeStringProperty": "This is table entity number 01" + } + ] + } + }, + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/Tables(\u0027testtablef75jgdzj\u0027)", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-ca0b58b176836e41ae1792c30c1f1ff6-9f2ef996dc5a334c-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "e97a891a419909ec9225706a05d0d6d1", + "x-ms-date": "Mon, 07 Jun 2021 15:29:13 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Mon, 07 Jun 2021 15:29:12 GMT", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "e97a891a419909ec9225706a05d0d6d1", + "x-ms-request-id": "4d67f688-b002-0014-6db1-5b7c7b000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + } + ], + "Variables": { + "RandomSeed": "1004814168", + "STORAGE_ENDPOINT_SUFFIX": "core.windows.net", + "TABLES_PRIMARY_STORAGE_ACCOUNT_KEY": "Kg==", + "TABLES_STORAGE_ACCOUNT_NAME": "chrisstablesprim" + } +} \ No newline at end of file diff --git a/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(Storage)/UpsertAndQueryWithSingleQuoteNames(True).json b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(Storage)/UpsertAndQueryWithSingleQuoteNames(True).json new file mode 100644 index 0000000000000..c30112fe776fa --- /dev/null +++ b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(Storage)/UpsertAndQueryWithSingleQuoteNames(True).json @@ -0,0 +1,197 @@ +{ + "Entries": [ + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/Tables?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json; odata=minimalmetadata", + "Authorization": "Sanitized", + "Content-Length": "33", + "Content-Type": "application/json; odata=nometadata", + "DataServiceVersion": "3.0", + "traceparent": "00-866fc0df316f7344b80fe40d38af55de-0a1ff57d2a266c49-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "e9ba727974f916b29b930f934b6e32c0", + "x-ms-date": "Mon, 07 Jun 2021 15:29:08 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "TableName": "testtable5bhz5jbs" + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Type": "application/json; odata=minimalmetadata; streaming=true; charset=utf-8", + "Date": "Mon, 07 Jun 2021 15:29:08 GMT", + "Location": "https://chrisstablesprim.table.core.windows.net/Tables(\u0027testtable5bhz5jbs\u0027)", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "Transfer-Encoding": "chunked", + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "e9ba727974f916b29b930f934b6e32c0", + "x-ms-request-id": "4d67f48a-b002-0014-0cb1-5b7c7b000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": { + "odata.metadata": "https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element", + "TableName": "testtable5bhz5jbs" + } + }, + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/testtable5bhz5jbs(PartitionKey=\u0027PartitionWithi%27%27%27%27singleQuote\u0027,RowKey=\u002701%27%27%27%27\u0027)?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "636", + "Content-Type": "application/json", + "DataServiceVersion": "3.0", + "traceparent": "00-c973172e41094449876a13a04361d103-1f40b610ddf9a544-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "a8ae9162138f494bf2a49660a1ada5db", + "x-ms-date": "Mon, 07 Jun 2021 15:29:09 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "PartitionKey": "PartitionWithi\u0027\u0027singleQuote", + "RowKey": "01\u0027\u0027", + "SomeStringProperty": "This is table entity number 01", + "SomeDateProperty": "2020-01-01T01:02:00.0000000Z", + "SomeDateProperty@odata.type": "Edm.DateTime", + "SomeGuidProperty": "0d391d16-97f1-4b9a-be68-4cc871f90001", + "SomeGuidProperty@odata.type": "Edm.Guid", + "SomeBinaryProperty": "AQIDBAU=", + "SomeBinaryProperty@odata.type": "Edm.Binary", + "SomeInt64Property": "1", + "SomeInt64Property@odata.type": "Edm.Int64", + "SomeDoubleProperty0": 1, + "SomeDoubleProperty0@odata.type": "Edm.Double", + "SomeDoubleProperty1": 1.5, + "SomeDoubleProperty1@odata.type": "Edm.Double", + "SomeIntProperty": 1 + }, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Mon, 07 Jun 2021 15:29:08 GMT", + "ETag": "W/\u0022datetime\u00272021-06-07T15%3A29%3A08.7013192Z\u0027\u0022", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "a8ae9162138f494bf2a49660a1ada5db", + "x-ms-request-id": "4d67f48f-b002-0014-0fb1-5b7c7b000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + }, + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/testtable5bhz5jbs()?$format=application%2Fjson%3Bodata%3Dminimalmetadata\u0026$filter=%28PartitionKey%20eq%20%27PartitionWithi%27%27%27%27singleQuote%27%29%20and%20%28RowKey%20eq%20%2701%27%27%27%27%27%29", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; odata=minimalmetadata", + "Authorization": "Sanitized", + "DataServiceVersion": "3.0", + "traceparent": "00-0ef164b23ad59643b54ad97271eb9d75-1200027fbd035b43-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "dbec7f7d1dd3913d342e4603938889d6", + "x-ms-date": "Mon, 07 Jun 2021 15:29:09 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Type": "application/json; odata=minimalmetadata; streaming=true; charset=utf-8", + "Date": "Mon, 07 Jun 2021 15:29:08 GMT", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "Transfer-Encoding": "chunked", + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "dbec7f7d1dd3913d342e4603938889d6", + "x-ms-request-id": "4d67f498-b002-0014-18b1-5b7c7b000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": { + "odata.metadata": "https://chrisstablesprim.table.core.windows.net/$metadata#testtable5bhz5jbs", + "value": [ + { + "odata.etag": "W/\u0022datetime\u00272021-06-07T15%3A29%3A08.7013192Z\u0027\u0022", + "PartitionKey": "PartitionWithi\u0027\u0027singleQuote", + "RowKey": "01\u0027\u0027", + "Timestamp": "2021-06-07T15:29:08.7013192Z", + "SomeBinaryProperty@odata.type": "Edm.Binary", + "SomeBinaryProperty": "AQIDBAU=", + "SomeDateProperty@odata.type": "Edm.DateTime", + "SomeDateProperty": "2020-01-01T01:02:00Z", + "SomeDoubleProperty0": 1.0, + "SomeDoubleProperty1": 1.5, + "SomeGuidProperty@odata.type": "Edm.Guid", + "SomeGuidProperty": "0d391d16-97f1-4b9a-be68-4cc871f90001", + "SomeInt64Property@odata.type": "Edm.Int64", + "SomeInt64Property": "1", + "SomeIntProperty": 1, + "SomeStringProperty": "This is table entity number 01" + } + ] + } + }, + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/Tables(\u0027testtable5bhz5jbs\u0027)", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-9b5d5314f152964b9574b6fb10d4311a-d57260951e029f49-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "4be565326afa66aa2770f755dd5174ed", + "x-ms-date": "Mon, 07 Jun 2021 15:29:09 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Mon, 07 Jun 2021 15:29:08 GMT", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "4be565326afa66aa2770f755dd5174ed", + "x-ms-request-id": "4d67f49f-b002-0014-1eb1-5b7c7b000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + } + ], + "Variables": { + "RandomSeed": "1005907296", + "STORAGE_ENDPOINT_SUFFIX": "core.windows.net", + "TABLES_PRIMARY_STORAGE_ACCOUNT_KEY": "Kg==", + "TABLES_STORAGE_ACCOUNT_NAME": "chrisstablesprim" + } +} \ No newline at end of file diff --git a/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(Storage)/UpsertAndQueryWithSingleQuoteNames(True)Async.json b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(Storage)/UpsertAndQueryWithSingleQuoteNames(True)Async.json new file mode 100644 index 0000000000000..1ace8deeb5ca9 --- /dev/null +++ b/sdk/tables/Azure.Data.Tables/tests/SessionRecords/TableClientLiveTests(Storage)/UpsertAndQueryWithSingleQuoteNames(True)Async.json @@ -0,0 +1,197 @@ +{ + "Entries": [ + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/Tables?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json; odata=minimalmetadata", + "Authorization": "Sanitized", + "Content-Length": "33", + "Content-Type": "application/json; odata=nometadata", + "DataServiceVersion": "3.0", + "traceparent": "00-cf97f09de487934aa81eab57594b9ab4-40404c5f647e3e4b-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "7777f0933ce39d17810833180361f07f", + "x-ms-date": "Mon, 07 Jun 2021 15:29:12 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "TableName": "testtableryba8tni" + }, + "StatusCode": 201, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Type": "application/json; odata=minimalmetadata; streaming=true; charset=utf-8", + "Date": "Mon, 07 Jun 2021 15:29:11 GMT", + "Location": "https://chrisstablesprim.table.core.windows.net/Tables(\u0027testtableryba8tni\u0027)", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "Transfer-Encoding": "chunked", + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "7777f0933ce39d17810833180361f07f", + "x-ms-request-id": "4d67f63b-b002-0014-27b1-5b7c7b000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": { + "odata.metadata": "https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element", + "TableName": "testtableryba8tni" + } + }, + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/testtableryba8tni(PartitionKey=\u0027PartitionWithi%27%27%27%27singleQuote\u0027,RowKey=\u002701%27%27%27%27\u0027)?$format=application%2Fjson%3Bodata%3Dminimalmetadata", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "636", + "Content-Type": "application/json", + "DataServiceVersion": "3.0", + "traceparent": "00-a14c6340ca1ac94090007f5e0779b19e-2de5e8339b933349-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "6806e2a6612098cfef6290dd2eaaf7c3", + "x-ms-date": "Mon, 07 Jun 2021 15:29:12 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": { + "PartitionKey": "PartitionWithi\u0027\u0027singleQuote", + "RowKey": "01\u0027\u0027", + "SomeStringProperty": "This is table entity number 01", + "SomeDateProperty": "2020-01-01T01:02:00.0000000Z", + "SomeDateProperty@odata.type": "Edm.DateTime", + "SomeGuidProperty": "0d391d16-97f1-4b9a-be68-4cc871f90001", + "SomeGuidProperty@odata.type": "Edm.Guid", + "SomeBinaryProperty": "AQIDBAU=", + "SomeBinaryProperty@odata.type": "Edm.Binary", + "SomeInt64Property": "1", + "SomeInt64Property@odata.type": "Edm.Int64", + "SomeDoubleProperty0": 1, + "SomeDoubleProperty0@odata.type": "Edm.Double", + "SomeDoubleProperty1": 1.5, + "SomeDoubleProperty1@odata.type": "Edm.Double", + "SomeIntProperty": 1 + }, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Mon, 07 Jun 2021 15:29:11 GMT", + "ETag": "W/\u0022datetime\u00272021-06-07T15%3A29%3A12.3759521Z\u0027\u0022", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "6806e2a6612098cfef6290dd2eaaf7c3", + "x-ms-request-id": "4d67f646-b002-0014-31b1-5b7c7b000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + }, + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/testtableryba8tni()?$format=application%2Fjson%3Bodata%3Dminimalmetadata\u0026$filter=%28PartitionKey%20eq%20%27PartitionWithi%27%27%27%27singleQuote%27%29%20and%20%28RowKey%20eq%20%2701%27%27%27%27%27%29", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; odata=minimalmetadata", + "Authorization": "Sanitized", + "DataServiceVersion": "3.0", + "traceparent": "00-65d9593bcc2bce42972a8eb814953447-da7bd2569e7de040-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "42a10ba21a82fd0f28aad8658528b73f", + "x-ms-date": "Mon, 07 Jun 2021 15:29:12 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Type": "application/json; odata=minimalmetadata; streaming=true; charset=utf-8", + "Date": "Mon, 07 Jun 2021 15:29:11 GMT", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "Transfer-Encoding": "chunked", + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "42a10ba21a82fd0f28aad8658528b73f", + "x-ms-request-id": "4d67f64e-b002-0014-38b1-5b7c7b000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": { + "odata.metadata": "https://chrisstablesprim.table.core.windows.net/$metadata#testtableryba8tni", + "value": [ + { + "odata.etag": "W/\u0022datetime\u00272021-06-07T15%3A29%3A12.3759521Z\u0027\u0022", + "PartitionKey": "PartitionWithi\u0027\u0027singleQuote", + "RowKey": "01\u0027\u0027", + "Timestamp": "2021-06-07T15:29:12.3759521Z", + "SomeBinaryProperty@odata.type": "Edm.Binary", + "SomeBinaryProperty": "AQIDBAU=", + "SomeDateProperty@odata.type": "Edm.DateTime", + "SomeDateProperty": "2020-01-01T01:02:00Z", + "SomeDoubleProperty0": 1.0, + "SomeDoubleProperty1": 1.5, + "SomeGuidProperty@odata.type": "Edm.Guid", + "SomeGuidProperty": "0d391d16-97f1-4b9a-be68-4cc871f90001", + "SomeInt64Property@odata.type": "Edm.Int64", + "SomeInt64Property": "1", + "SomeIntProperty": 1, + "SomeStringProperty": "This is table entity number 01" + } + ] + } + }, + { + "RequestUri": "https://chrisstablesprim.table.core.windows.net/Tables(\u0027testtableryba8tni\u0027)", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-b37a21ce39cddd42b9113f2c357a3f6f-ff5e8f323c194446-00", + "User-Agent": [ + "azsdk-net-Data.Tables/12.0.0-alpha.20210607.1", + "(.NET 5.0.6; Microsoft Windows 10.0.19043)" + ], + "x-ms-client-request-id": "739c88263824323f20df8781ac396ed6", + "x-ms-date": "Mon, 07 Jun 2021 15:29:13 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "0", + "Date": "Mon, 07 Jun 2021 15:29:12 GMT", + "Server": [ + "Windows-Azure-Table/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "739c88263824323f20df8781ac396ed6", + "x-ms-request-id": "4d67f65c-b002-0014-46b1-5b7c7b000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + } + ], + "Variables": { + "RandomSeed": "2137734364", + "STORAGE_ENDPOINT_SUFFIX": "core.windows.net", + "TABLES_PRIMARY_STORAGE_ACCOUNT_KEY": "Kg==", + "TABLES_STORAGE_ACCOUNT_NAME": "chrisstablesprim" + } +} \ No newline at end of file diff --git a/sdk/tables/Azure.Data.Tables/tests/TableClientLiveTests.cs b/sdk/tables/Azure.Data.Tables/tests/TableClientLiveTests.cs index cba084ff935cf..3894201656d0d 100644 --- a/sdk/tables/Azure.Data.Tables/tests/TableClientLiveTests.cs +++ b/sdk/tables/Azure.Data.Tables/tests/TableClientLiveTests.cs @@ -27,6 +27,31 @@ public TableClientLiveTests(bool isAsync, TableEndpointType endpointType) : base endpointType /* To record tests, add this argument, RecordedTestMode.Record */) { } + [RecordedTest] + public async Task UpsertAndQueryWithSingleQuoteNames([Values(true, false)] bool expressionQuery) + { + List entityResults; + string partitionKeyValue = "PartitionWithi''singleQuote"; + string rowKeyValue = "01''"; + TableEntity entityToCreate = CreateTableEntities(partitionKeyValue, 1).First(); + entityToCreate.RowKey = rowKeyValue; + + // Create the new entities. + await client.UpsertEntityAsync(entityToCreate); + + if (expressionQuery) + { + // Query the entities with expression. + entityResults = await client.QueryAsync(e => e.PartitionKey == partitionKeyValue && e.RowKey == rowKeyValue).ToEnumerableAsync().ConfigureAwait(false); + } + else + { + // Query the entities with string filter. + entityResults = await client.QueryAsync(TableOdataFilter.Create($"PartitionKey eq {partitionKeyValue} and RowKey eq {rowKeyValue}")).ToEnumerableAsync().ConfigureAwait(false); + } + Assert.AreEqual(1, entityResults.Count, "The entity result count should match the created count"); + } + /// /// Validates the functionality of the TableClient. ///