Skip to content

Distinguish between binary and non-binary strings in MySQL #451

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 3 commits into from
Aug 29, 2015

Conversation

MaxGabriel
Copy link
Member

Closes #448

This PR adds a failing test case demonstrating persistent-mysql writing a PersistText but reading a PersistByteString. The second commit of the PR uses character set information to distinguish between TEXT and BLOB binary and non-binary strings in MySQL, fixing the failing test.

This PR could break existing code. If code is relying on reading a PersistByteString from a MySQL TEXT column, that code will break (as it did for getColumn).

@MaxGabriel
Copy link
Member Author

I realized this also applies to the other string types (not just TEXT and BLOB) and updated the PR accordingly.

@MaxGabriel MaxGabriel force-pushed the mysqlSerializationError branch from f4ea9fc to 78a4ce0 Compare August 16, 2015 15:01
@MaxGabriel MaxGabriel changed the title Distinguish between BLOB and TEXT when deserializing from MySQL types Distinguish between binary and non-binary strings in MySQL Aug 16, 2015
@creichert
Copy link
Member

i'm not familiar with MySQL specifics but this looks good overall. Are you going to bump the major version?

@MaxGabriel
Copy link
Member Author

@creichert Yeah this probably should have a major version bump. But LTS 3 just started; should we wait awhile to merge this? I can make a PR to yesod-text-markdown to accept either PersistText or PersistByteString to fix the immediate issues people are reporting on StackOverflow.

@gregwebs
Copy link
Member

I think it should be merged whenever it is ready. We can create maintenance branches as needed.

@MaxGabriel
Copy link
Member Author

Forgot about this for a few days; I updated the changelog and cabal file. Will merge it in shortly.

@MaxGabriel MaxGabriel force-pushed the mysqlSerializationError branch from d34547d to e547a9d Compare August 28, 2015 20:03
@MaxGabriel
Copy link
Member Author

Thanks for fixing build times @snoyberg; these tests were failing on > 50 minute builds before.

MaxGabriel added a commit that referenced this pull request Aug 29, 2015
Distinguish between binary and non-binary strings in MySQL
@MaxGabriel MaxGabriel merged commit e0328a3 into master Aug 29, 2015
@parsonsmatt parsonsmatt deleted the mysqlSerializationError branch March 31, 2020 15:26
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.

A custom field used with persistent-mysql is serialized as PersistText but deserializes as PersistByteString
4 participants