Liquibase is not working after upgrading spring boot to 2.3.1.RELEASE which leads to getting the following error (While starting the application):

Caused by java.lang.RuntimeException: Cannot use default schema name my-schema on Microsoft SQL Server because the login schema of the current user (dbo) is different and MSSQL does not support setting the default schema per session.

Now when we are using: sprint boot parent version : 2.3.1.RELEASE which internally have the 3.8.9 Previous sprint boot parent version : 2.0.5.RELEASE 3.5.5

Base on the error it looked like permission issue; I have created a user having permission on the particular schema my-schema and then tried again (Started the spring boot application):

2020-07-28 14:42:50,759 INFO  [main] liquibase.logging.core.Slf4jLogger: select schema_name()
2020-07-28 14:42:50,915 INFO  [main] liquibase.logging.core.Slf4jLogger: SELECT TOP 1 MD5SUM FROM DATABASECHANGELOG WHERE MD5SUM IS NOT NULL
2020-07-28 14:42:51,068 INFO  [main] liquibase.logging.core.Slf4jLogger: select schema_name()
2020-07-28 14:42:51,221 INFO  [main] liquibase.logging.core.Slf4jLogger: UPDATE DATABASECHANGELOG SET MD5SUM = NULL
2020-07-28 14:42:51,537 INFO  [main] liquibase.logging.core.Slf4jLogger: select schema_name()
2020-07-28 14:42:51,690 INFO  [main] liquibase.logging.core.Slf4jLogger: select schema_name()
2020-07-28 14:42:51,838 INFO  [main] liquibase.logging.core.Slf4jLogger: SELECT COUNT(*) FROM DATABASECHANGELOG
2020-07-28 14:42:51,987 INFO  [main] liquibase.logging.core.Slf4jLogger: Reading from DATABASECHANGELOG
2020-07-28 14:42:51,994 INFO  [main] liquibase.logging.core.Slf4jLogger: select schema_name()
2020-07-28 14:42:52,145 INFO  [main] liquibase.logging.core.Slf4jLogger: SELECT * FROM DATABASECHANGELOG ORDER BY DATEEXECUTED ASC, ORDEREXECUTED ASC
2020-07-28 14:42:53,188 INFO  [main] liquibase.logging.core.Slf4jLogger: select schema_name()
2020-07-28 14:42:53,343 INFO  [main] liquibase.logging.core.Slf4jLogger: UPDATE DATABASECHANGELOG SET MD5SUM = '8:417f9207fe8e8268e383719af6f9d7c7' WHERE ID = '1' AND AUTHOR = 'system' AND FILENAME = 'database/changelog/initial_schema.xml'
2020-07-28 14:42:53,654 INFO  [main] liquibase.logging.core.Slf4jLogger: select schema_name()
2020-07-28 14:42:53,810 INFO  [main] liquibase.logging.core.Slf4jLogger: UPDATE DATABASECHANGELOG SET MD5SUM = '8:30308b26d27500571e3f9bbaf68918de' WHERE ID = '2' AND AUTHOR = 'system' AND FILENAME = 'database/changelog/initial_schema.xml'

It looks like liquibase is now trying to update the my-schema.DATABASECHANGELOG MD5SUM column value. It has modified some of the records MD5SUM as NULL and for some of the field it has set new MD5SUM value; it's performing this operation each and every time I am running the application again and again.

Comment From: wilkinsona

Thanks for the report, but I think this will have to be addressed by the Liquibase team. There was a fix in 3.8.4 that is described as "Fixed a ‘Cannot Use Default Schema Name’ error when users diff against an SQL Server snapshot file". The problem that you are seeing sounds similar to that.

If it turns out that the problem is in how Spring Boot has configured Liquibase, please let us know and we can re-open this issue.

Comment From: vinodvpillai

@wilkinsona Just want to update you the issue was not from Spring boot side; it was from the Liquibase side and those people helped me and the issue got resolved. Thanks.