Skip to content

Added SQL testcases for the following Bugs #207

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

Open
wants to merge 1 commit into
base: TDE_REL_17_STABLE
Choose a base branch
from

Conversation

mohitj1988
Copy link

PG-1495 CLUSTER Command Decrypts Encrypted Table in PostgreSQL with TDE Enabled PG-1491 pg_tde_is_encrypted() is broken for partitioned tables

Following new tescases added:
cluster.sql
partition_table.sql

PG-1495 CLUSTER Command Decrypts Encrypted Table in PostgreSQL with TDE Enabled
PG-1491 pg_tde_is_encrypted() is broken for partitioned tables

Following new tescases added:
cluster.sql
partition_table.sql
@it-percona-cla
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Collaborator

@jeltz jeltz left a comment

Choose a reason for hiding this comment

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

@mohitj1988 The reason your tests are failing is because you used to global provider which makes writing tests trickier. The easy solution is the use a database provider.

@@ -0,0 +1,92 @@
CREATE EXTENSION pg_tde;
SELECT pg_tde_add_global_key_provider_file('global_keyring_provider','/tmp/pg_tde_keyring.per');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do not use the global provider unless there is a specific point to it. Otherwise you risk order dependent tests unnecessarily like what happened here..

@@ -23,6 +23,8 @@ relocate \
subtransaction \
tablespace \
vault_v2_test \
cluster \
partition_table \
Copy link
Collaborator

Choose a reason for hiding this comment

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

These should be added in alphabetical order with the caveat mentioned in the comment above, Plus you also need to add the tests to meson.build.


DROP EXTENSION pg_tde CASCADE;


Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove empty lines.

CLUSTER encrypted_table USING idx_date;
SELECT pg_tde_is_encrypted('encrypted_table');

DROP EXTENSION pg_tde CASCADE;
Copy link
Collaborator

Choose a reason for hiding this comment

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

These tests should probably be in create_storage.sql where other similar tests already are.

SELECT pg_tde_is_encrypted('partition_q3_2024');
SELECT pg_tde_is_encrypted('partition_q4_2024');

DROP TABLE partition_q1_2024,partition_q2_2024,partition_q3_2024,partition_q4_2024,partitioned_table;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't it be enough to drop the parent table?

CREATE TABLE partition_q3_2024 PARTITION OF partitioned_table FOR VALUES FROM ('2024-07-01') TO ('2024-10-01') USING tde_heap;
CREATE TABLE partition_q4_2024 PARTITION OF partitioned_table FOR VALUES FROM ('2024-10-01') TO ('2025-01-01') USING heap;


Copy link
Collaborator

Choose a reason for hiding this comment

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

You have an extra empty line here.

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.

3 participants