liquibase-core/src/main/java/liquibase/CatalogAndSchema.java
public CatalogAndSchema standardize(Database accordingTo) {
        String workCatalogName = StringUtil.trimToNull(getCatalogName());
        String workSchemaName = StringUtil.trimToNull(getSchemaName());

        if (!accordingTo.supportsCatalogs()) {
            return new CatalogAndSchema(null, null);
        }

        if (accordingTo.supportsSchemas()) {
            if ((workSchemaName != null) && workSchemaName.equalsIgnoreCase(accordingTo.getDefaultSchemaName())) {
                workSchemaName = null;
            }
        } else {
            if ((workCatalogName == null) && (workSchemaName != null)) { //had names in the wrong order
                workCatalogName = workSchemaName;
            }
            workSchemaName = workCatalogName;
        }

        if (workCatalogName != null && equals(accordingTo, workCatalogName, accordingTo.getDefaultCatalogName())) {
            workCatalogName = null;
        }
        if (workSchemaName != null && equals(accordingTo, workSchemaName, accordingTo.getDefaultSchemaName())) {
            workSchemaName = null;
        }
        if (!accordingTo.supportsSchemas() && (workCatalogName != null) && (workSchemaName != null) &&
            !workCatalogName.equals(workSchemaName)) {
            workSchemaName = null;
        }

        if (CatalogAndSchemaCase.LOWER_CASE.equals(accordingTo.getSchemaAndCatalogCase())) {
            if (workCatalogName != null) {
                workCatalogName = workCatalogName.toLowerCase(Locale.US);
            }
            if (workSchemaName != null) {
                workSchemaName = workSchemaName.toLowerCase(Locale.US);
            }
        } else if (CatalogAndSchemaCase.UPPER_CASE.equals(accordingTo.getSchemaAndCatalogCase())) {
            if (!accordingTo.isCaseSensitive()) {
                if (workCatalogName != null) {
                    workCatalogName = workCatalogName.toUpperCase(Locale.US);
                }
                if (workSchemaName != null) {
                    workSchemaName = workSchemaName.toUpperCase(Locale.US);
                }
            }
        }
        return new CatalogAndSchema(workCatalogName, workSchemaName);

    }
public CatalogAndSchema standardize(Database accordingTo) {
        String workCatalogName = StringUtil.trimToNull(getCatalogName());
        String workSchemaName = StringUtil.trimToNull(getSchemaName());

        if (!accordingTo.supportsCatalogs()) {
            return new CatalogAndSchema(null, null);
        }

        if (accordingTo.supportsSchemas()) {
            if ((workSchemaName != null) && workSchemaName.equalsIgnoreCase(accordingTo.getDefaultSchemaName())) {
                workSchemaName = null;
            }
        } else {
            if ((workCatalogName == null) && (workSchemaName != null)) { //had names in the wrong order
                workCatalogName = workSchemaName;
            }
            workSchemaName = workCatalogName;
        }

        if (workCatalogName != null && equals(accordingTo, workCatalogName, accordingTo.getDefaultCatalogName())) {
            workCatalogName = null;
        }
        if (workSchemaName != null && equals(accordingTo, workSchemaName, accordingTo.getDefaultSchemaName())) {
            workSchemaName = null;
        }
        if (!accordingTo.supportsSchemas() && (workCatalogName != null) && (workSchemaName != null) &&
            !workCatalogName.equals(workSchemaName)) {
            workSchemaName = null;
        }

        if (CatalogAndSchemaCase.LOWER_CASE.equals(accordingTo.getSchemaAndCatalogCase())) {
            if (workCatalogName != null) {
                workCatalogName = workCatalogName.toLowerCase(Locale.US);
            }
            if (workSchemaName != null) {
                workSchemaName = workSchemaName.toLowerCase(Locale.US);
            }
        } else if (CatalogAndSchemaCase.UPPER_CASE.equals(accordingTo.getSchemaAndCatalogCase())) {
            if (!accordingTo.isCaseSensitive()) {
                if (workCatalogName != null) {
                    workCatalogName = workCatalogName.toUpperCase(Locale.US);
                }
                if (workSchemaName != null) {
                    workSchemaName = workSchemaName.toUpperCase(Locale.US);
                }
            }
        }
        return new CatalogAndSchema(workCatalogName, workSchemaName);

    }
This method returns a new CatalogAndSchema adjusted based on the configuration of the passed database.
If the database does not support schemas, the returned object will have a null schema.
If the database does not support catalogs, the returned object will have a null catalog.
If either the schema or catalog matches the database default catalog or schema, they will be nulled out.
Catalog and/or schema names will be upper case unless the database violates the SQL standard by being
case-sensitive about some or all unquoted identifiers.

@see CatalogAndSchema#customize(liquibase.database.Database)