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
0a8e6198
Commit
0a8e6198
authored
Nov 01, 2002
by
bugreport%peshkin.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 127200 Query for CC/longdesc/OR takes long time
r=gerv
parent
23b1fd08
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
7 deletions
+70
-7
Search.pm
Bugzilla/Search.pm
+70
-7
No files found.
Bugzilla/Search.pm
View file @
0a8e6198
...
...
@@ -178,13 +178,19 @@ sub init {
}
}
if
(
$params
->
param
(
"emaillongdesc$id"
))
{
my
$table
=
"longdescs_"
;
push
(
@supptables
,
"longdescs $table"
);
push
(
@wherepart
,
"$table.bug_id = bugs.bug_id"
);
my
$ptable
=
"longdescnames_"
;
push
(
@supptables
,
"profiles $ptable"
);
push
(
@wherepart
,
"$table.who = $ptable.userid"
);
push
(
@clist
,
"$ptable.login_name"
,
$type
,
$email
);
if
(
my
$list
=
$self
->
ListIDsForEmail
(
$type
,
$email
))
{
my
$table
=
"longdescs_"
;
push
(
@supptables
,
"LEFT JOIN longdescs $table ON bugs.bug_id = $table.bug_id AND $table.who IN($list)"
);
push
(
@clist
,
"$table.who"
,
'isnotnull'
);
}
else
{
my
$table
=
"longdescs_"
;
push
(
@supptables
,
"longdescs $table"
);
push
(
@wherepart
,
"$table.bug_id = bugs.bug_id"
);
my
$ptable
=
"longdescnames_"
;
push
(
@supptables
,
"profiles $ptable"
);
push
(
@wherepart
,
"$table.who = $ptable.userid"
);
push
(
@clist
,
"$ptable.login_name"
,
$type
,
$email
);
}
}
if
(
@clist
)
{
push
(
@specialchart
,
\
@clist
);
...
...
@@ -291,6 +297,21 @@ sub init {
$f
=
"map_$f.login_name"
;
},
"^cc,(anyexact|substring)"
=>
sub
{
my
$list
;
$list
=
$self
->
ListIDsForEmail
(
$t
,
$v
);
if
(
$list
)
{
push
(
@supptables
,
"LEFT JOIN cc cc_$chartid ON bugs.bug_id = cc_$chartid.bug_id AND cc_$chartid.who IN($list)"
);
$term
=
"cc_$chartid.who IS NOT NULL"
;
}
else
{
push
(
@supptables
,
"LEFT JOIN cc cc_$chartid ON bugs.bug_id = cc_$chartid.bug_id"
);
push
(
@supptables
,
"LEFT JOIN profiles map_cc_$chartid ON cc_$chartid.who = map_cc_$chartid.userid"
);
$ff
=
$f
=
"map_cc_$chartid.login_name"
;
my
$ref
=
$funcsbykey
{
",anyexact"
};
&
$ref
;
}
},
"^cc,"
=>
sub
{
push
(
@supptables
,
"LEFT JOIN cc cc_$chartid ON bugs.bug_id = cc_$chartid.bug_id"
);
...
...
@@ -570,6 +591,9 @@ sub init {
",lessthan"
=>
sub
{
$term
=
"$ff < $q"
;
},
",isnotnull"
=>
sub
{
$term
=
"$ff IS NOT NULL"
;
},
",greaterthan"
=>
sub
{
$term
=
"$ff > $q"
;
},
...
...
@@ -926,6 +950,45 @@ sub SqlifyDate {
return
time2str
(
"%Y-%m-%d %H:%M:%S"
,
$date
);
}
# ListIDsForEmail returns an string with a comma-joined list
# of userids matching an email address
# according to the type specified.
# Currently, this only supports anyexact and substring matches.
# Substring matches will return up to 50 matching userids
# If a match type is unsupported or returns too many matches,
# ListIDsForEmail returns an undef.
sub
ListIDsForEmail
{
my
(
$self
,
$type
,
$email
)
=
(
@_
);
my
$old
=
$self
->
{
"emailcache"
}{
"$type,$email"
};
return
undef
if
(
$old
&&
$old
eq
"---"
);
return
$old
if
$old
;
my
@list
=
();
my
$list
=
"---"
;
if
(
$type
eq
'anyexact'
)
{
foreach
my
$w
(
split
(
/,/
,
$email
))
{
$w
=
trim
(
$w
);
my
$id
=
&::
DBname_to_id
(
$w
);
if
(
$id
>
0
)
{
push
(
@list
,
$id
)
}
}
$list
=
join
(
','
,
@list
);
}
elsif
(
$type
eq
'substring'
)
{
&::
SendSQL
(
"SELECT userid FROM profiles WHERE INSTR(login_name, "
.
&::
SqlQuote
(
$email
)
.
") LIMIT 51"
);
while
(
&::
MoreSQLData
())
{
my
(
$id
)
=
&::
FetchSQLData
();
push
(
@list
,
$id
);
}
if
(
@list
<
50
)
{
$list
=
join
(
','
,
@list
);
}
}
$self
->
{
"emailcache"
}{
"$type,$email"
}
=
$list
;
return
undef
if
(
$list
eq
"---"
);
return
$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