microsoft / microsoft/TdsLib

Column type 0x20 and 0x21 unspecified, but returned by AWS-based SQL Server instances

Open
#27 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
25
Forks
12
Avg merge
5h 56m
Merged PRs (30d)
2

Description

Specifically on SQL Server running on AWS as service, there is a column type 0x20 and 0x21 being returned. On other SQL Server editions (on-premises, Azure) this has not yet been found in identical scenarios.

Wireshark TDS seems also unable to handle it, leading to nonsense column metadata being reported.

The documented types are listed in 2.2.5 Data Type Definitions.

Is it possible to add documentation and logic in C# how to interprete these column types 0x20 and 0x21 as part of the TDS specification to allow building a custom SQL Server client?

TDS column type 0x20

Reproduction: start SQL Server Management Studio and connect to SQL Server on AWS. First statement is:

Image

With result for the first column (a non-casted 1 as value) a column data type 0x20:

Image

TDS column type 0x21

Reproduction: run a query returning 1 cased as tinyint/shortint/int (always 0x21):

Image

Resulting data type for column according to SQL Server instance is column data type 0x21:

Image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the TDS type definitions in section 2.2.5 with the existing C# handling of column metadata. Reproduce 0x20 with a non-casted 1 and 0x21 with the tinyint, shortint, or int queries against SQL Server on AWS. Done means the two types' semantics are documented and handled well enough for a custom TDS client.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, sql
Domain
backend-api-design, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.