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

Add extra padding for strings shorter than FixedString length #910

Merged
merged 1 commit into from
Feb 20, 2023

Conversation

jkaflik
Copy link
Contributor

@jkaflik jkaflik commented Feb 20, 2023

Summary

Currently, appending string shorter than FixedString column length results in a panic. ClickHouse default behaviour is to append null bytes: https://clickhouse.com/docs/en/sql-reference/data-types/fixedstring/

This PR adds an extra byte array initialisation if the length does not match.

This fixes #904

Checklist

Delete items not relevant to your PR:

  • Unit and integration tests covering the common scenarios were added

@jkaflik jkaflik added the bug label Feb 20, 2023
@jkaflik jkaflik merged commit ca9c1f0 into main Feb 20, 2023
@jkaflik jkaflik deleted the 904-fixedstringpadding branch May 5, 2023 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AppendStruct() for FixedString does not add Proper Padding
1 participant