Skip to content

Commit a2fb5c4

Browse files
authored
Fix testValidFromPattern (#121996) (#122008)
(cherry picked from commit c92b7b5)
1 parent f668a31 commit a2fb5c4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/IdentifierGenerator.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,17 @@ public static String randomIndexPattern(Feature... features) {
7878
index.insert(0, "-");
7979
}
8080

81-
var pattern = maybeQuote(index.toString());
81+
var pattern = index.toString();
82+
if (pattern.contains("|")) {
83+
pattern = quote(pattern);
84+
}
85+
pattern = maybeQuote(pattern);
86+
8287
if (canAdd(Features.CROSS_CLUSTER, features)) {
8388
var cluster = maybeQuote(randomIdentifier());
8489
pattern = maybeQuote(cluster + ":" + pattern);
8590
}
8691

87-
if (pattern.contains("|") && pattern.contains("\"") == false) {
88-
pattern = quote(pattern);
89-
}
90-
9192
return pattern;
9293
}
9394

0 commit comments

Comments
 (0)