8346099: JFR: Query for 'jfr view' can't handle wildcard with multiple event types

Reviewed-by: mgronlun
This commit is contained in:
Erik Gahlin 2025-01-08 16:03:40 +00:00
parent 55bcf4c054
commit 3fe08186b1
2 changed files with 8 additions and 2 deletions

View File

@ -370,7 +370,6 @@ final class FieldBuilder {
FieldBuilder fb = new FieldBuilder(eventTypes, type, we.name()); FieldBuilder fb = new FieldBuilder(eventTypes, type, we.name());
Field field = fb.build().getFirst(); Field field = fb.build().getFirst();
field.label = we.label; field.label = we.label;
field.index = result.size();
field.visible = true; field.visible = true;
field.sourceFields.add(field); field.sourceFields.add(field);
result.add(field); result.add(field);

View File

@ -98,11 +98,19 @@ final class QueryResolver {
resolveGroupBy(); resolveGroupBy();
resolveOrderBy(); resolveOrderBy();
resolveWhere(); resolveWhere();
applyIndex();
applyColumn(); applyColumn();
applyFormat(); applyFormat();
return resultFields; return resultFields;
} }
private void applyIndex() {
int index = 0;
for (Field field : resultFields) {
field.index = index++;
}
}
private void resolveWhere() throws QuerySyntaxException { private void resolveWhere() throws QuerySyntaxException {
for (Condition condition : where) { for (Condition condition : where) {
List<Field> fields = new ArrayList<>(); List<Field> fields = new ArrayList<>();
@ -238,7 +246,6 @@ final class QueryResolver {
} }
} }
for (Field field: fields) { for (Field field: fields) {
field.index = resultFields.size();
primary.sourceFields.add(field); primary.sourceFields.add(field);
// Convert to String if field data types mismatch // Convert to String if field data types mismatch
if (mixedTypes) { if (mixedTypes) {