Skip to content

Make BOOLEAN explicitly unsupported for per-value encryption#196

Merged
avalerio-tkd merged 2 commits into
mainfrom
av_booleans_013
Dec 15, 2025
Merged

Make BOOLEAN explicitly unsupported for per-value encryption#196
avalerio-tkd merged 2 commits into
mainfrom
av_booleans_013

Conversation

@avalerio-tkd

Copy link
Copy Markdown
Collaborator
  • Making BOOLEAN explicitly unsupported for per-value encryption and always defaults to per-block encryption.
  • Updated EncryptionSequencer to check explicitly for BOOLEAN and RLE_DICTIONARY, and updated comments.

…always defaults to per-block encryption.

- Updated EncryptionSequencer to check explicitly for BOOLEAN and RLE_DICTIONARY, and updated comments.

@argmarco-tkd argmarco-tkd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, thanks! - left a few comments, none that need a new review from my side.

// only references to them.
if (format == Format::RLE_DICTIONARY) {
throw DBPSUnsupportedException("Unsupported format: RLE_DICTIONARY is not supported for per-value operations");
throw DBPSUnsupportedException("Unsupported format: RLE_DICTIONARY is not supported for per-value operations "

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice clarification.

Comment thread src/server/encryption_sequencer.cpp Outdated
const bool is_datatype_supported = true;

// Datatype: All datatypes are supported except BOOLEAN.
// BOOLEAN is permanently unsupported for per-value encryption and always defaults to per-block encryption.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

in here, I'd either (a) remove the 'permanently' wording and just leave it as "boolean defaults to per-value' OR (b) add a reason as to why it's permanently unsupported.

I believe (a) is the way to go.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done. Thanks.

bool result = sequencer.ConvertAndEncrypt(boolean_data);
ASSERT_TRUE(result) << "BOOLEAN encryption failed: " << sequencer.error_stage_ << " - " << sequencer.error_message_;

// Verify it used per-block encryption mode

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

typo: "if", I believe.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed the wording.

ASSERT_TRUE(result) << "BOOLEAN encryption failed: " << sequencer.error_stage_ << " - " << sequencer.error_message_;

// Verify it used per-block encryption mode
ASSERT_TRUE(sequencer.encryption_metadata_.count("encrypt_mode_dict_page") > 0);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

assertion makes sense, but maybe just do == 1 ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@avalerio-tkd

Copy link
Copy Markdown
Collaborator Author

Thanks for the review. Merging.

@avalerio-tkd avalerio-tkd merged commit 4c808b2 into main Dec 15, 2025
2 checks passed
@avalerio-tkd avalerio-tkd deleted the av_booleans_013 branch December 15, 2025 19:41
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.

2 participants