mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-30 01:59:23 +00:00
Fixed#8239: Query mismatch while searching for - and _ makes data overlap (#8476)
* Fixed#8239: Query mismatch while searching for - and _ makes data overlap * Fixed#8239: Query mismatch while searching for - and _ makes data overlap
This commit is contained in:
parent
0701ef955e
commit
af85b9629d
@ -93,6 +93,9 @@ public class ListFilter {
|
||||
}
|
||||
|
||||
private String getFqnPrefixCondition(String tableName, String fqnPrefix) {
|
||||
if (fqnPrefix.contains("_") || fqnPrefix.contains("-")) {
|
||||
fqnPrefix = format(fqnPrefix);
|
||||
}
|
||||
return tableName == null
|
||||
? String.format("fullyQualifiedName LIKE '%s%s%%'", fqnPrefix, Entity.SEPARATOR)
|
||||
: String.format("%s.fullyQualifiedName LIKE '%s%s%%'", tableName, fqnPrefix, Entity.SEPARATOR);
|
||||
@ -138,4 +141,8 @@ public class ListFilter {
|
||||
private String escape(String name) {
|
||||
return name.replace("'", "''");
|
||||
}
|
||||
|
||||
private String format(String name) {
|
||||
return name.contains("-") ? name.replaceAll("-", "\\\\-") : name.replaceAll("_", "\\\\_");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user