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

[YSQL] YSQL Major Version Upgrade fails for unique constraints on partitioned tables #25061

Open
1 task done
fizaaluthra opened this issue Nov 22, 2024 · 1 comment
Open
1 task done
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue

Comments

@fizaaluthra
Copy link
Member

fizaaluthra commented Nov 22, 2024

Jira Link: DB-14191

Description

diff --git a/src/yb/integration-tests/upgrade-tests/pg15_upgrade-test.cc b/src/yb/integration-tests/upgrade-tests/pg15_upgrade-test.cc
index db47f04602..e690e099c2 100644
--- a/src/yb/integration-tests/upgrade-tests/pg15_upgrade-test.cc
+++ b/src/yb/integration-tests/upgrade-tests/pg15_upgrade-test.cc
@@ -1299,4 +1299,25 @@ TEST_F(Pg15UpgradeSequenceTest, IdentityColumn) {
     ASSERT_NO_FATALS(Add3Rows(conn, kSequencePg11, seq_val_pg11_));
   }
 }
+
+TEST_F(Pg15UpgradeTest, UniqueConstraintsPartitionedTables) {
+  ASSERT_OK(ExecuteStatements(
+  {
+    "CREATE TABLE employees_hash ("
+    "    id INT,"
+    "    age INT,"
+    "    val BIGINT,"
+    "    text_column1 TEXT,"
+    "    uuid_col UUID,"
+    "    PRIMARY KEY (id, age)"
+    ") PARTITION BY RANGE (age);",
+    "CREATE TABLE employees_hash_young PARTITION OF employees_hash"
+    "    FOR VALUES FROM (0) TO (30);",
+    "CREATE TABLE employees_hash_old PARTITION OF employees_hash"
+    "    FOR VALUES FROM (30) TO (100);",
+    "ALTER TABLE employees_hash ADD CONSTRAINT employees_hash_unique_id UNIQUE (id, age);"
+  }));
+  ASSERT_OK(UpgradeClusterToMixedMode());
+  ASSERT_OK(FinalizeUpgradeFromMixedMode());
+}
 }  // namespace yb

Run the test

./yb_build.sh release --cxx-test pg15_upgrade-test --gtest_filter Pg15UpgradeTest.UniqueConstraintsPartitionedTables

Issue Type

kind/bug

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.
@fizaaluthra fizaaluthra added area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage labels Nov 22, 2024
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Nov 22, 2024
@fizaaluthra
Copy link
Member Author

Related to #24260 (general issue with ysql dump)

@fizaaluthra fizaaluthra removed the status/awaiting-triage Issue awaiting triage label Nov 22, 2024
@fizaaluthra fizaaluthra self-assigned this Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

2 participants