Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra backslash added in the column values in the genarated sql #1598

Closed
zamani84 opened this issue Dec 18, 2020 · 3 comments · Fixed by #2021
Closed

Extra backslash added in the column values in the genarated sql #1598

zamani84 opened this issue Dec 18, 2020 · 3 comments · Fixed by #2021

Comments

@zamani84
Copy link

zamani84 commented Dec 18, 2020

We make a liquibase database export from oracle DB. In some columns the value "\b08.*" is saved. When I execute "mvn liquibase:generateChangeLog" command then the value is exported in a insert statment like this:

<insert tableName="xyz">
           ...
            <column name="KURZ_TEXT" value="\\b08.*"/>
            <column name="LANG_TEXT" value="\\b08.*"/>
    ...


</insert>

We use liquibase 3.6.2.

Please, I don't know how the exporter changes the value of the exported column values. How can I prevent this? I want exactly the value as it is in the column.

This is my liquibase maven export profile:


<profile>
      <!-- DB Auszug von DATEN aus KONFIG SCHEMA - ACHTUNG: ES WERDEN ALLE KONFIG DATEN VON ALLEN TABELLEN EXPORTIERT -->
      <id>export_konfig_data</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.liquibase</groupId>
              <artifactId>liquibase-maven-plugin</artifactId>
              <configuration>
                <changeSetAuthor>MELDEPORTAL ${parent.version} KONFIG DATA</changeSetAuthor>
                <diffTypes>data</diffTypes>
                <outputChangeLogFile>${project.basedir}/changelogs/initial/initial_konfig_data.xml</outputChangeLogFile>
                <changeSetContext>konfig</changeSetContext>
                <driver>oracle.jdbc.OracleDriver</driver>
                <promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
                <logging>INFO</logging>
                <url>${database.urls}</url>
                <username>xxxxx</username>
                <password>xxxxx</password>
                <contexts>xxxxx,${context}</contexts>
              </configuration>
            </plugin>
          </plugins>
</pluginManagement>
 </build>
    </profile>

This is the exact command I execute: mvn liquibase:generateChangeLog -Pexport_konfig_data

This issue should be same like mentioned here: https://forum.liquibase.org/t/extra-backslash-added-in-the-column-values-in-the-genarated-sql-file-from-generatechangelog-using-maven-liquibase/3663

@zamani84 zamani84 changed the title Extra backslash added in the column values in the genarated sql file from generateChangeLog using maven Liquibase^^ Extra backslash added in the column values in the genarated sql file from generateChangeLog using maven Liquibase Dec 18, 2020
@molivasdat
Copy link
Contributor

Hi @zamani84 Thanks for writing up this issue. Do you have a simple use case that you can attach or create a repo that recreates the issue so that we can have the community take a look at fixing it?

@zamani84
Copy link
Author

zamani84 commented Dec 29, 2020

Hallo,
thanks very much for answering.

We use oracle 12c database.

Create following table as oracle user KONFIG:

CREATE TABLE KONFIG.MY_TABLE
(
A_TXT CHAR(24 CHAR)
);

Then include following into the table:

Insert into KONFIG.MY_TABLE (A_TXT) values ('\b08.* ');

Now make a data liquibase export of the Tablle KONFIG.MY_TABLE. It should work with this pom.xml :

pom.xml

Please change password and db url in above pom.xml.

Now execute the export: mvn liquibase:generateChangeLog -Pexport_konfig_datas

Now you get this export liquibase script: konfig-export.oracle.xml , that is the content: the inserted field contains double backslashes in the export. Also as sql export it is the same.

As you see, it has to backslashes. I try to attach the files.

@zamani84
Copy link
Author

Here the files:

pom.xml , export file : konfig-export.oracle.xml and the sql file to generate table and insert one dataset into it (all in zip file database-export-test.zip)
database-export-test.zip

@molivasdat molivasdat added this to To Do in Conditioning++ via automation Jul 7, 2021
@molivasdat molivasdat added BKeyPlatform Key Platform BNoUpgradePath Cannot upgrade to next version labels Jul 7, 2021
nvoxland added a commit that referenced this issue Aug 4, 2021
If the output format needs them escaped, escape them then.

Fixes #1598
@nvoxland nvoxland changed the title Extra backslash added in the column values in the genarated sql file from generateChangeLog using maven Liquibase Extra backslash added in the column values in the genarated sql Aug 4, 2021
@nvoxland nvoxland moved this from To Do to Code Review in Conditioning++ Aug 4, 2021
@suryaaki2 suryaaki2 moved this from Code Review to Ready for Handoff (In JIRA) in Conditioning++ Oct 18, 2021
Conditioning++ automation moved this from Ready for Handoff (In JIRA) to Done Nov 15, 2021
@nvoxland nvoxland removed this from Done in Conditioning++ Dec 1, 2021
@nvoxland nvoxland added this to the v4.6.2 milestone Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants