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

Using emulate prepares breaks string parameters that contain unicode characters #92

Closed
david-garcia-garcia opened this issue May 8, 2016 · 4 comments

Comments

@david-garcia-garcia
Copy link

Someone reported this bug here:

https://www.drupal.org/node/2693763

The issue is that a statement without EMULATE_PREPARES generates the following SQL:

SELECT * FROM users WHERE name = @P1 AND status = 1',N'@P1 nvarchar(6)',N'가각'

But when using EMULATE_PREPARES it turns it into:

SELECT * FROM users WHERE name = '가각' AND status = 1

When it should be (notice the additional N):

SELECT * FROM users WHERE name = N'가각' AND status = 1

There is another issue related to EMULATE_PREPARES not working as expected:

#63

@meet-bhagdev
Copy link
Contributor

@david-garcia-garcia we believe this particular issue with the SQL queries listed above is fixed in our latest release - https://github.com/Azure/msphpsql/releases/tag/4.1.0. We are reviewing the other issues you have opened. In the meanwhile can you help us validate this?

@david-garcia-garcia
Copy link
Author

I can confirm this is not solved :(

I've built a complete test script:

http://pastebin.com/TsLt8Za3

Current Output:

FOUND: ??sample2
FOUND: 가각ácasa

Expected Output:

FOUND: 가각ácasa
FOUND: 가각ácasa
FOUND: 가각ácasa
FOUND: 가각ácasa

@david-garcia-garcia
Copy link
Author

Repasted the demo script, so that it won't expire as it has happened in other issues:

https://pastebin.com/P8emQQj4

@david-garcia-garcia
Copy link
Author

I can confirm that latest release fixes this issue. Thanks!!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants