Problem in checksum calculation for sqlFile changeset in 4.22+

according to

Note that Liquibase obtains the checksum of a sql changeset after substituting any properties you specify. However, it obtains the checksum of a sqlFile changeset before substituting the properties in the external SQL file.

but this does not appear to be true in 4.22+. I have an sqlFile changeset which uses the ${database.liquibaseSchemaName} property. I have an integration test which compares the checksum of this changeset in two different schemas:

fun `test that all changesets have the same checksums in different schemas`() {
     * One way that a changeset can have different checksums in different schemas
     * is if the changeset has a .xml file with an <sql> tag that uses
     * the ${database.liquibaseSchemaName} variable. To fix that problem,
     * the SQL statements in the <sql> tag must be moved to a .sql file
     * that is referenced in a <sqlFile> tag in the .xml file.
    schemaService.initSchema(schema1, userId, true, true)
    schemaService.initSchema(schema2, userId, true, true)
    val liquibase1 = liquibaseFactory.createLiquibase(schemaNamingStrategy.toStarSystemSchemaName(schema1))
    val liquibase2 = liquibaseFactory.createLiquibase(schemaNamingStrategy.toStarSystemSchemaName(schema2))
    val changeSets1 = liquibase1.databaseChangeLog.changeSets
    val changeSets2 = liquibase2.databaseChangeLog.changeSets
    for (i in 0..changeSets1.size-1) {
        val checksum1 = changeSets1[i].generateCheckSum(ChecksumVersion.V9)
        val checksum2 = changeSets2[i].generateCheckSum(ChecksumVersion.V9)
        if (checksum1 != checksum2) {
  "changeSet ${changeSets1[i].filePath}:${changeSets1[i].id} differs between schemas")

With liquibase 4.21.0, this test passed, but with subsequent releases, it fails.

the changeset:

<?xml version="1.0" encoding="utf-8"?>

<changeSet author="dpoznanski" id="add_parent_array">
    <preConditions onFail="MARK_RAN">
            <columnExists tableName="config_workset" columnName="parents"/>
    <addColumn tableName="config_workset">
        <column name="parents" type="text[]"/>
    <customChange class="com.guidewire.lcm2.liquibase.task.UpdateLatestRowRunction"/>

    <sqlFile path="0023_update_parents_procedure.sql" relativeToChangelogFile="true" splitStatements="false"/>

and the sqlFile part:

create or replace function ${database.liquibaseSchemaName}.getParents(input_workset_uid uuid)
returns text as $$
_parent_uid uuid;
_parents text;
select parent_uid, parents into _parent_uid, _parents from ${database.liquibaseSchemaName}.config_workset w
where uid = input_workset_uid for update;
if (_parents is not null) then
return _parents;
end if;
if (_parent_uid is not null) then
_parents := array_prepend(_parent_uid::text, ${database.liquibaseSchemaName}.getParents(_parent_uid));
_parents := array::text;
end if;

update ${database.liquibaseSchemaName}.config_workset set parents = _parents where uid = input_workset_uid;

return _parents;

$$ language plpgsql;

select ${database.liquibaseSchemaName}.getParents(workset_uid)
from ${database.liquibaseSchemaName}.config_workset
where latest_version_uid is not null;

drop function if exists ${database.liquibaseSchemaName}.getParents;

moved to SQLFileChange calculates checksum after substituting properties · Issue #5389 · liquibase/liquibase · GitHub