Error message in DB Console when using LIKE in WHERE clause
We are running a query from DB Console against our Jira instance (which has a MySQL database). The SQL query works fine until we try and filter the results down further with a WHERE clause which uses LIKE with wildcards. We need to filter the results based on the format of the users email_address. Example :-
WHERE DATEDIFF (NOW(), FROM_UNIXTIME(lastLogin.lastLoginMillis/1000)) >90 AND email_address LIKE '%anytext%'
When the SQL is run we get the following error message in the console :-
Error in executing SQL - URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "an"
We believe that the problem is that the wildcard character % is being interpreted as a URL encode rather than an SQL wildcard. Can you advise how we can avoid this problem while still using a wildcard in the where clause?
Comments (5)
-
repo owner -
Replace % by %25
-
Please review my pull request
-
This one should have been fixed in the recent 1.14 release.
-
repo owner - changed status to resolved
- Log in to comment
Julian, I never got notified about this issue from Bitbucket. Let me check it and update.