Bug 535606 - (RHQ-2284) Browse Resources search and DynaGroups don't escape special characters properly
Browse Resources search and DynaGroups don't escape special characters properly
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: No Component (Show other bugs)
1.2
All All
medium Severity medium (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
http://jira.rhq-project.org/browse/RH...
: SubBug
Depends On: 542828
Blocks: rhq_triage
  Show dependency treegraph
 
Reported: 2009-07-31 14:31 EDT by Charles Crouch
Modified: 2015-02-01 18:25 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-05-09 11:29:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Charles Crouch 2009-07-31 14:31:00 EDT
Problem: Assume some of the resources in your inventory contain the "_" character. Trying to search for those resources using a term which include "_" in either the Browse Resources page or via a Dyna group doesn't show any matching resources.

We should make sure to test the fix with any other special characters e.g. *, %, &, \, / and also across all supported database options


(1:11:35 PM) joseph: yeah, we may not be escaping special chars properly
(1:11:41 PM) joseph: i'm looking at code now ccrouch
(1:11:53 PM) ghinkle: um _ is a special character in jpql
(1:12:05 PM) ghinkle: it means match one character
(1:12:23 PM) ccrouch: some escaping is in order i think
(1:13:51 PM) joseph: go here http://jon06.mw.lab.eng.bos.redhat.com:7080/admin/test/hibernate.jsp
(1:14:01 PM) joseph: execute select res.name from Resource res where res.name like '%\_3%'
(1:16:02 PM) joseph: but this works   select res.name from Resource res where res.name like '%\_3%' escape '\'
(1:16:26 PM) joseph: so, our PersistenceUtility is properly escaping underscores, but we're not giving the hint for what the escape character is
(1:17:30 PM) ccrouch: ok, sounds like a jira :-)
(1:17:39 PM) ccrouch: but i guess for now there is no workaround?
(1:17:43 PM) ccrouch: just avoid using _ ?
(1:17:53 PM) joseph: lemme reference some doco
(1:23:23 PM) joseph: don't see any workarounds
(1:24:46 PM) ccrouch: joseph: ok thanks for investigating
(1:25:15 PM) joseph: can't believe this has been like that for...well...ever
Comment 1 Charles Crouch 2009-07-31 14:37:35 EDT
(1:33:39 PM) joseph: ccrouch: and now criteria queries too
Comment 2 Red Hat Bugzilla 2009-11-10 16:01:28 EST
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-2284
Comment 3 wes hayutin 2010-02-16 11:53:00 EST
Temporarily adding the keyword "SubBug" so we can be sure we have accounted for all the bugs.

keyword:
new = Tracking + FutureFeature + SubBug
Comment 4 wes hayutin 2010-02-16 11:58:32 EST
making sure we're not missing any bugs in rhq_triage
Comment 5 Corey Welton 2010-11-22 14:37:05 EST
jshaughn - is this fixed? add commit and close out
Comment 6 Jay Shaughnessy 2010-11-23 09:08:56 EST
This should have gotten fixed a while back when I overhauled the ESCAPE clause
stuff in our Criteria query generator.  But since this fix would be a side-effect of that work I'd say it should go to QA for
verification and not yet be closed.

Note You need to log in before you can comment on or make changes to this bug.