Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,7 @@ public virtual bool SupportsJsonType
=> EngineType switch
{
SqlServerEngineType.SqlServer => SqlServerCompatibilityLevel >= 170,
// TODO: #36460
// At the time of writing, Azure SQL Database does not yet support OPENJSON over the JSON data type.
// This should get reenabled by the time we GA.
SqlServerEngineType.AzureSql => false,
// SqlServerEngineType.AzureSql => AzureSqlCompatibilityLevel >= 170,
SqlServerEngineType.AzureSql => AzureSqlCompatibilityLevel >= 170,
SqlServerEngineType.AzureSynapse => false,
SqlServerEngineType.Unknown => false, // TODO: We shouldn't observe Unknown here, #36477
_ => throw new UnreachableException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,10 +606,7 @@ protected override Expression VisitJsonScalar(JsonScalarExpression jsonScalarExp
// 3. Can do JSON-specific decoding (e.g. base64 for varbinary)
// Note that RETURNING is only (currently) supported over the json type (not nvarchar(max)).
// Note that we don't need to check the compatibility level - if the json type is being used, then RETURNING is supported.
var useJsonValueReturningClause = !jsonQuery
&& jsonScalarExpression.Json.TypeMapping?.StoreType is "json"
// Temporarily disabling for Azure SQL, which doesn't yet support RETURNING; this should get removed for 10 (see #36460).
&& _sqlServerSingletonOptions.EngineType is not SqlServerEngineType.AzureSql;
var useJsonValueReturningClause = !jsonQuery && jsonScalarExpression.Json.TypeMapping?.StoreType is "json";

// For JSON_VALUE(), if we can use the RETURNING clause, always do that.
// Otherwise, JSON_VALUE always returns nvarchar(4000) (https://learn.microsoft.com/sql/t-sql/functions/json-value-transact-sql),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1588,13 +1588,8 @@ public void Json_is_mapped_to_json_type_with_UseAzureSql_by_default()
{
var typeMappingSource = CreateTypeMappingSource(o => o.UseAzureSql());

// TODO: #36460
// At the time of writing, Azure SQL Database does not yet support OPENJSON over the JSON data type.
// This should get reenabled by the time we GA.
Assert.Equal("nvarchar(max)", typeMappingSource.GetMapping(typeof(JsonTypePlaceholder)).StoreType);
Assert.Equal("nvarchar(max)", typeMappingSource.GetMapping(typeof(int[])).StoreType);
// Assert.Equal("json", typeMappingSource.GetMapping(typeof(JsonTypePlaceholder)).StoreType);
// Assert.Equal("json", typeMappingSource.GetMapping(typeof(int[])).StoreType);
Assert.Equal("json", typeMappingSource.GetMapping(typeof(JsonTypePlaceholder)).StoreType);
Assert.Equal("json", typeMappingSource.GetMapping(typeof(int[])).StoreType);
}

[ConditionalFact]
Expand Down
Loading