# Liquibase sql comment validation bug

**URL:** <https://forum.liquibase.org/t/liquibase-sql-comment-validation-bug/9134>\
**Category:** Liquibase Development\
**Created:** [February 22, 2024, 12:30am UTC](https://forum.liquibase.org/t/liquibase-sql-comment-validation-bug/9134 "2024-02-22T00:30:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![notsogreat](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@notsogreat](https://forum.liquibase.org/u/notsogreat)\
**Post date:** [February 22, 2024, 12:30am UTC](https://forum.liquibase.org/t/liquibase-sql-comment-validation-bug/9134/1 "2024-02-22T00:30:27Z")

</div>

A sql view with block comments containing  
– Comments :  
had run successfully in Liquibase 4.3.5. We are trying to migrate to new version of Liquibase 4.25.1. We are getting the error

liquibase.exception.SetupException: Unexpected formatting in formatted changelog ‘\<FILE\_NAME\_REMOVED\>sql’ at line 16. Formatted SQL changelogs require known formats, such as '–comment ’ and others to be recognized and run. Learn all the options at [https://docs.liquibase.com/concepts/changelogs/sql-format.html](https://docs.liquibase.com/concepts/changelogs/sql-format.html) at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:756) at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:508) at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:390) at

### Steps To Reproduce

Input file:

–liquibase formatted sql  
–never change the value of author:changsetid  
–changeset views:VW\_DIM stripComments:false runOnChange:true  
–Database.ANALYTICS.VW\_DIM source

CREATE  
OR REPLACE VIEW VW\_DIM  
/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
– View name: VW\_DIM  
– Layer : Analytics  
– Owner :  
– Version :  
– Created by :  
– Created on :  
– Reviewed by :  
– Purpose :  
– Comments :  
– JIRA story/incident link :  
– Revision history :  
Sl No. Date Author Changelog

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/

AS(

–  
Run this against liquibase validate and it fails.

### Expected/Desired Behavior

Validation should have passed

### Liquibase Version

4.25.1

### Database Vendor & Version

snowflake

### Liquibase Integration

CLI

Looks like this issue or a variation of this issue was fixed in earlier version as reported in  
[#3017](https://github.com/liquibase/liquibase/issues/3017)  
Probably fixed for --comment but not for – Comments :

---

<div class="post-metadata">

**Author:** ![nicola](https://avatars.discourse-cdn.com/v4/letter/n/41988e/32.png) [@nicola](https://forum.liquibase.org/u/nicola)\
**Post date:** [March 11, 2024, 6:17pm UTC](https://forum.liquibase.org/t/liquibase-sql-comment-validation-bug/9134/2 "2024-03-11T18:17:11Z")

</div>

We have a related problem that we used --comments and now it fails when we upgraded to latest version. Once we go in and change all the “comments” to “comment”, hash changes and everything fails. Is there an option to turn this specific validation off or just this section?

Upgrade from “Liquibase Community 4.3.1 by Datical” → Liquibase Version: 4.25.1

Thanks.

---

<div class="post-metadata">

**Author:** ![wwillard](https://avatars.discourse-cdn.com/v4/letter/w/8e8cbc/32.png) [@wwillard](https://forum.liquibase.org/u/wwillard)\
**Post date:** [March 13, 2024, 3:13pm UTC](https://forum.liquibase.org/t/liquibase-sql-comment-validation-bug/9134/3 "2024-03-13T15:13:33Z")

</div>

I am not having any luck replicating this issue. This changelog does not cause any complaints for me with 4.25.1.  
Would it be possible for you to submit a Github issue on this, so it can be more thoroughly investigated?

Thank you,  
Wesley

```auto
-- liquibase formatted sql
  
-- changeset somebody:1645123377463-1
CREATE TABLE "proschema"."TABLEWITHCOMMENTS" ("name" VARCHAR(20), "lastname" VARCHAR(20));
COMMENT ON TABLE "proschema"."TABLEWITHCOMMENTS" IS 'THIS IS A COMMENT';
COMMENT ON COLUMN "proschema"."TABLEWITHCOMMENTS"."name" IS 'name commented';
COMMENT ON COLUMN "proschema"."TABLEWITHCOMMENTS"."lastname" IS 'second comment';
--rollback drop table "TABLEWITHCOMMENTS"

-- changeset somebody:viewwithcomments
CREATE OR REPLACE VIEW proschema.viewwithcomments
/ *******************************************************************
– View name: VW_DIM
– Layer : Analytics
– Owner :
– Version :
– Created by :
– Created on :
– Reviewed by :
– Purpose :
– Comments :
– JIRA story/incident link :
– Revision history :
Sl No. Date Author Changelog

******************************************************************* /
 AS
 SELECT a.name,
    a.lastname
   FROM "TABLEWITHCOMMENTS" a
  GROUP BY a.name, a.lastname;

ALTER TABLE proschema.viewwithcomments
    OWNER TO proschema;
COMMENT ON VIEW proschema.viewwithcomments
    IS 'this comment should be exported';

COMMENT ON COLUMN proschema.viewwithcomments.name
    IS 'view name comment';
--rollback drop view viewwithcomments
``
```

---

<div class="post-metadata">

**Author:** ![notsogreat](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@notsogreat](https://forum.liquibase.org/u/notsogreat)\
**Post date:** [March 14, 2024, 5:02am UTC](https://forum.liquibase.org/t/liquibase-sql-comment-validation-bug/9134/4 "2024-03-14T05:02:11Z")

</div>

Good Morning,  
Thanks for your reply.  
Is it possible for you to first run this script in 4.3.5 and then try to upgrade with 4.25.1.  
I did not test with 4.25.1 directly. We were trying to upgrade.  
I will do some testing with 4.25.1 but in the mean time could you please first run with 4.3.5 and then upgrade

Thanks.

---

<div class="post-metadata">

**Author:** ![notsogreat](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@notsogreat](https://forum.liquibase.org/u/notsogreat)\
**Post date:** [March 21, 2024, 4:37am UTC](https://forum.liquibase.org/t/liquibase-sql-comment-validation-bug/9134/5 "2024-03-21T04:37:11Z")

</div>

Good Morning Wesley,  
FYI, another team member has pinned the issue.

> <https://github.com/liquibase/liquibase/issues/5602#issuecomment-2010227725>
>
> \### Search first
> 
> \- \[X\] I searched and no similar issues were found
> 
> \### Descrip…tion
> 
> A sql view with block comments containing 
> \-- Comments : 
> had run successfully in Liquibase 4.3.5. We are trying to migrate to new version of Liquibase 4.25.1. We are getting the error
> 
> liquibase.exception.SetupException: Unexpected formatting in formatted changelog '\<FILE\_NAME\_REMOVED\>sql' at line 16. Formatted SQL changelogs require known formats, such as '--comment \<comment\>' and others to be recognized and run. Learn all the options at https://docs.liquibase.com/concepts/changelogs/sql-format.html at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:756) at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:508) at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:390) at
> 
> 
> \### Steps To Reproduce
> 
> Input file:
> 
> 
> \--liquibase formatted sql
> \--never change the value of author:changsetid
> \--changeset views:VW\_DIM stripComments:false runOnChange:true
> \--Database.ANALYTICS.VW\_DIM source
> 
> 
> CREATE 
> OR REPLACE VIEW VW\_DIM
> /\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> \-- View name: VW\_DIM
> \-- Layer : Analytics
> \-- Owner : \<Removed\>
> \-- Version : \<Removed\>
> \-- Created by : \<Removed\>
> \-- Created on : \<Removed\>
> \-- Reviewed by : \<Removed\>
> \-- Purpose : \<Removed\>
> \-- Comments : 
> \-- JIRA story/incident link : \<Removed\>
> \-- Revision history :
> Sl No. Date Author Changelog
> 
> \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/
> 
> AS(
> \<SQL Removed\>
> 
> \--
> Run this against liquibase validate and it fails 
> 
> \### Expected/Desired Behavior
> 
> Validation should have passed
> 
> \### Liquibase Version
> 
> 4.25.1
> 
> \### Database Vendor & Version
> 
> snowflake
> 
> \### Liquibase Integration
> 
> CLI
> 
> \### Liquibase Extensions
> 
> \_No response\_
> 
> \### OS and/or Infrastructure Type/Provider
> 
> \_No response\_
> 
> \### Additional Context
> 
> Looks like this issue or a variation of this issue was fixed in earlier version as reported in 
> https://github.com/liquibase/liquibase/issues/3017
> Probably fixed for --comment but not for -- Comments : 
> 
> Thanks anyway for the good tool which makes our life easier 
> 
> \### Are you willing to submit a PR?
> 
> \- \[\] I'm willing to submit a PR (Thank you!)

We will make the changes and try to see whether this workaround solution helps.  
Thanks for your work
