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
e0a4e9c1
Commit
e0a4e9c1
authored
Mar 01, 2011
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 637662: Make all the boolean charts work as expected for the "blocks"
and "dependson" fields. r=mkanat, a=mkanat (module owner)
parent
dddef33e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
59 deletions
+13
-59
Search.pm
Bugzilla/Search.pm
+13
-50
Constants.pm
xt/lib/Bugzilla/Test/Search/Constants.pm
+0
-9
No files found.
Bugzilla/Search.pm
View file @
e0a4e9c1
...
...
@@ -274,9 +274,7 @@ use constant OPERATOR_FIELD_OVERRIDE => {
'attachments'
=>
{
_non_changed
=>
\&
_attachments
,
},
blocked
=>
{
_non_changed
=>
\&
_blocked_nonchanged
,
},
blocked
=>
MULTI_SELECT_OVERRIDE
,
bug_group
=>
MULTI_SELECT_OVERRIDE
,
classification
=>
{
_non_changed
=>
\&
_classification_nonchanged
,
...
...
@@ -292,10 +290,8 @@ use constant OPERATOR_FIELD_OVERRIDE => {
days_elapsed
=>
{
_default
=>
\&
_days_elapsed
,
},
dependson
=>
{
_non_changed
=>
\&
_dependson_nonchanged
,
},
keywords
=>
MULTI_SELECT_OVERRIDE
,
dependson
=>
MULTI_SELECT_OVERRIDE
,
keywords
=>
MULTI_SELECT_OVERRIDE
,
'flagtypes.name'
=>
{
_default
=>
\&
_flagtypes_name
,
},
...
...
@@ -2525,47 +2521,6 @@ sub _classification_nonchanged {
"classifications.id"
,
"classifications"
,
$term
);
}
# XXX This should be combined with blocked_nonchanged.
sub
_dependson_nonchanged
{
my
(
$self
,
$args
)
=
@_
;
my
(
$chart_id
,
$joins
,
$field
,
$operator
)
=
@$args
{
qw(chart_id joins field operator)
};
my
$table
=
"dependson_$chart_id"
;
my
$full_field
=
"$table.$field"
;
$args
->
{
full_field
}
=
$full_field
;
$self
->
_do_operator_function
(
$args
);
my
$term
=
$args
->
{
term
};
my
$dep_join
=
{
table
=>
'dependencies'
,
as
=>
$table
,
to
=>
'blocked'
,
extra
=>
[
$term
],
};
push
(
@$joins
,
$dep_join
);
$args
->
{
term
}
=
"$full_field IS NOT NULL"
;
}
sub
_blocked_nonchanged
{
my
(
$self
,
$args
)
=
@_
;
my
(
$chart_id
,
$joins
,
$field
,
$operator
)
=
@$args
{
qw(chart_id joins field operator)
};
my
$table
=
"blocked_$chart_id"
;
my
$full_field
=
"$table.$field"
;
$args
->
{
full_field
}
=
$full_field
;
$self
->
_do_operator_function
(
$args
);
my
$term
=
$args
->
{
term
};
my
$dep_join
=
{
table
=>
'dependencies'
,
as
=>
$table
,
to
=>
'dependson'
,
extra
=>
[
$term
],
};
push
(
@$joins
,
$dep_join
);
$args
->
{
term
}
=
"$full_field IS NOT NULL"
;
}
sub
_alias_nonchanged
{
my
(
$self
,
$args
)
=
@_
;
$args
->
{
full_field
}
=
"COALESCE(bugs.alias, '')"
;
...
...
@@ -2617,8 +2572,9 @@ sub _multiselect_negative {
$args
->
{
operator
}
=
$self
->
_reverse_operator
(
$operator
);
$self
->
_do_operator_function
(
$args
);
my
$term
=
$args
->
{
term
};
my
$select
=
$args
->
{
_select_field
}
||
'bug_id'
;
$args
->
{
term
}
=
"bugs.bug_id NOT IN (SELECT
bug_id
FROM $table WHERE $term)"
;
"bugs.bug_id NOT IN (SELECT
$select
FROM $table WHERE $term)"
;
}
sub
_multiselect_multiple
{
...
...
@@ -2667,6 +2623,12 @@ sub _multiselect_table {
return
"bug_group_map INNER JOIN groups
ON bug_group_map.group_id = groups.id"
;
}
elsif
(
$field
eq
'blocked'
or
$field
eq
'dependson'
)
{
my
$select
=
$field
eq
'blocked'
?
'dependson'
:
'blocked'
;
$args
->
{
_select_field
}
=
$select
;
$args
->
{
full_field
}
=
"dependencies.$field"
;
return
"dependencies"
;
}
my
$table
=
"bug_$field"
;
$args
->
{
full_field
}
=
"bug_$field.value"
;
return
$table
;
...
...
@@ -2677,7 +2639,8 @@ sub _multiselect_term {
my
$table
=
$self
->
_multiselect_table
(
$args
);
$self
->
_do_operator_function
(
$args
);
my
$term
=
$args
->
{
term
};
return
"bugs.bug_id IN (SELECT bug_id FROM $table WHERE $term)"
;
my
$select
=
$args
->
{
_select_field
}
||
'bug_id'
;
return
"bugs.bug_id IN (SELECT $select FROM $table WHERE $term)"
;
}
sub
_multiselect_nonchanged
{
...
...
xt/lib/Bugzilla/Test/Search/Constants.pm
View file @
e0a4e9c1
...
...
@@ -193,11 +193,6 @@ use constant SUBSTR_NO_FIELD_ADD => FIELD_TYPE_DATETIME, qw(
# Certain fields fail all the "negative" search tests:
#
# Blocked and Dependson "notequals" only finds bugs that have
# values for the field, but where the dependency list doesn't contain
# the bug you listed. It doesn't find bugs that fully lack values for
# the fields, as it should.
#
# bug_file_loc can be NULL, so it gets missed by the normal
# notequals search.
#
...
...
@@ -220,10 +215,8 @@ use constant NEGATIVE_BROKEN => (
'attachments.description'
=>
{
contains
=>
[
5
]
},
'attachments.filename'
=>
{
contains
=>
[
5
]
},
'attachments.mimetype'
=>
{
contains
=>
[
5
]
},
blocked
=>
{
contains
=>
[
3
,
4
,
5
]
},
bug_file_loc
=>
{
contains
=>
[
5
]
},
deadline
=>
{
contains
=>
[
5
]
},
dependson
=>
{
contains
=>
[
2
,
4
,
5
]
},
longdesc
=>
{
contains
=>
[
1
]
},
'longdescs.isprivate'
=>
{
contains
=>
[
1
]
},
# Custom fields are busted because they can be NULL.
...
...
@@ -486,8 +479,6 @@ use constant CHANGED_FROM_TO_BROKEN_NOT => (
# Common broken tests for the "not" or "no" operators.
use
constant
NEGATIVE_BROKEN_NOT
=>
(
"blocked"
=>
{
contains
=>
[
3
,
4
,
5
]
},
"dependson"
=>
{
contains
=>
[
2
,
4
,
5
]
},
"flagtypes.name"
=>
{
contains
=>
[
1
..
5
]
},
);
...
...
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