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
8218d4fe
Commit
8218d4fe
authored
Apr 03, 2002
by
bbaetz%student.usyd.edu.au
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 109528 - Can't query for attachment status != value if patch has no
statuses r=myk, justdave
parent
a2d6ee7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
16 deletions
+49
-16
buglist.cgi
buglist.cgi
+49
-16
No files found.
buglist.cgi
View file @
8218d4fe
...
...
@@ -567,34 +567,67 @@ sub GenerateSQL {
$f
=
"$table.$field"
;
},
"^attachstatusdefs.name,"
=>
sub
{
# The below has Fun with the names for attachment statuses. This
# isn't needed for changed* queries, so exclude those - the
# generic stuff will cope
return
if
(
$t
=~
m/^changed/
);
# Searching for "status != 'bar'" wants us to look for an
# attachment without the 'bar' status, not for an attachment with
# a status not equal to 'bar' (Which would pick up an attachment
# with more than one status). We do this by LEFT JOINS, after
# grabbing the matching attachment status ids.
# Note that this still won't find bugs with no attachments, since
# that isn't really what people would expect.
# First, get the attachment status ids, using the other funcs
# to match the WHERE term.
# Note that we need to reverse the negated bits for this to work
# This somewhat abuses the definitions of the various terms -
# eg, does 'contains all' mean that the status has to contain all
# those words, or that all those words must be exact matches to
# statuses, which must all be on a single attachment, or should
# the match on the status descriptions be a contains match, too?
my
$inverted
=
0
;
if
(
$t
=~
m/not(.*)/
)
{
$t
=
$1
;
$inverted
=
1
;
}
$ref
=
$funcsbykey
{
",$t"
};
&
$ref
;
SendSQL
(
"SELECT id FROM attachstatusdefs WHERE $term"
);
my
@as_ids
;
while
(
MoreSQLData
())
{
push
@as_ids
,
FetchOneColumn
();
}
# When searching for multiple statuses within a single boolean chart,
# we want to match each status record separately. In other words,
# "status = 'foo' AND status = 'bar'" should match attachments with
# one status record equal to "foo" and another one equal to "bar",
# not attachments where the same status record equals both "foo" and
# "bar" (which is nonsensical). In order to do this we must add an
# additional counter to the end of the "attachstatuses"
and
#
"attachstatusdefs" table references
.
# additional counter to the end of the "attachstatuses"
table
#
reference
.
++
$statusid
;
my
$attachtable
=
"attachments_$chartid"
;
my
$statustable
=
"attachstatuses_${chartid}_$statusid"
;
my
$statusdefstable
=
"attachstatusdefs_${chartid}_$statusid"
;
push
(
@supptables
,
"attachments $attachtable"
);
push
(
@supptables
,
"attachstatuses $statustable"
);
push
(
@supptables
,
"attachstatusdefs $statusdefstable"
);
my
$join
=
"LEFT JOIN attachstatuses $statustable ON "
.
"($attachtable.attach_id = $statustable.attach_id AND "
.
"$statustable.statusid IN ("
.
join
(
","
,
@as_ids
)
.
"))"
;
push
(
@supptables
,
$join
);
push
(
@wherepart
,
"bugs.bug_id = $attachtable.bug_id"
);
push
(
@wherepart
,
"$attachtable.attach_id = $statustable.attach_id"
);
push
(
@wherepart
,
"$statustable.statusid = $statusdefstable.id"
);
# When the operator is changedbefore, changedafter, changedto,
# or changedby, $f appears in the query as "fielddefs.name = '$f'",
# so it must be the exact name of the table/field as they appear
# in the fielddefs table (i.e. attachstatusdefs.name). For all
# other operators, $f appears in the query as "$f = value", so it
# should be the name of the table/field with the correct table
# alias for this chart entry (f.e. attachstatusdefs_0.name).
$f
=
(
$t
=~
/^changed/
)
?
"attachstatusdefs.name"
:
"$statusdefstable.name"
;
if
(
$inverted
)
{
$term
=
"$statustable.statusid IS NULL"
;
}
else
{
$term
=
"$statustable.statusid IS NOT NULL"
;
}
},
"^changedin,"
=>
sub
{
$f
=
"(to_days(now()) - to_days(bugs.delta_ts))"
;
...
...
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