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
f1b4d836
Commit
f1b4d836
authored
Nov 18, 2002
by
bbaetz%student.usyd.edu.au
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 179960 - Qucksearch queries are slow and timeout
fixed by adding subselect emulation for product/component lookups r=joel, a=justdave
parent
3e4c5032
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
9 deletions
+30
-9
Search.pm
Bugzilla/Search.pm
+30
-9
No files found.
Bugzilla/Search.pm
View file @
f1b4d836
...
...
@@ -514,17 +514,22 @@ sub init {
},
"^component,(?!changed)"
=>
sub
{
my
$table
=
"components_$chartid"
;
push
(
@supptables
,
"components $table"
);
push
(
@wherepart
,
"bugs.component_id = $table.id"
);
$f
=
$ff
=
"$table.name"
;
$f
=
$ff
=
"components.name"
;
$funcsbykey
{
",$t"
}
->
();
$term
=
build_subselect
(
"bugs.component_id"
,
"components.id"
,
"components"
,
$term
);
},
"^product,(?!changed)"
=>
sub
{
my
$table
=
"products_$chartid"
;
push
(
@supptables
,
"products $table"
);
push
(
@wherepart
,
"bugs.product_id = $table.id"
);
$f
=
$ff
=
"$table.name"
;
# Generate the restriction condition
$f
=
$ff
=
"products.name"
;
$funcsbykey
{
",$t"
}
->
();
$term
=
build_subselect
(
"bugs.product_id"
,
"products.id"
,
"products"
,
$term
);
},
"^keywords,"
=>
sub
{
...
...
@@ -591,9 +596,12 @@ sub init {
",casesubstring"
=>
sub
{
$term
=
"INSTR($ff, $q)"
;
},
",
(substring|substr)
"
=>
sub
{
",
substring
"
=>
sub
{
$term
=
"INSTR(LOWER($ff), "
.
lc
(
$q
)
.
")"
;
},
",substr"
=>
sub
{
$funcsbykey
{
",substring"
}
->
();
},
",notsubstring"
=>
sub
{
$term
=
"INSTR(LOWER($ff), "
.
lc
(
$q
)
.
") = 0"
;
},
...
...
@@ -1016,6 +1024,19 @@ sub ListIDsForEmail {
return
$list
;
}
sub
build_subselect
{
my
(
$outer
,
$inner
,
$table
,
$cond
)
=
@_
;
my
$q
=
"SELECT $inner FROM $table WHERE $cond"
;
#return "$outer IN ($q)";
&::
SendSQL
(
$q
);
my
@list
;
while
(
&::
MoreSQLData
())
{
push
(
@list
,
&::
FetchOneColumn
());
}
return
"1=2"
unless
@list
;
# Could use boolean type on dbs which support it
return
"$outer IN ("
.
join
(
','
,
@list
)
.
")"
;
}
sub
GetByWordList
{
my
(
$field
,
$strs
)
=
(
@_
);
my
@list
;
...
...
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