From 167755fe822ce25af2be29d56f94a94276dfe8bd Mon Sep 17 00:00:00 2001 From: Andrei Stefan Date: Thu, 20 Nov 2025 14:40:50 +0200 Subject: [PATCH 1/2] Ignore new Locales to be used in tests because ES SQL is Locale-insensitive while H2 (the database we compare the results with) is Locale sensitive --- muted-tests.yml | 24 ------------------- .../xpack/sql/qa/jdbc/SqlSpecTestCase.java | 3 ++- .../main/resources/case-functions.sql-spec | 6 +++++ 3 files changed, 8 insertions(+), 25 deletions(-) diff --git a/muted-tests.yml b/muted-tests.yml index e97ce4b62ca96..74cdf88238f3a 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -5,30 +5,6 @@ tests: - class: org.elasticsearch.packaging.test.PackagesSecurityAutoConfigurationTests method: test20SecurityNotAutoConfiguredOnReInstallation issue: https://github.com/elastic/elasticsearch/issues/112635 -- class: org.elasticsearch.xpack.sql.qa.single_node.JdbcSqlSpecIT - method: test {case-functions.testSelectInsertWithLcaseAndLengthWithOrderBy} - issue: https://github.com/elastic/elasticsearch/issues/112642 -- class: org.elasticsearch.xpack.sql.qa.single_node.JdbcSqlSpecIT - method: test {case-functions.testUcaseInline1} - issue: https://github.com/elastic/elasticsearch/issues/112641 -- class: org.elasticsearch.xpack.sql.qa.single_node.JdbcSqlSpecIT - method: test {case-functions.testUpperCasingTheSecondLetterFromTheRightFromFirstName} - issue: https://github.com/elastic/elasticsearch/issues/112640 -- class: org.elasticsearch.xpack.sql.qa.single_node.JdbcSqlSpecIT - method: test {case-functions.testUcaseInline3} - issue: https://github.com/elastic/elasticsearch/issues/112643 -- class: org.elasticsearch.xpack.sql.qa.security.JdbcSqlSpecIT - method: test {case-functions.testUcaseInline1} - issue: https://github.com/elastic/elasticsearch/issues/112641 -- class: org.elasticsearch.xpack.sql.qa.security.JdbcSqlSpecIT - method: test {case-functions.testUcaseInline3} - issue: https://github.com/elastic/elasticsearch/issues/112643 -- class: org.elasticsearch.xpack.sql.qa.security.JdbcSqlSpecIT - method: test {case-functions.testUpperCasingTheSecondLetterFromTheRightFromFirstName} - issue: https://github.com/elastic/elasticsearch/issues/112640 -- class: org.elasticsearch.xpack.sql.qa.security.JdbcSqlSpecIT - method: test {case-functions.testSelectInsertWithLcaseAndLengthWithOrderBy} - issue: https://github.com/elastic/elasticsearch/issues/112642 - class: org.elasticsearch.xpack.transform.integration.TransformIT method: testStopWaitForCheckpoint issue: https://github.com/elastic/elasticsearch/issues/106113 diff --git a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/SqlSpecTestCase.java b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/SqlSpecTestCase.java index 4470f20735edb..310c38cc8ef4d 100644 --- a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/SqlSpecTestCase.java +++ b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/SqlSpecTestCase.java @@ -86,7 +86,8 @@ protected int fetchSize() { protected final void doTest() throws Throwable { // we skip the tests in case of these locales because ES-SQL is Locale-insensitive for now // while H2 does take the Locale into consideration - String[] h2IncompatibleLocales = new String[] { "tr", "az", "tr-TR", "tr-CY", "az-Latn", "az-Cyrl", "az-Latn-AZ", "az-Cyrl-AZ" }; + String[] h2IncompatibleLocales = new String[] { "tr", "az", "tr-TR", "tr-CY", "az-Latn", "az-Cyrl", "az-Latn-AZ", "az-Cyrl-AZ", + "tr-Latn-TR", "az-AZ" }; boolean goodLocale = Arrays.stream(h2IncompatibleLocales) .anyMatch((l) -> Locale.getDefault().equals(new Locale.Builder().setLanguageTag(l).build())) == false; if (fileName.startsWith("case-functions")) { diff --git a/x-pack/plugin/sql/qa/server/src/main/resources/case-functions.sql-spec b/x-pack/plugin/sql/qa/server/src/main/resources/case-functions.sql-spec index d7de6d8a4a173..8870abe088f03 100644 --- a/x-pack/plugin/sql/qa/server/src/main/resources/case-functions.sql-spec +++ b/x-pack/plugin/sql/qa/server/src/main/resources/case-functions.sql-spec @@ -1,7 +1,13 @@ // To mute tests follow example in file: example.sql-spec +// For anyone reaching this file in the future coming from CI failures related to uppercasing/lowercasing tests: +// For example: Different result for column [upper], entry [1] expected:< ELAST[İ]C > but was:< ELAST[I]C > +// Go to SqlSpecTestCase.doTest() method and look for h2IncompatibleLocales and add the faulty Locale there, +// after you double check that the issue is indeed related to that specific Locale. + // Next 4 SELECTs in this file are related to https://github.com/elastic/elasticsearch/issues/32589 // H2 is Locale sensitive, while ES-SQL is not (so far) + selectInsertWithLcaseAndLengthWithOrderBy SELECT "first_name" origFN, "last_name" origLN, INSERT(UCASE("first_name"),LENGTH("first_name")+1,123,LCASE("last_name")) modified FROM "test_emp" WHERE ASCII("first_name")=65 ORDER BY "first_name" ASC, "last_name" ASC LIMIT 10; From 951318d4219e052eeb474bca0aba74174ef30a28 Mon Sep 17 00:00:00 2001 From: elasticsearchmachine Date: Thu, 20 Nov 2025 12:54:28 +0000 Subject: [PATCH 2/2] [CI] Auto commit changes from spotless --- .../xpack/sql/qa/jdbc/SqlSpecTestCase.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/SqlSpecTestCase.java b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/SqlSpecTestCase.java index 310c38cc8ef4d..05486ea081417 100644 --- a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/SqlSpecTestCase.java +++ b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/SqlSpecTestCase.java @@ -86,8 +86,17 @@ protected int fetchSize() { protected final void doTest() throws Throwable { // we skip the tests in case of these locales because ES-SQL is Locale-insensitive for now // while H2 does take the Locale into consideration - String[] h2IncompatibleLocales = new String[] { "tr", "az", "tr-TR", "tr-CY", "az-Latn", "az-Cyrl", "az-Latn-AZ", "az-Cyrl-AZ", - "tr-Latn-TR", "az-AZ" }; + String[] h2IncompatibleLocales = new String[] { + "tr", + "az", + "tr-TR", + "tr-CY", + "az-Latn", + "az-Cyrl", + "az-Latn-AZ", + "az-Cyrl-AZ", + "tr-Latn-TR", + "az-AZ" }; boolean goodLocale = Arrays.stream(h2IncompatibleLocales) .anyMatch((l) -> Locale.getDefault().equals(new Locale.Builder().setLanguageTag(l).build())) == false; if (fileName.startsWith("case-functions")) {