Liquibase is trying to execute SQL that is commented out.

Hi,


I’m using Lb from the command line up against Oracle 11g on a remote server.


The gist of my problem is, I have lines of sql commented out with “–” at the start but it seems to me Liquibase is ignoring them and trying to execute them as SQL. 


If i put stripComments into my liquibase.xml then of course they get loaded fine, but I don’t want to strip comments.


my changeset entry is like this


   

       

   


And the portion of that file in question is:


–Paid

–INSERT INTO REFERENCE_VALUES (REFERENCE_VALUE_ID, CREATED_BY, CREATED_TS, UPDATED_BY, UPDATED_TS,

–CATEGORY, CODE, ENABLED, SORT_ORDER, DEFAULT_REF)

–VALUES (57, ‘dataLoad’, sysdate, ‘dataLoad’, sysdate, ‘CLAIM_STATUS’, ‘Paid’, 1, 7, 0);



And the error is here


Liquibase update Failed: Migration failed for change set liquibase.xml::3::jeffm:

     Reason: liquibase.exception.DatabaseException: Error executing SQL --Paid

–INSERT INTO REFERENCE_VALUES (REFERENCE_VALUE_ID, CREATED_BY, CREATED_TS, UPDATED_BY, UPDATED_TS,

–CATEGORY, CODE, ENABLED, SORT_ORDER, DEFAULT_REF)

–VALUES (57, ‘dataLoad’, sysdate, ‘dataLoad’, sysdate, ‘CLAIM_STATUS’, ‘Paid’, 1, 7, 0): Invalid SQL type: sqlKind = UNINITIALIZED


Shouldn’t all of these just be ignored outright by liquibase?


Jeff.

Well, i wasn’t logged in when i posted this, so i’m just commenting on myself so i can follow it.

Forgot to click follow. sigh. Friday.

Normally the stripComments is what you would want to use. Why are you wanting the comments “exectued” against the database?


Nathan

I think maybe I just mis understood how comments were handled and that they were some how pulled into the database for logs or something.


One would expect comments to be  skipped by default by the nature of them being comments wouldn’t one?

Yes, which is why stripComments defaults to true. There are times that they can matter and need to be passed along, especially in stored procs in some databases.


Nathan

Sorry. I on further check it does default to “false” which isn’t as expected but was left for backwards compatibility.


Nathan

That makes sense. Thanks!


jeff.