Skip to content

Extract BINARY column size schema details #480 #481

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

Merged
merged 2 commits into from
Apr 24, 2020

Conversation

ckolbitsch-work
Copy link
Contributor

No description provided.

@@ -43,6 +45,8 @@ type TableColumn struct {
IsUnsigned bool
EnumValues []string
SetValues []string
FixedSize uint
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see mostly FixedSize = MaxSize, can we just use one size?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

MaxSize is literally the maximum amount of data (e.g., characters in a varchar) that you can store. For example, for a varchar(40) it is 40

FixedSize, on the other hand, is the number of characters that are stored by mysql - for example for a char(40) it is 40.

In an earlier revision, I just had a Size property, but that does not help in my case: I also need to have a flag that indicates whether that size is variable or fixed.

Thus, since I did not want to limit how this property can be used, I decided against a boolean flag of what the size means and simply extract the size in both ways, although only 1 applies (similar to how we have EnumValues versus SetValues)

@siddontang siddontang merged commit 803944a into go-mysql-org:master Apr 24, 2020
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.

2 participants