-
Notifications
You must be signed in to change notification settings - Fork 8
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
base: TDE_REL_17_STABLE
Are you sure you want to change the base?
Conversation
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
|
There was a problem hiding this 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'); |
There was a problem hiding this comment.
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 \ |
There was a problem hiding this comment.
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; | ||
|
||
|
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; | ||
|
||
|
There was a problem hiding this comment.
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.
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