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

? character being replaced with $1 after upgrading 4.0.7 --> 4.1.0 #920

Closed
njeirath opened this issue Oct 14, 2020 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@njeirath
Copy link

Describe the bug
I recently upgraded from 4.0.7 to 4.1 and noticed some strange behavior when persisting values that contain a ? character. For some reason once the data is written to the database I'm seeing the ? replaced with $1.

Stack trace
On 4.0.7 when I save a string containing a ? I see the following query generated:

update "team" set "profilephotourl" = 'https://SOME_URL/profile.png?t=1602648800506' where "id" = '123'

And in the database it shows up as expected:

https://SOME_URL/profile.png?t=1602648800506

And on 4.1, I see the following query:

update "team" set "profilephotourl" = 'https://SOME_URL/profile.png?t=1602631580559' where "id" = '123'

But in the database I see:

https://SOME_URL/profile.png$1t=1602631580559

Where the ? appears to have been replaced with a $1

To Reproduce
Nothing has changed with the code other than to move from 4.0.7 --> 4.1 and the code itself in this case is super simple:

const team = await em.findOneOrFail(Team, {id: teamId})
team.profilePhotoUrl = url
await em.flush()

Where url contains the URL examples from above.

Versions

Dependency Version
node v14.5.0
typescript 3.8.3
mikro-orm 4.0.7 & 4.1
your-driver postgresql
@B4nan B4nan added the bug Something isn't working label Oct 14, 2020
@B4nan B4nan closed this as completed in 813e3cd Oct 14, 2020
@B4nan
Copy link
Member

B4nan commented Oct 14, 2020

fixed in 4.1.1

B4nan added a commit that referenced this issue Oct 17, 2020
This fixes one edge case in postgres with saving strings that contained `\?`.

Related: #920
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants