Open Bug 471974 Opened 16 years ago Updated 11 years ago

Regular expression in the search of attachment data doesn't treat ^ and $ as per line

Categories

(Bugzilla :: Query/Bug List, enhancement, P4)

enhancement

Tracking

()

People

(Reporter: mcepl, Unassigned)

Details

User-Agent: Mozilla/5.0 (X11; U; Linux i686; cs-CZ; rv:1.9.0.5) Gecko/2008121622 Fedora/3.0.5-1.fc10 Firefox/3.0.5 Ubiquity/0.1.4 Build Identifier: 3.1.4+ (bugzilla.redhat.com) Bugs related to Xorg crashes contain in the log of Xorg word Backtrace: on the line by itself. So, I would like to make a query where Attachment data matches regexp ^Backtrace:$ Except that bugzilla doesn't give me any hit on this, although there are many bugs with such attachments (plain "Backtrace:" without any other regexp stuff, gives me 105 open bugs), for example https://bugzilla.redhat.com/show_bug.cgi?id=477234 with attachment https://bugzilla.redhat.com/attachment.cgi?id=327647. When running curl -s 'https://bugzilla.redhat.com/attachment.cgi?id=327647' \ |grep -E '^Backtrace:$' on the command line, the line is correctly found. Reproducible: Always Steps to Reproduce: 1.see above 2. 3. Actual Results: regular expression should be real There doesn't seem to be much documentation to the regular expressions supported etc. available (at least http://www.bugzilla.org/docs/tip/en/html/query.html doesn't seem to offer much help).
here's my query: 0-0 = bug_id | anyexact | 471551 * ,anyexact (bug_id / anyexact / 471551) => bug_id / anyexact / 471551 / bugs.bug_id IN ('471551') * ^attach_data.thedata, (attach_data.thedata / regexp / ^diff) => attachdata_0.thedata / regexp / ^diff / undef * ,regexp (attachdata_0.thedata / regexp / ^diff) => attachdata_0.thedata / regexp / ^diff / attachdata_0.thedata REGEXP '^diff' * SELECT ... ((attachdata_0.thedata REGEXP '^diff')) ... This seems like a flaw or misinterpretation of the database feature. http://dev.mysql.com/doc/refman/5.1/en/regexp.html A regular expression for the REGEXP operator may use any of the following special characters and constructs: ^ Match the beginning of a string. mysql> SELECT 'fo\nfo' REGEXP '^fo$'; -> 0 mysql> SELECT 'fofo' REGEXP '^fo'; -> 1 https://bugzilla.redhat.com/buglist.cgi?bug_id=477234&field0-0-0=attach_data.thedata&type0-0-0=regexp&value0-0-0=(^|\n)T&debug=1 ID Sev Pri OS Assignee Status Resolution Summary 477234 med low Linu Adam Jackson NEW libdrm-2.4.3-0.1.fc11.x86_64.rpm does not allow gnome/X to start up One bug found. This doesn't seem like an unreasonable request. Although if we did this. You couldn't search for beginning of string....
Severity: normal → enhancement
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Hardware: x86 → All
Summary: Regular expression in the search of attachment data doesn't support ^ and $ → Regular expression in the search of attachment data doesn't treat ^ and $ as per line
Sorry, I am not sure I follow it -- does the attachment regexp search treat the attachment as one string? But even then ... Both of these work as expected: [matej@viklef ~]$ curl -s 'https://bugzilla.redhat.com/attachment.cgi?id=327647'|perl -nle 'print if /^\s*Backtrace:\s*$/' Backtrace: [matej@viklef ~]$ echo -e "foo\n Backtrace: \nfoo" |perl -nle 'print if /^\s*Backtrace:\s*$/' Backtrace: [matej@viklef ~]$ Will study that MySQL manual more? BTW, would bugzilla behave the same when running on PostgreSQL?
yes postgreqsl behaves the same (the docs are worse, it just points to posix which in turn has this behavior unless you pass some param that wouldn't be passed). it's certainly something that could be changed. but if it's changed, i'm not sure how to enable someone to actually search for only the beginning of the file (however rare such a search might be).
Priority: -- → P4
You need to log in before you can comment on or make changes to this bug.