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

DAT-16825 :: RawSqlStatement refactoring #5812

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

DAT-16825 :: RawSqlStatement refactoring #5812

wants to merge 29 commits into from

Conversation

MalloD12
Copy link
Contributor

@MalloD12 MalloD12 commented Apr 17, 2024

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

This PR is to address the initiative proposed in DAT-16825 to replace RawSqlStatement with RawParameterizedSqlStatement.

Also, since there were some of these changes already created for PR #5546 (Fix sonar scan High issues), I applied these changes starting from that PR. If you agree we can close that one.

Things to be aware of

  • None

Things to worry about

  • None

Additional Context

@MalloD12 MalloD12 linked an issue Apr 18, 2024 that may be closed by this pull request
2 tasks
sql.append("and k.constname = ? ");
}
sql.append("and t.tabschema = ? order by colseq");
parameters.add(database.correctObjectName(name, UniqueConstraint.class));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be inside the if too

}
}
stmt = new RawSqlStatement(sql);
parameters.add(database.getSystemSchema());
parameters.add(catalogName);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add them to the if's...

@MalloD12
Copy link
Contributor Author

@filipelautert I addressed almost all your review comments. Regarding the last one:

validationErrors.checkRequiredField("parameters", statement.getParameters(), true);

I opened up a discussion in Slack.

Thanks,
Daniel.

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 4464 files to 0 matches


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

Copy link

FOSSA Test 🧪success

Test Output


Using project name: `https://github.com/liquibase/liquibase`
Using revision: `35049a4403c0984b0f58ab077e53ac54b576defc`

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


[ERROR] 

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


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


  COMPLIANCE ISSUES (Total 26)

  ========================================================================
  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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/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/35049a4403c0984b0f58ab077e53ac54b576defc/issues/licensing/3779966


[ERROR] An issue occurred

  *** Relevant Errors ***

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




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

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 4464 files to 0 matches


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

Copy link

FOSSA Test 🧪success

Test Output


Using project name: `https://github.com/liquibase/liquibase`
Using revision: `19fe5b8b91363a92937b897ef34dde07a34ab0fd`

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


[ERROR] 

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


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


  COMPLIANCE ISSUES (Total 26)

  ========================================================================
  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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/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/19fe5b8b91363a92937b897ef34dde07a34ab0fd/issues/licensing/3779966


[ERROR] An issue occurred

  *** Relevant Errors ***

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




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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix string concatenation code-scan issues
4 participants