Skip to content

Conversation

@edwardneal
Copy link
Contributor

Description

This PR does two things:

  1. Enables all SqlVector tests to be run against a database server which supports the vector type (not just Azure SQL instances.)
  2. Adds three unusual values (float.MinValue, a value which can't be represented cleanly as a float, and negative zero) to demonstrate that they roundtrip, as per my comments on the original PR.

Issues

Fixes #3789. Builds on my comments on the original PR #3433.

Testing

SqlVector tests continue to pass against a local SQL 2025 instance and a SQL Azure instance.

@edwardneal edwardneal requested a review from a team as a code owner November 21, 2025 06:26
@apoorvdeshmukh
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

/// 'vector' data type. If a connection cannot be established or an error occurs during the query, the method
/// returns <see langword="false"/>.</remarks>
/// <returns><see langword="true"/> if the 'vector' data type is supported; otherwise, <see langword="false"/>.</returns>
public static bool IsSupportedSqlVector()
Copy link
Member

Choose a reason for hiding this comment

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

Can you convert this into a property, and only query database on its initialization?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I've done this (along with IsSupportedDataClassification as you mentioned in the other comment, although I've changed this method's approach slightly to use OBJECT_ID rather than to wait for an error.)

I've also cleaned up the test conditions slightly, since both properties will return false if the TCP connection string is unspecified.

/// Checks if object SYS.SENSITIVITY_CLASSIFICATIONS exists in SQL Server
/// </summary>
/// <returns>True, if target SQL Server supports Data Classification</returns>
public static bool IsSupportedDataClassification()
Copy link
Member

Choose a reason for hiding this comment

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

I would also change this to a property and reduce server calls.

These are IsDataClassificationSupported and IsVectorSupported.
In the process, removed the attempted caching for IsTDS8Supported. This caching didn't work properly, and never should have - the ctor for CertificateTest changed the certificate for the SQL Server instance, so the cached data could have been out of date.
@paulmedynski
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Contributor

@paulmedynski paulmedynski left a comment

Choose a reason for hiding this comment

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

Can we avoid querying the server more than once per DataTestUtility property that you have touched?

@paulmedynski paulmedynski self-assigned this Nov 21, 2025
paulmedynski
paulmedynski previously approved these changes Dec 5, 2025
@paulmedynski
Copy link
Contributor

@edwardneal - Looks like some conflicts need to be resolved here.

@edwardneal
Copy link
Contributor Author

Thanks @paulmedynski, I've just merged.

@apoorvdeshmukh
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend tests for float.MinValue, 1.01f, float.NegativeZero

4 participants