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

Fix SQL execution issue with endDelimiter '/' and splitStatements #5704

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

MalloD12
Copy link
Contributor

Impact

  • Bug fix (non-breaking change which fixes expected existing functionality)
  • Enhancement/New feature (adds functionality without impacting existing logic)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Fixes #5359

Things to be aware of

Things to worry about

Additional Context

@MalloD12 MalloD12 changed the title Fix #5359 FixSQL execution issue with endDelimiter '/' and splitStatements Mar 15, 2024
@MalloD12 MalloD12 changed the title FixSQL execution issue with endDelimiter '/' and splitStatements Fix SQL execution issue with endDelimiter '/' and splitStatements Mar 15, 2024
@filipelautert
Copy link
Collaborator

@MalloD12 I added 2 tests, and test ":moreSlashEndDelimiterTest" broke Oracle build. Would it be a valid test case?

@MalloD12
Copy link
Contributor Author

@MalloD12 I added 2 tests, and test ":moreSlashEndDelimiterTest" broke Oracle build. Would it be a valid test case?

@filipelautert I think that is not a valid case, because after a / we are expecting the beginning of a new SQL statement.

@MalloD12
Copy link
Contributor Author

@MalloD12 I added 2 tests, and test ":moreSlashEndDelimiterTest" broke Oracle build. Would it be a valid test case?

@filipelautert I think that is not a valid case, because after a / we are expecting the beginning of a new SQL statement.

I'm wondering now, whether we should tag this to be documented. @filipelautert do you know if we have things like this in confluence? Before we move ahead with this let me double-check it with Mario.

@MalloD12
Copy link
Contributor Author

@AMBERMW13 @adrian-velonis1 Guys, we have been discussing on Thursday with Mario about documenting these changes as a helpful tip. What we want to document is the technical decision that was made some time ago by Nathan, but which we lightly modified to avoid having issues when using / as endDelimiter but we also have a division operator as part of a SQL statement. The decision we made is when we found a / we will know it's an endDelimiter if the next character is a new line, so if there are two SQL statements they should be separated in a new line. Below some examples of it:

Example 1:

<sql endDelimiter="/" splitStatements="true" stripComments="false">
  SELECT * FROM unnamed_constraint/
  update liquibaseRunInfo set timesRan=timesRan+1/
</sql>

Example 2:

<sql endDelimiter="/" splitStatements="true" stripComments="false">
  SELECT 6 / 3 FROM unnamed_constraint/
  update liquibaseRunInfo set timesRan=timesRan+1/
</sql>

Thanks,
Daniel.

Copy link
Collaborator

@filipelautert filipelautert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rberezen this PR is specific to Oracle sqls.

Copy link

FOSSA Snippets Detection 🤖success

Snippets Detection Output

Running FOSSA snippets
 INFO main{target=/home/runner/work/liquibase/liquibase/}: Analyzing local snippet matches
 INFO main{target=/home/runner/work/liquibase/liquibase/}: Finished matching 0 snippets out of 4436 files to 0 matches


Pusher: @rberezen, Action: pull_request, Working Directory: /home/runner/work/liquibase/liquibase, Workflow: FOSSA AI License Compliance and Security Check

Copy link

FOSSA Test 🧪success

Test Output


Using project name: `https://github.com/liquibase/liquibase`
Using revision: `354bb8b45736707776fd5fa2ddd573ae514cabb4`

[ Checking build completion for 354bb8b45736707776fd5fa2ddd573ae514cabb4... ]
[ Waiting for build completion (revision 354bb8b45736707776fd5fa2ddd573ae514cabb4)... last status: StatusCreated ]
[ Waiting for issue scan completion... ]


[ERROR] 

  ========================================================================
  Tested Following Project:
  ========================================================================


  Project Title: https://github.com/liquibase/liquibase
  Project Revision: 354bb8b45736707776fd5fa2ddd573ae514cabb4
  Project Visibility: private
  Project Targets:
  - maven: [pom.xml]


  COMPLIANCE ISSUES (Total 28)

  ========================================================================
  Unlicensed Dependency (Total 2)
  ========================================================================
  ⚑ Unlicensed dependency detected in aopalliance:aopalliance@1.0
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/4934914

  ⚑ Unlicensed dependency detected in com.ibm.db2:jcc@11.5.9.0
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/4319140


  ========================================================================
  Flagged by Policy (Total 26)
  ========================================================================
  ⚑ LGPL-3.0-only license detected in com.github.javaparser:javaparser-core@3.25.9
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/5053794

  ⚑ LGPL-3.0-or-later license detected in com.github.javaparser:javaparser-core@3.25.9
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/5053793

  ⚑ LGPL-3.0-or-later license detected in com.h2database:h2@2.2.224
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/4850918

  ⚑ GPL-2.0-with-classpath-exception license detected in com.sun.istack:istack-commons-runtime@4.1.2
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/4934920

  ⚑ GPL-2.0-with-classpath-exception license detected in jakarta.activation:jakarta.activation-api@2.1.3
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/5173516

  ⚑ GPL-2.0-with-classpath-exception license detected in jakarta.annotation:jakarta.annotation-api@2.1.0
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/4934922

  ⚑ GPL-2.0-with-classpath-exception license detected in jakarta.el:jakarta.el-api@5.0.0
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/4934924

  ⚑ GPL-2.0-with-classpath-exception license detected in jakarta.enterprise:jakarta.enterprise.cdi-api@4.0.1
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/4934916

  ⚑ GPL-2.0-with-classpath-exception license detected in jakarta.enterprise:jakarta.enterprise.lang-model@4.0.1
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/4934919

  ⚑ GPL-2.0-with-classpath-exception license detected in jakarta.interceptor:jakarta.interceptor-api@2.1.0
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/4934928

  ⚑ GPL-2.0-with-classpath-exception license detected in jakarta.servlet:jakarta.servlet-api@5.0.0
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/4934931

  ⚑ GPL-2.0-with-classpath-exception license detected in jakarta.xml.bind:jakarta.xml.bind-api@4.0.2
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/5173517

  ⚑ GPL-2.0-only license detected in javax.activation:javax.activation-api@1.2.0
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/4414991

  ⚑ GPL-2.0-with-classpath-exception license detected in javax.activation:javax.activation-api@1.2.0
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/4414990

  ⚑ GPL-2.0-with-classpath-exception license detected in javax.servlet:javax.servlet-api@3.1.0
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/4934935

  ⚑ GPL-2.0-only license detected in javax.xml.bind:jaxb-api@2.3.1
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/4414993

  ⚑ GPL-2.0-with-classpath-exception license detected in javax.xml.bind:jaxb-api@2.3.1
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/4414992

  ⚑ LGPL-2.1-or-later license detected in net.java.dev.jna:jna@5.13.0
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/4934934

  ⚑ GPL-2.0-with-classpath-exception license detected in org.eclipse.angus:angus-activation@2.0.2
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/5173515

  ⚑ LGPL-2.1-only license detected in org.firebirdsql.jdbc:jaybird@5.0.4.java8
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/5173521

  ⚑ LGPL-3.0-only license detected in org.firebirdsql.jdbc:jaybird@5.0.4.java8
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/5173520

  ⚑ GPL-2.0-with-classpath-exception license detected in org.glassfish.jaxb:jaxb-core@4.0.5
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/5173518

  ⚑ GPL-2.0-with-classpath-exception license detected in org.glassfish.jaxb:jaxb-runtime@4.0.5
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/5173519

  ⚑ GPL-2.0-with-classpath-exception license detected in org.glassfish.jaxb:txw2@4.0.5
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/5173522

  ⚑ GPL-2.0-or-later license detected in org.yaml:snakeyaml@2.2
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/3779967

  ⚑ LGPL-2.1-or-later license detected in org.yaml:snakeyaml@2.2
  More information: https://app.fossa.com/projects/custom%2B40163%2Fgithub.com%2Fliquibase%2Fliquibase/refs/branch/master/354bb8b45736707776fd5fa2ddd573ae514cabb4/issues/licensing/3779966


[ERROR] An issue occurred

  *** Relevant Errors ***

      �[0;91mError: �[0mThe scan has revealed issues. Number of issues found: 28




Pusher: @rberezen, Action: pull_request, Working Directory: /home/runner/work/liquibase/liquibase, Workflow: FOSSA AI License Compliance and Security Check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Doc Review
Development

Successfully merging this pull request may close these issues.

[V4.25.0] Regression in SQL execution with endDelimiter and splitStatements
3 participants