Skip to content

Comments

Gbk encoding simple#560

Merged
shlomi-noach merged 11 commits intomasterfrom
gbk_encoding_simple
Mar 14, 2018
Merged

Gbk encoding simple#560
shlomi-noach merged 11 commits intomasterfrom
gbk_encoding_simple

Conversation

@shlomi-noach
Copy link
Contributor

Context: #532, see also #559

Some time after #533 was submitted by @ceshihao we found that gkb charset seems to work without specifying risky-charset argument. This PR is a stripped down version of #533 in an attempt to find the minimal set of changes where gbk is still supported.

@shlomi-noach
Copy link
Contributor Author

Interestingly tests pass even though we use interpolateParams=true:

if cfg.interpolateParams && unsafeCollations[cfg.collation] {
return nil, errInvalidDSNUnsafeCollation
}

Seems like as long as not specified via DSN, gbk is good to go.

@ceshihao
Copy link
Contributor

@shlomi-noach

I think it is because gh-ost DSN only contains interpolateParams and charset, but NOT collation.

From the code you linked, the validation is on interpolateParams and collation.

@shlomi-noach
Copy link
Contributor Author

@ceshihao makes sense. Can you possibly test this branch on your side and confirm it works as expected?

@ceshihao
Copy link
Contributor

@shlomi-noach It works on my side.

BTW
I think this change is not needed either.

https://github.com/github/gh-ost/pull/560/files#diff-0ec6a3deacd5e2577724a82d8347226fR59

@shlomi-noach
Copy link
Contributor Author

Great, thank you for testing! And thank you for your efforts.

BTW I think this change is not needed either.

Yep. I thought I might leave that as a strict reminder about interpolateParams.

@shlomi-noach shlomi-noach merged commit d2aca21 into master Mar 14, 2018
@shlomi-noach shlomi-noach deleted the gbk_encoding_simple branch March 14, 2018 04:21
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