Skip to content

Commit

Permalink
8343946: JFR: Wildcard should only work with COUNT for 'jfr view'
Browse files Browse the repository at this point in the history
Reviewed-by: mgronlun
  • Loading branch information
egahlin committed Nov 12, 2024
1 parent 2989d87 commit e5eaa7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private void resolveSelect() throws QueryException {
field.aggregator = expression.aggregator();
FieldBuilder.configureAggregator(field);
expression.alias().ifPresent(alias -> fieldAliases.put(alias, field));
if (field.name.equals("*") && field.aggregator != Aggregator.COUNT) {
if (expression.name().equals("*") && field.aggregator != Aggregator.COUNT) {
throw new QuerySyntaxException("Wildcard ('*') can only be used with aggregator function COUNT");
}
}
Expand Down Expand Up @@ -259,7 +259,7 @@ private List<Field> resolveFields(String name, List<FilteredType> types) {
List<Field> fields = new ArrayList<>();

if (name.equals("*")) {
// Used with COUNT(*) and UNIQUE(*)
// Used with COUNT(*)
// All events should have a start time
name = "startTime";
}
Expand Down
2 changes: 1 addition & 1 deletion src/jdk.jfr/share/classes/jdk/jfr/internal/query/view.ini
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ table = "COLUMN 'StackTrace', 'Count', 'Avg.', 'Max.'
[application.contention-by-address]
label = "Contention by Monitor Address"
table = "COLUMN 'Monitor Address', 'Class', 'Threads', 'Max Duration'
SELECT address, FIRST(monitorClass), UNIQUE(*), MAX(duration) AS M
SELECT address, FIRST(monitorClass), UNIQUE(eventThread), MAX(duration) AS M
FROM JavaMonitorEnter
GROUP BY monitorClass ORDER BY M"

Expand Down

0 comments on commit e5eaa7f

Please sign in to comment.