Skip to content

Conversation

@DavidWiseman
Copy link
Collaborator

Fix truncation of TableSizeDatabases parameter that can occur due to LIKE encoding causing the text length to be increased from its calculated size.

Fix truncation of TableSizeDatabases parameter that can occur due to LIKE encoding causing the text length to be increased from its calculated size.
Copilot AI review requested due to automatic review settings October 13, 2025 10:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a parameter truncation issue in the TableSize collection functionality where the TableSizeDatabases parameter could be truncated due to LIKE encoding causing the text length to exceed its calculated size.

Key Changes:

  • Modified SqlParameter constructor for TableSizeDatabases to explicitly specify NVarChar with maximum length (-1)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

{
param = new[] { new SqlParameter("SizeThresholdMB", Source.TableSizeCollectionThresholdMB ?? TableSizeCollectionThresholdMBDefault),
new SqlParameter("TableSizeDatabases", Source.TableSizeDatabases ?? TableSizeDatabasesDefault),
new SqlParameter("TableSizeDatabases", SqlDbType.NVarChar,-1) { Value = Source.TableSizeDatabases ?? TableSizeDatabasesDefault},
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

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

[nitpick] There should be a space after the comma between SqlDbType.NVarChar and -1 for consistency with coding standards.

Copilot uses AI. Check for mistakes.
@DavidWiseman DavidWiseman merged commit 2a6c072 into trimble-oss:main Oct 13, 2025
@DavidWiseman DavidWiseman deleted the TableSizeCollectionFix branch October 13, 2025 10:39
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.

1 participant