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

Test changes for 'Fix error when trying to drop columns from temp tables.' #2753

Merged

Conversation

Sairakan
Copy link
Contributor

@Sairakan Sairakan commented Jul 18, 2024

Description

Tests for babelfish-for-postgresql/postgresql_modified_for_babelfish#410

Issues Resolved

BABEL-4912

Test Scenarios Covered

  • Use case based -

  • Boundary conditions -

  • Arbitrary inputs -

  • Negative test cases -

  • Minor version upgrade tests -

  • Major version upgrade tests -

  • Performance tests -

  • Tooling impact -

  • Client tests -

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is under the terms of the Apache 2.0 and PostgreSQL licenses, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.

For more information on following Developer Certificate of Origin and signing off your commits, please check here.

CREATE TABLE #t1 (a INT, b INT)
GO

ALTER TABLE #t1 DROP COLUMN b
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add more tests, such as

  • dropping then recreating the same column multiple times
  • make sure that dependencies aren't broken (so if the column depends on another object, or an object depends on the column that the proper behavior happens)
  • more complicated dependencies such as with toast/index/identity etc
  • ensure that the table also works (i can select, update, drop from it normally)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added more test cases. Note that foreign key constraints are not allowed for temp tables, so I can't test that.

@coveralls
Copy link
Collaborator

coveralls commented Jul 18, 2024

Pull Request Test Coverage Report for Build 10047842090

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 26 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.002%) to 73.213%

Files with Coverage Reduction New Missed Lines %
contrib/babelfishpg_tsql/src/hooks.c 1 79.64%
contrib/babelfishpg_tds/src/backend/tds/tdscomm.c 2 74.29%
contrib/babelfishpg_tsql/src/pltsql_bulkcopy.c 23 88.33%
Totals Coverage Status
Change from base Build 9996659743: -0.002%
Covered Lines: 42896
Relevant Lines: 58591

💛 - Coveralls

Signed-off-by: Jason Teng <[email protected]>
@Sairakan Sairakan changed the title Jira babel 4912 Test changes for 'Fix error when trying to drop columns from temp tables.' Jul 19, 2024
Comment on lines -156 to -159
~~ERROR (Code: 3726)~~

~~ERROR (Message: cannot drop column b of table "#temp_table_rollback_t1" because other objects depend on it)~~

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for handling this.
Do we have tests for scenarios where it's supposed to fail with this error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just added an extra test case, that while not reproducing this exact error, produces a similar error due to a dependency.

@2jungkook 2jungkook merged commit 6b45d49 into babelfish-for-postgresql:BABEL_4_X_DEV Jul 23, 2024
43 checks passed
@2jungkook 2jungkook deleted the jira-babel-4912 branch July 23, 2024 17:01
Sairakan added a commit to amazon-aurora/babelfish_extensions that referenced this pull request Jul 24, 2024
sharathbp pushed a commit to amazon-aurora/babelfish_extensions that referenced this pull request Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants