diff --git a/solr/core/src/java/org/apache/solr/handler/SQLHandler.java b/solr/core/src/java/org/apache/solr/handler/SQLHandler.java index a017f5883b7..fe831877653 100644 --- a/solr/core/src/java/org/apache/solr/handler/SQLHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/SQLHandler.java @@ -165,13 +165,13 @@ public class SQLHandler extends RequestHandlerBase implements SolrCoreAware { TupleStream sqlStream = null; - if(sqlVistor.table.toUpperCase(Locale.getDefault()).contains("_CATALOGS_")) { + if(sqlVistor.table.toUpperCase(Locale.ROOT).contains("_CATALOGS_")) { if (!sqlVistor.fields.contains("TABLE_CAT")) { throw new IOException("When querying _CATALOGS_, fields must contain column TABLE_CAT"); } sqlStream = new CatalogsStream(defaultZkhost); - } else if(sqlVistor.table.toUpperCase(Locale.getDefault()).contains("_SCHEMAS_")) { + } else if(sqlVistor.table.toUpperCase(Locale.ROOT).contains("_SCHEMAS_")) { if (!sqlVistor.fields.contains("TABLE_SCHEM") || !sqlVistor.fields.contains("TABLE_CATALOG")) { throw new IOException("When querying _SCHEMAS_, fields must contain both TABLE_SCHEM and TABLE_CATALOG"); } @@ -657,7 +657,7 @@ public class SQLHandler extends RequestHandlerBase implements SolrCoreAware { } - if(!sortItem.getOrdering().toString().toLowerCase(Locale.getDefault()).contains(direction.toLowerCase(Locale.getDefault()))) { + if(!sortItem.getOrdering().toString().toLowerCase(Locale.ROOT).contains(direction.toLowerCase(Locale.ROOT))) { return false; } } @@ -838,7 +838,7 @@ public class SQLHandler extends RequestHandlerBase implements SolrCoreAware { } private static String ascDesc(String s) { - if(s.toLowerCase(Locale.getDefault()).contains("desc")) { + if(s.toLowerCase(Locale.ROOT).contains("desc")) { return "desc"; } else { return "asc"; @@ -846,7 +846,7 @@ public class SQLHandler extends RequestHandlerBase implements SolrCoreAware { } private static ComparatorOrder ascDescComp(String s) { - if(s.toLowerCase(Locale.getDefault()).contains("desc")) { + if(s.toLowerCase(Locale.ROOT).contains("desc")) { return ComparatorOrder.DESCENDING; } else { return ComparatorOrder.ASCENDING; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CloudSolrStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CloudSolrStream.java index 730097f9ec5..1f194e44f17 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CloudSolrStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CloudSolrStream.java @@ -300,11 +300,9 @@ public class CloudSolrStream extends TupleStream implements Expressible { Collection slices = clusterState.getActiveSlices(this.collection); if(slices == null) { - - String colLower = this.collection.toLowerCase(Locale.getDefault()); //Try case insensitive match for(String col : clusterState.getCollections()) { - if(col.toLowerCase(Locale.getDefault()).equals(colLower)) { + if(col.equalsIgnoreCase(this.collection)) { slices = clusterState.getActiveSlices(col); break; }