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

Improved Sybase ASE Support #665

Merged
merged 15 commits into from
Nov 16, 2022

Conversation

carlos940513
Copy link
Contributor

@carlos940513 carlos940513 commented Mar 16, 2017

Changes made on this PR are listed below:

  • Improved view snapshot support: modified SybaseDatabase.java class, so that delete the words CREATE VIEW name_view as, to did not send error when applied to another DB.
  • Improved data type handling: modified the BigIntType.java, IntType.java, SmallIntType.java, TinyIntType.java classes, the Sybase instance was added so that it did not write the size of these data types in the ChangeLog.
  • Improved system-managed table ignoring
  • Added unit tests

@datical-jenkins datical-jenkins changed the title Liquibase sybase changes LB-107 ⁃ Liquibase sybase changes Mar 4, 2020
@datical-jenkins datical-jenkins changed the title LB-107 ⁃ Liquibase sybase changes Liquibase sybase changes Mar 5, 2020
@ro-rah
Copy link

ro-rah commented May 13, 2020

Hi @carlos940513

Thanks for your pull request!

Here’s what happens next:

A member of the Liquibase team will take a look at your contribution and may suggest:

The PR will be prioritized according to our internal development and testing capacity.

We’ll let you know when it’s ready to move to the next step or if any changes are needed.

@ro-rah
Copy link

ro-rah commented May 13, 2020

Hi @carlos940513 , would you please resolve the branch conflicts and consider adding tests?

Thanks,

Ronak

@nvoxland nvoxland self-requested a review as a code owner October 5, 2022 05:09
@nvoxland nvoxland changed the base branch from master to 1_9 October 5, 2022 05:09
@nvoxland nvoxland changed the base branch from 1_9 to master October 5, 2022 05:09
@nvoxland nvoxland added the SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions label Oct 5, 2022
@github-actions
Copy link

github-actions bot commented Oct 5, 2022

Unit Test Results

  4 740 files  ±  0    4 740 suites  ±0   39m 29s ⏱️ + 6m 42s
  4 695 tests +  3    4 459 ✔️ +  3     236 💤 ±0  0 ±0 
55 560 runs  +36  50 252 ✔️ +36  5 308 💤 ±0  0 ±0 

Results for commit 9f802cc. ± Comparison against base commit b88ce92.

♻️ This comment has been updated with latest results.

@nvoxland nvoxland added SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions and removed SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions labels Oct 6, 2022
Copy link
Contributor

@nvoxland nvoxland left a comment

Choose a reason for hiding this comment

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

Code review and test results:

After resolving conflicts, the list of things still needing fixed by this PR are:

  • Fixed view definition snapshot logic to remove "create view as" if the database returns it
  • Fixed handling of bigint/int/smallint/tinyint when arguments are specified (sybase does not support them)
  • Better ignore columns that start with "sybfi" which are system-managed
  • Better handling of foreign key onUpdate/onDelete (sybase does not support them)
  • Better handling of numbers being used as booleans that have trailing non-number content in them

Things to be aware of:

  • Changes are limited to sybase

Things to worry about:

  • Not good test automation around sybase to see and test that the changes work. But they all appear to make sense to me and as we add sybase testing support, it will catch regressions if any of these changes get undone

@@ -70,6 +70,9 @@ public DatabaseDataType toDatabaseDataType(Database database) {
}
}
}
if (database instanceof SybaseDatabase) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can the SybaseASADatabase and SybaseDatabase "ifs" be included as an "or" in the "if" at line 56?

Copy link
Contributor

Choose a reason for hiding this comment

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

We were actually already checking for sybase up on line 44 so I just moved SybaseASA up there.

It doesn't super matter, I had just left it as it came though in the merge

@@ -72,6 +72,9 @@ public DatabaseDataType toDatabaseDataType(Database database) {
if (database instanceof SybaseASADatabase) {
return new DatabaseDataType("INTEGER");
}
if (database instanceof SybaseDatabase) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar question to the one in BigIntType.java. Can this be moved to be an "or" in the "if" at line 65?

Copy link
Contributor

Choose a reason for hiding this comment

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

It can but doesn't really matter. I moved it since I was taking a couple things out otherwise.

@@ -61,7 +61,9 @@ public DatabaseDataType toDatabaseDataType(Database database) {
}
return new DatabaseDataType("SMALLINT"); //always smallint regardless of parameters passed
}

