Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
2181b142
Commit
2181b142
authored
Jan 23, 2000
by
terry%mozilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch by Christine Begle <cbegle@mozilla.org>>, with heavy
modifications by me -- let you query for "any words" and "all words", as well as the existing substring and regexp stuff.
parent
91f9bc0f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
5 deletions
+34
-5
buglist.cgi
buglist.cgi
+32
-5
query.cgi
query.cgi
+2
-0
No files found.
buglist.cgi
View file @
2181b142
...
...
@@ -475,13 +475,36 @@ if (defined $ref && 0 < @$ref) {
}
}
sub
GetByWordList
{
my
(
$field
,
$strs
,
$verb
)
=
(
@_
);
my
@list
;
foreach
my
$w
(
split
(
/[\s,]+/
,
$strs
))
{
my
$word
=
$w
;
if
(
$word
ne
""
)
{
$word
=~
tr
/A-Z/
a
-
z
/
;
$word
=
SqlQuote
(
quotemeta
(
$word
));
$word
=~
s/^'//
;
$word
=~
s/'$//
;
$word
=
'(^|[^a-z0-9])'
.
$word
.
'($|[^a-z0-9])'
;
push
(
@list
,
"lower($field) regexp '$word'"
);
}
}
if
(
0
==
@list
)
{
return
""
;
}
return
"and ("
.
join
(
" $verb "
,
@list
)
.
")\n"
;
}
foreach
my
$f
(
"short_desc"
,
"long_desc"
,
"bug_file_loc"
,
"status_whiteboard"
)
{
if
(
defined
$::FORM
{
$f
})
{
my
$s
=
trim
(
$::FORM
{
$f
});
if
(
$s
ne
""
)
{
my
$n
=
$f
;
$s
=
SqlQuote
(
$s
);
my
$q
=
SqlQuote
(
$s
);
my
$type
=
$::FORM
{
$f
.
"_type"
};
if
(
$f
eq
"long_desc"
)
{
# Patch in the longdescs table.
...
...
@@ -490,13 +513,17 @@ foreach my $f ("short_desc", "long_desc", "bug_file_loc",
$n
=
"longdescs.thetext"
;
}
if
(
$type
eq
"regexp"
)
{
$query
.=
"and $n regexp $
s
\n"
;
$query
.=
"and $n regexp $
q
\n"
;
}
elsif
(
$type
eq
"notregexp"
)
{
$query
.=
"and $n not regexp $
s
\n"
;
$query
.=
"and $n not regexp $
q
\n"
;
}
elsif
(
$type
eq
"casesubstring"
)
{
$query
.=
"and instr($n, $s)\n"
;
$query
.=
"and instr($n, $q)\n"
;
}
elsif
(
$type
eq
"allwords"
)
{
$query
.=
GetByWordList
(
$f
,
$s
,
"and"
);
}
elsif
(
$type
eq
"anywords"
)
{
$query
.=
GetByWordList
(
$f
,
$s
,
"or"
);
}
else
{
$query
.=
"and instr(lower($n), lower($
s
))\n"
;
$query
.=
"and instr(lower($n), lower($
q
))\n"
;
}
}
}
...
...
query.cgi
View file @
2181b142
...
...
@@ -511,6 +511,8 @@ sub StringSearch {
}
foreach
my
$i
([
"substring"
,
"case-insensitive substring"
],
[
"casesubstring"
,
"case-sensitive substring"
],
[
"allwords"
,
"all words"
],
[
"anywords"
,
"any words"
],
[
"regexp"
,
"regular expression"
],
[
"notregexp"
,
"not ( regular expression )"
])
{
my
(
$n
,
$d
)
=
(
@$i
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment