Mryange opened a new pull request, #68487:
URL: https://github.com/apache/doris/pull/68487
[fix](function) Require constant mode arguments for encryption functions
### What problem does this PR solve?
Issue Number: N/A
Problem Summary: AES and SM4 encryption functions resolve the encryption
mode as function-level execution state, but previously accepted a non-constant
mode column. This allowed rows in one function invocation to request different
modes even though optimized execution paths assume one stable mode. Root cause:
the encryption function implementations did not declare the mode argument
through `get_arguments_that_are_always_constant()`. This change marks argument
2 as constant for three-argument signatures and argument 3 for four- and
five-argument signatures, adds BE unit coverage for valid constant combinations
and rejected dynamic modes, and updates the GCM regression case to use literal
modes while verifying that a mode column is rejected.
### Release note
AES_ENCRYPT, AES_DECRYPT, SM4_ENCRYPT, and SM4_DECRYPT now require the mode
argument to be constant.
### Check List (For Author)
- Test
- [ ] Regression test
- [x] Unit Test
- `./run-be-ut.sh --run
--filter='function_string_test.function_aes_encrypt_test:function_string_test.function_aes_decrypt_test:function_string_test.function_encryption_mode_must_be_constant_test:function_string_test.function_sm4_encrypt_test:function_string_test.function_sm4_decrypt_test'
-j 48`
- [ ] Manual test
- [ ] No need to test or manual test
- Behavior changed:
- [ ] No.
- [x] Yes. Encryption mode expressions must now be constant.
- Does this need documentation?
- [x] No.
- [ ] Yes.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]