if (database instanceof SybaseDatabase) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the SybaseASADatabase also be included in this logic? Same question for TinyIntType.java.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure about smallint vs. tinyint. I didn't go hunting through their docs on what datatypes they support and was just reviewing this PR for the fixes it specifically had.

import liquibase.database.jvm.JdbcConnection;
import liquibase.database.core.MariaDBDatabase;
Copy link
Contributor

Choose a reason for hiding this comment

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

Were these imports for DB2Database, MSSQLDatabase and MariaDBDatabase removed by accident?

Copy link
Contributor

Choose a reason for hiding this comment

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

No accidentally. With the merge from master, I did a "fix code layout" which also removes unneeded imports. If they were needed, the compile would have failed.

@@ -80,6 +82,8 @@ public Sql[] generateSql(AddForeignKeyConstraintStatement statement, Database da
// see "REFERENCES Clause" in manual
} else if ((database instanceof FirebirdDatabase) && "RESTRICT".equalsIgnoreCase(statement.getOnDelete())) {
//don't use
} else if (database instanceof SybaseDatabase) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should SybaseASADatabase be here, too?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure. This PR was just for sybase support, not sybase asa so didn't look at that.

Copy link
Contributor

@XDelphiGrl XDelphiGrl left a comment

Choose a reason for hiding this comment

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

@nvoxland, hello - Will you please take a look at my comments?

CHANGES REQUESTED

@nvoxland nvoxland added SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions and removed SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions labels Oct 11, 2022
@MalloD12 MalloD12 self-assigned this Oct 27, 2022
@MalloD12 MalloD12 changed the base branch from master to 1_9 October 28, 2022 13:33
@MalloD12 MalloD12 changed the base branch from 1_9 to master October 28, 2022 13:34
@MalloD12
Copy link
Contributor

@nvoxland, hello - Will you please take a look at my comments?

CHANGES REQUESTED

Hey @XDelphiGrl ,

Could you please take a look to this PR when you have a chance? I have addressed I think most of the comments you have made here?

Thanks,
Daniel.

@MalloD12 MalloD12 added SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions and removed SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions labels Nov 1, 2022
…ase-sybase-changes

# Conflicts:
#	liquibase-core/src/main/java/liquibase/datatype/core/BigIntType.java
#	liquibase-core/src/main/java/liquibase/datatype/core/IntType.java
#	liquibase-core/src/main/java/liquibase/datatype/core/SmallIntType.java
@MalloD12 MalloD12 added SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions and removed SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions labels Nov 8, 2022
@MalloD12 MalloD12 changed the title Liquibase sybase changes Sybase improvements for datatype handling, snapshotting views, ignoring system-managed tables, and a foreign key bug fix Nov 9, 2022
@MalloD12 MalloD12 self-requested a review November 9, 2022 19:38
Copy link
Contributor

@MalloD12 MalloD12 left a comment

Choose a reason for hiding this comment

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

Review and testing results:

Overall changes look ok to me. The only things I did here were:

  • Fixed unit tests failing.
  • Update some IF blocks from Data Types classes as suggested in some of the review comments.

Things to be aware of:

  • These changes have only an impact on Sybase and SybaseASADatabase DBs.

Things to worry about:

  • Nothing

@MalloD12 MalloD12 changed the title Sybase improvements for datatype handling, snapshotting views, ignoring system-managed tables, and a foreign key bug fix Improved Sybase ASE Support Nov 9, 2022
Copy link
Contributor

@XDelphiGrl XDelphiGrl left a comment

Choose a reason for hiding this comment

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

Several improvements for Sybase ASE handling are introduced in this PR. See this comment for a comprehensive list.

  • New tests added for numeric datatype handling.
  • Automated functional and test harness executions passing.
  • No additional testing required.

APPROVED

@filipelautert filipelautert merged commit 2d333a2 into liquibase:master Nov 16, 2022
@filipelautert filipelautert added this to the 4.18.0 milestone Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autocandidate DBSybase SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

8 participants