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

fix: Cap length of column name #104

Merged
merged 4 commits into from
Dec 14, 2023

Conversation

AndreasNicolaisen
Copy link
Contributor

@AndreasNicolaisen AndreasNicolaisen commented Dec 14, 2023

Description

Work Item ID: AB#30770

Cap length of column names.

Test approach

Run stream/new unit test

Release Note

fix: Cap length of column names. If names are longer than 127 characters, we cut off anything after character 116, and append hash value of the entire name.

@AndreasNicolaisen AndreasNicolaisen marked this pull request as ready for review December 14, 2023 13:53
@AndreasNicolaisen AndreasNicolaisen requested a review from a team as a code owner December 14, 2023 13:53
@AndreasNicolaisen AndreasNicolaisen marked this pull request as draft December 14, 2023 14:29
@AndreasNicolaisen AndreasNicolaisen marked this pull request as ready for review December 14, 2023 14:46
Copy link
Contributor

@Hyldahl Hyldahl left a comment

Choose a reason for hiding this comment

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

Looks good

@AndreasNicolaisen AndreasNicolaisen merged commit 0cd225b into release/4.0.0 Dec 14, 2023
1 check passed
@AndreasNicolaisen AndreasNicolaisen deleted the fix/cap-length-of-column-name branch December 14, 2023 15:39
sanitizedSqlName = $"_{sanitizedSqlName}";
}

if (sanitizedSqlName.Length > 127) // 127 instead of 128, since we need space for parameter declaration '@'
Copy link
Contributor

@zvirja zvirja Dec 14, 2023

Choose a reason for hiding this comment

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

I thought about doing that for values over 118. If they are larger than that, we should calculate hash for them.
In this case the chance of just having a vocalubary key with a collision hash is lower or statistically negligible.

With the current approach it's possible for people to mimic hash value by just having columns of length of 127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants