Liquibase not adding a '/' at the end for loadUpdateData for Oracle

Description

We have a liquibase XML that has:

1 2 3 4 5 6 7 <changeSet author="evolv" id="lvp-loadData-5.4.2-1a" runAlways="true"> <loadUpdateData tableName="organization" primaryKey="Id" file="changelog/data/INSERTS_ORGANIZATION.csv"> <column name="name" type="STRING"/> </loadUpdateData> </changeSet>

And using the liquibase-maven-plugin updateSQL goal against Oracle produces:

1 2 3 4 5 6 7 8 9 10 DECLARE v_reccount NUMBER := 0; BEGIN SELECT COUNT(*) INTO v_reccount FROM organization WHERE Id is NULL; IF v_reccount = 0 THEN INSERT INTO organization (name) VALUES ('Test Organization'); ELSIF v_reccount = 1 THEN UPDATE organization SET name = 'Test Organization' WHERE Id is NULL; END IF; END;

With NO / to execute the block. When running this SQL file using sqlplus it blocks at this block forever. In InsertOrUpdateGeneratorOracle class it is writing out the "/" character in the method getPostUpdateStatements(Database) but in LoggingExecutor it does this which removes the "/":

1 2 3 4 5 if (database instanceof OracleDatabase) { //remove trailing / while (statement.matches("(?s).*[\\s\\r\\n]*/[\\s\\r\\n]*$")) { //all trailing /'s statement = statement.replaceFirst("[\\s\\r\\n]*/[\\s\\r\\n]*$", ""); } }

Then later in in that same method has this commented out:

1 2 3 // } else if (database instanceof OracleDatabase) { // output.write(StreamUtil.getLineSeparator()); // output.write("/");

It seems this is a bug, If the SQL statement is a <loadUpdateData> and its on an Oracle database then it needs to add back the "/" that LoggingExecutor is removing.

We are using version 3.5.5 but also checked against 3.6.3 and its the same behavior.

Environment

Dev

Status

Assignee

Unassigned

Reporter

Vinay Kashyap

Labels

None

Components

Affects versions

3.6.3

Priority

Major