Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Support : Investigate and update the conversion matrix used by smi and make sure that warning in the code is satisfied #2733

Closed
apoorvdeshmukh opened this issue Jul 30, 2024 · 1 comment
Assignees
Labels
Area\Json Issues that are targeted for the Json feature in the driver.

Comments

@apoorvdeshmukh
Copy link
Contributor

apoorvdeshmukh commented Jul 30, 2024

Investigate and update the conversion matrix used by smi and make sure that this warning in the code is satisfied

private static bool CanAccessGetterDirectly(SmiMetaData metaData, ExtendedClrTypeCode setterTypeCode)
{
// Make sure no-one adds new ExtendedType, nor SqlDbType without updating this file!
Debug.Assert(ExtendedClrTypeCode.First == 0 && (int)ExtendedClrTypeCode.Last == s_canAccessGetterDirectly.GetLength(0) - 1, "ExtendedClrTypeCodes does not match with __canAccessGetterDirectly");
Debug.Assert(SqlDbType.BigInt == 0 && (int)SqlDbType.DateTimeOffset == s_canAccessGetterDirectly.GetLength(1) - 1, "SqlDbType does not match with __canAccessGetterDirectly");
Debug.Assert(ExtendedClrTypeCode.First <= setterTypeCode && ExtendedClrTypeCode.Last >= setterTypeCode);
Debug.Assert(SqlDbType.BigInt <= metaData.SqlDbType && SqlDbType.DateTimeOffset >= metaData.SqlDbType);

The CI runs on Release builds so the CI will not save you from violating assertions in this project.

You will probably need the sql server team to define the extensions to the conversion operations tables that start at

private static readonly bool[,] s_canAccessSetterDirectly = {

I suspect that json to binary might be the only conversion but someone needs to make that decision.

Originally posted by @Wraith2 in #2722 (comment)

@apoorvdeshmukh apoorvdeshmukh self-assigned this Jul 30, 2024
@apoorvdeshmukh apoorvdeshmukh added the Area\ClientX Issues that are targeted for ClientX codebase. label Jul 30, 2024
@saurabh500 saurabh500 added Area\Json Issues that are targeted for the Json feature in the driver. and removed Area\ClientX Issues that are targeted for ClientX codebase. labels Aug 15, 2024
@cheenamalhotra
Copy link
Member

Given the plan to remove Context Connection and SMI related codebase in #2838 (comment), I believe this may no longer be applicable. Please reopen if needed.

@cheenamalhotra cheenamalhotra closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area\Json Issues that are targeted for the Json feature in the driver.
Projects
None yet
Development

No branches or pull requests

3 participants