Hello All,
I just observed that liquibase is not detecting the wrong file name provided in changelog xml.
e.g.
<?xml version="1.0" encoding="UTF-8"?>
<include file="abc/xyz"/>
above abc folder has file xyz.sql but while passing in changelog xml .sql extension is not given. in this case liquibase is not throwing any error. how to catch this kind of error.
aditi
June 17, 2021, 3:04pm
2
Hi @KapilGonjari ,
Liquibase calls out the changelog file that is mentioned in the liquibase.properties file. The property changeLogFile
specifies the path to the changelog to execute. Check out this doc - Creating and Configuring Liquibase.Properties Files | Liquibase Docs
rakhi
June 18, 2021, 10:17am
3
Hi @KapilGonjari
This is strange. Does liquibase still executes the SQL login from the file? If not then what exactly happens when you try this?
As you mentioned, liquibase doesn’t throw any error do you see anything else on console/ log file?
Also please help us with your environment details, just to reproduce this issue:
DB you are using
liquibase properties file
Liquibase version
Thanks!
Rakhi Agrawal
I have noticed a couple of examples of Liquibase skipping a changeset, without raising an error:
As mentioned above, when the file extension is missing from an included filename:
Liquibase formatted SQL: If a space exists in the changeset line (notice space after colon):
–changeset author: grant_test_employee_privs
rakhi
June 21, 2021, 12:30pm
6
This is because liquibase takes the path as a directory path. So for example,
If I have used this
<include file="abc/xyz"/>
then liquibase assumes it as a directory as it is not aware that xyz
is going to be a file with whatever extension - .sql or .xml or .yml
rakhi
June 21, 2021, 12:34pm
7
yeah… right. These both points counts/sounds like an issue.
liquibase should prompt an error for these cases.
@KapilGonjari / @daryldoak : Would you guys mind logging an issue for respective cases tried here .
Thanks!
Rakhi Agrawal
Issue has been opened for my issue:
opened 12:55PM - 21 Jun 21 UTC
<!--- This environment context section helps us quickly review your PR.
… Please take a minute to fill-out this information. -->
## Environment
**Liquibase Version**:
3.10.2
**Liquibase Integration & Version**: <Pick one: CLI, maven, gradle, spring boot, servlet, etc.>
CLI
**Liquibase Extension(s) & Version**:
**Database Vendor & Version**:
Oracle 12.1
**Operating System Type & Version**:
Linux
## Description
A clear and concise description of the issue being addressed.
- Describe the actual problematic behavior.
- Ensure private information is redacted.
When using Liquibase formatted SQL, if there is a space in the --changeset line, the changeset is skipped.
## Steps To Reproduce
List the steps to reproduce the behavior.
- Please be precise and ensure private information is redacted
- Include things like
- Files used - sql scripts, changelog file(s), property file(s), config files, POM Files
- Exact commands used - CLI, maven, gradle, spring boot, servlet, etc.
Added changeset to sql. (Notice space after the colon). Run Liquibase update command:
–changeset author: grant_test_employee_privs
## Actual Behavior
A clear and concise description of what happens in the software with the **version used**.
- Include console output if relevant
- Include log files if available.
Changeset is not executed, no error is raised.
## Expected/Desired Behavior
A clear and concise description of what happens in the software **after** a fix is created and merged.
An error is raised stating changeset line is invalid.
## Screenshots (if appropriate)
If applicable, add screenshots to help explain your problem.
## Additional Context
Add any other context about the problem here.
rakhi
June 21, 2021, 1:13pm
9
Great!
Let’s expect the fix in next release patch.
Thanks!