You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My case is that I need to execute a Changeset which is SQL file containing wrapped body of an oracle DB package. There are cases, where on jdbc execution this wrapped body is trimmed and that way its checksum is no longer valid, which on DB deploy results in "PLS-00753: Malformed or corrupted wrapped unit." error.
Steps To Reproduce
Actual Behavior
It happens, due to when Oracle initially wraps these packages, it applies one additional row to the wrapped body and then calculates and saves the checksum in wrapped package. Then when the Liquibase JdbcExecutor executes the Changeset it trims this additional row, and that way making it invalid and unable for deploy. The code that is trimming it is at:
private class ExecuteStatementCallback implements StatementCallback
....
@Override
public Object doInStatement(Statement stmt) throws SQLException, DatabaseException {
Logger log = Scope.getCurrentScope().getLog(getClass());
for (String statement : applyVisitors(sql, sqlVisitors)) {
Scope.getCurrentScope().
if (database instanceof OracleDatabase) {
while (statement.matches("(?s).*[\\s\\r\\n]*[^*]/[\\s\\r\\n]*$")) { //all trailing /'s
statement = statement.replaceFirst("[\\s\\r\\n]*[^*]/[\\s\\r\\n]*$", "");
}
}
...
Expected/Desired Behavior
I want to be able to switch that trimming on/off and successfully deploy SQL changesets holding wrapped Oracle packages. Is there a way to change this functionality? I don't need to introduce entire new Executor implementation, since this one operates fine except the subject issue. Is it reasonable to introduce a change in the JdbcExecutor with ability to configure toggle the trimming functionality. What I`m not sure is:
Where is the proper place for such configuration? "liquibase.properties" file, as changeLog property tag or different place?
how can I access this config property in code?
For example a change in JdbcExecutor like this:
if(isTrimmingEnabled){
if (database instanceof OracleDatabase) {
while (statement.matches(
"(?s).*[\\s\\r\\n]*[^*]/[\\s\\r\\n]*$")) { //all trailing /'s
statement = statement.replaceFirst("[\\s\\r\\n]*[^*]/[\\s\\r\\n]*$",
"");
}
}
}
Thank you!
The text was updated successfully, but these errors were encountered:
@ISpectruM there was some work done recently #3118 Oracle PL/SQL terminator that was released in v4.15.0. Not sure if this will resolve/help, but you might want to try the newer version.
Environment
Liquibase Version: 4.12.0
Liquibase Integration & Version: spring boot
Liquibase Extension(s) & Version: NA
Database Vendor & Version: com.oracle.database.jdbc:ojdbc11
Operating System Type & Version: Windows 10
Infrastructure Type/Provider: Local
Description
My case is that I need to execute a Changeset which is SQL file containing wrapped body of an oracle DB package. There are cases, where on jdbc execution this wrapped body is trimmed and that way its checksum is no longer valid, which on DB deploy results in "PLS-00753: Malformed or corrupted wrapped unit." error.
Steps To Reproduce
Actual Behavior
It happens, due to when Oracle initially wraps these packages, it applies one additional row to the wrapped body and then calculates and saves the checksum in wrapped package. Then when the Liquibase JdbcExecutor executes the Changeset it trims this additional row, and that way making it invalid and unable for deploy. The code that is trimming it is at:
Expected/Desired Behavior
I want to be able to switch that trimming on/off and successfully deploy SQL changesets holding wrapped Oracle packages. Is there a way to change this functionality? I don't need to introduce entire new Executor implementation, since this one operates fine except the subject issue. Is it reasonable to introduce a change in the JdbcExecutor with ability to configure toggle the trimming functionality. What I`m not sure is:
For example a change in JdbcExecutor like this:
Thank you!
The text was updated successfully, but these errors were encountered: