Skip to content

Commit c92b7b5

Browse files
authored
Fix testValidFromPattern (#121996)
1 parent c594067 commit c92b7b5

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,6 @@ tests:
397397
issue: https://github.com/elastic/elasticsearch/issues/121966
398398
- class: org.elasticsearch.xpack.searchablesnapshots.hdfs.SecureHdfsSearchableSnapshotsIT
399399
issue: https://github.com/elastic/elasticsearch/issues/121967
400-
- class: org.elasticsearch.xpack.esql.parser.StatementParserTests
401-
method: testInvalidJoinPatterns
402-
issue: https://github.com/elastic/elasticsearch/issues/121968
403400
- class: org.elasticsearch.smoketest.SmokeTestMultiNodeClientYamlTestSuiteIT
404401
method: test {yaml=update/100_synthetic_source/stored text}
405402
issue: https://github.com/elastic/elasticsearch/issues/121991

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)