We have moved to GitHub Issues
Created by Stephan 14 Feb 2014, 09:12:22 Updated by Shannon Deminick 18 Feb 2014, 03:56:02
We have user logins such as DOMAIN\LOGIN and they were working fine in 4.7. When upgrading to 6.2 the backend does not support them anymore because in UserService.GetByUsername(string login) we do var query = Query
Just adding login = login.Replace("\", "\\"); in GetByUsername does fix the issue but...
Is this not a general issue with querying?
I've just created a unit test for this which works, are you using MySql or ?
Yes using MySql. So could it be that there's something in the MSSQL provider that automagically escapes strings?
Righto, yup most likely a MySql thing. That should be easy to fix with our SQL syntax providers. MSSQL must deal with backslashes in sql arguments correctly I suppose. I do remember back when I used to use MySql alot I had to call a mysql escape method all the time.
SQL... "what's good about standards is that everybody can have their own"...
lol, looks like MySql would deal with it if these were query params but with the ModelToSqlExpressionHelper, this builds up SQL statements with values not with parameters. Would be nice to have the Query
I've streamlines how things are escaped, just gonna run some more tests, will push tomorrow.
Actually I've pushed that up now, works in MSSQL, haven't yet tested in mysql, if you have time today let me know, otherwise I'll try tomorrow.
Tested and fixed
Assignee: Shannon Deminick
Backwards Compatible: True
Affected versions: 6.2.0
Due in version: 7.1.0, 6.2.0