Use case insensitive LIKE command on H2 databases (#2760)

This commit is contained in:
Luck 2020-12-09 18:08:17 +00:00
parent 39a5ccf9a9
commit 17f67f6e13
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
5 changed files with 5 additions and 5 deletions

View File

@ -83,6 +83,6 @@ public class H2ConnectionFactory extends FlatfileConnectionFactory {
@Override
public Function<String, String> getStatementProcessor() {
return s -> s.replace("'", "`");
return s -> s.replace('\'', '`').replace("LIKE", "ILIKE");
}
}

View File

@ -76,6 +76,6 @@ public class SqliteConnectionFactory extends FlatfileConnectionFactory {
@Override
public Function<String, String> getStatementProcessor() {
return s -> s.replace("'", "`");
return s -> s.replace('\'', '`');
}
}

View File

@ -71,6 +71,6 @@ public class MariaDbConnectionFactory extends HikariConnectionFactory {
@Override
public Function<String, String> getStatementProcessor() {
return s -> s.replace("'", "`"); // use backticks for quotes
return s -> s.replace('\'', '`'); // use backticks for quotes
}
}

View File

@ -105,6 +105,6 @@ public class MySqlConnectionFactory extends HikariConnectionFactory {
@Override
public Function<String, String> getStatementProcessor() {
return s -> s.replace("'", "`"); // use backticks for quotes
return s -> s.replace('\'', '`'); // use backticks for quotes
}
}

View File

@ -68,6 +68,6 @@ public class PostgreConnectionFactory extends HikariConnectionFactory {
@Override
public Function<String, String> getStatementProcessor() {
return s -> s.replace("'", "\"");
return s -> s.replace('\'', '"');
}
}