Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Merge | Align BitConverter/BinaryPrimitives usage netfx/netcore#2963

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

MichelZ
Copy link
Contributor

This uses System.Buffers.Binary types instead of BitConverter to align netfx with netcore

Part of#2953

Copy link
Contributor

@benrr101benrr101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It's worth explicitly calling out that the the behavior ofBitConverter andBinaryPrimitives is not the same (BinaryPrimitives require specifying the endianness whileBitConverter uses the system's endianness). For netcore, it makes sense to specify little-endian conversion since netcore can be expected to run on big-endian systems. For netfx, it made sense to use the system endianness since it wasn't expected that netfx would run on big-endian systems (though I'm not sure how accurate that expectation is). Thus, bringing the netcore implementation to the netfx codebaseshould be safe.

@benrr101benrr101 added the Common Project 🚮Things that relate to the common project project labelNov 4, 2024
@benrr101
Copy link
Contributor

/azp run

@azure-pipelinesAzure Pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MichelZ
Copy link
ContributorAuthor

Grrr AZD

@MichelZMichelZforce-pushed themerge-tdsparser-bitconverter-binaryprimitives branch from590cd5f toa2a39e4CompareNovember 6, 2024 20:13
@codecovCodecov
Copy link

codecovbot commentedNov 6, 2024
edited
Loading

Codecov Report

Attention: Patch coverage is33.33333% with2 lines in your changes missing coverage. Please review.

Project coverage is 72.44%. Comparing base(9d5ca32) to head(a2a39e4).
Report is 51 commits behind head on main.

Files with missing linesPatch %Lines
...nt/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs33.33%2 Missing⚠️
Additional details and impacted files
@@            Coverage Diff             @@##             main    #2963      +/-   ##==========================================+ Coverage   72.31%   72.44%   +0.12%==========================================  Files         288      288                Lines       59660    59529     -131     ==========================================- Hits        43145    43125      -20+ Misses      16515    16404     -111
FlagCoverage Δ
addons92.58% <ø> (ø)
netcore75.36% <ø> (-0.07%)⬇️
netfx70.92% <33.33%> (+0.23%)⬆️

Flags with carried forward coverage won't be shown.Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

@MichelZ
Copy link
ContributorAuthor

Anything I can do to move this along?

@MichelZMichelZ changed the titleAlign BitConverter/BinaryPrimitives usage netfx/netcoreMerge | Align BitConverter/BinaryPrimitives usage netfx/netcoreNov 24, 2024
@mdaigle
Copy link
Contributor

mdaigle commentedNov 25, 2024
edited
Loading

It's worth explicitly calling out that the the behavior ofBitConverter andBinaryPrimitives is not the same (BinaryPrimitives require specifying the endianness whileBitConverter uses the system's endianness). For netcore, it makes sense to specify little-endian conversion since netcore can be expected to run on big-endian systems. For netfx, it made sense to use the system endianness since it wasn't expected that netfx would run on big-endian systems (though I'm not sure how accurate that expectation is). Thus, bringing the netcore implementation to the netfx codebaseshould be safe.

In fact, all integer values in TDS should be represented in little endian unless it's specifically mentioned that they should be big endian. The only fields with special treatment are:

  • VERSION inPL_OPTION_TOKEN
  • PL_OFFSET andPL_OPTION_LENGTH inPRELOGIN
  • SPID andLength in the packet header

It looks like we only touch the fed auth options packet and row level data field parsing in this PR, so little endian should be correct.

@benrr101benrr101 merged commit882045a intodotnet:mainNov 25, 2024
76 checks passed
@benrr101benrr101 added this to the6.0.0 milestoneNov 25, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ErikEJErikEJErikEJ left review comments

@benrr101benrr101benrr101 approved these changes

@mdaiglemdaiglemdaigle approved these changes

@cheenamalhotracheenamalhotraAwaiting requested review from cheenamalhotra

@samsharma2700samsharma2700Awaiting requested review from samsharma2700

Assignees
No one assigned
Labels
Common Project 🚮Things that relate to the common project project
Projects
None yet
Milestone
6.1-preview1
Development

Successfully merging this pull request may close these issues.

5 participants
@MichelZ@benrr101@mdaigle@ErikEJ@cheenamalhotra

[8]ページ先頭

©2009-2025 Movatter.jp