mirror of https://github.com/apache/lucene.git
Fix more locale bugs in SQL handler ans streams
This commit is contained in:
parent
e78002bdc1
commit
8dddd88d30
|
@ -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;
|
||||
|
|
|
@ -300,11 +300,9 @@ public class CloudSolrStream extends TupleStream implements Expressible {
|
|||
Collection<Slice> 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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue