Skip to content

Commit b462da0

Browse files
Assert error message and drop invalid chars due to randomisation issue
1 parent 3776df5 commit b462da0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3283,9 +3283,10 @@ public void testInvalidPatternsWithIntermittentQuotes() {
32833283
var randomInvalidChar = randomFrom(invalidChars);
32843284

32853285
// Construct the new invalid index pattern.
3286-
var remoteIndexWithInvalidChar = quote(randomIdentifier() + ":" + "foo" + randomInvalidChar + "bar");
3286+
var invalidIndexName = "foo" + randomInvalidChar + "bar";
3287+
var remoteIndexWithInvalidChar = quote(randomIdentifier() + ":" + invalidIndexName);
32873288
var query = "FROM " + randomIndex + "," + remoteIndexWithInvalidChar;
3288-
expectError(query, "must not contain the following characters ['\"',' ','\\','/',',','|','>','?','<']");
3289+
expectError(query, "Invalid index name [" + invalidIndexName + "], must not contain the following characters");
32893290
}
32903291

32913292
// Colon outside a quoted string should result in an ANTLR error: a comma is expected.

0 commit comments

Comments
 (0)