Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add quoting character as a protected property in AbstractJdbcDatabase

I'll need to install Mysql to properly test databases where the quoting character
is not ". This approach will allow for specific databases to set the proper quoting character.
  • Loading branch information...
commit ed1f13b919e494239ec76fb330b2612a4fb6c759 1 parent b05d0e0
@damienbiggs damienbiggs authored
View
7 liquibase-core/src/main/java/liquibase/database/AbstractJdbcDatabase.java
@@ -65,6 +65,7 @@
*/
protected String sequenceNextValueFunction;
protected String sequenceCurrentValueFunction;
+ protected String quotingCharacter = "\"";
// List of Database native functions.
protected List<DatabaseFunction> dateFunctions = new ArrayList<DatabaseFunction>();
@@ -275,7 +276,7 @@ public CatalogAndSchema correctSchema(CatalogAndSchema schema) {
public String correctObjectName(String objectName, Class<? extends DatabaseObject> objectType) {
if (quotingStrategy == ObjectQuotingStrategy.QUOTE_ALL_OBJECTS || unquotedObjectsAreUppercased == null
- || objectName == null || (objectName.startsWith("\"") && objectName.endsWith("\""))) {
+ || objectName == null || (objectName.startsWith(quotingCharacter) && objectName.endsWith(quotingCharacter))) {
return objectName;
} else if (unquotedObjectsAreUppercased == Boolean.TRUE) {
return objectName.toUpperCase();
@@ -978,9 +979,9 @@ public String escapeObjectName(String objectName, Class<? extends DatabaseObject
if (objectName == null || quotingStrategy == ObjectQuotingStrategy.LEGACY) {
return objectName;
} else if (objectName.contains("-") || startsWithNumeric(objectName) || isReservedWord(objectName)) {
- return "\""+objectName+"\"";
+ return quotingCharacter + objectName + quotingCharacter;
} else if (quotingStrategy == ObjectQuotingStrategy.QUOTE_ALL_OBJECTS) {
- return "\"" + objectName + "\"";
+ return quotingCharacter + objectName + quotingCharacter;
}
return objectName;
}
Please sign in to comment.
Something went wrong with that request. Please try again.