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

[Feature] implement MD5() functions #15584

Merged
merged 3 commits into from
Apr 18, 2024
Merged

Conversation

Asolmn
Copy link
Contributor

@Asolmn Asolmn commented Apr 17, 2024

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #15096

What this PR does / why we need it:

add md5() functions
ref: https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html#function_md5

@CLAassistant
Copy link

CLAassistant commented Apr 17, 2024

CLA assistant check
All committers have signed the CLA.

@matrix-meow matrix-meow added the size/M Denotes a PR that changes [100,499] lines label Apr 17, 2024
@mergify mergify bot added the kind/feature label Apr 17, 2024
@matrix-meow
Copy link
Contributor

@Asolmn Thanks for your contributions!

Pull Request Review:

Title: [Feature] implement MD5() functions

Body:

  • The PR is categorized as a Feature.
  • It references and aims to resolve issue [Feature Request]: MD5 and SHA1 #15096 on GitHub.
  • The purpose of this PR is to add MD5() functions to the codebase, with a reference to the MySQL documentation for MD5 functions.

Changes:

  1. func_unary.go:

    • Added crypto/md5 import.
    • Added Md5 function that calculates MD5 hash of input data.
    • Added test cases for the Md5 function.
  2. func_unary_test.go:

    • Added test cases for the Md5 function.
  3. function_id.go:

    • Added MD5 constant to the functionIdRegister map.
  4. list_builtIn.go:

    • Added Md5 function definition to the list of supported functions.
  5. func_md5.result and func_md5.sql:

    • Added test cases and expected results for the Md5 function.

Feedback and Suggestions:

  1. Security Concerns:
    • Avoid Using MD5 for Cryptographic Purposes: MD5 is considered cryptographically broken and should not be used for security-sensitive applications. Consider using more secure hashing algorithms like SHA-256.
    • Input Validation: Ensure proper input validation in

@YANGGMM YANGGMM self-requested a review April 18, 2024 02:56
@mergify mergify bot merged commit b9e33f1 into matrixorigin:main Apr 18, 2024
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature size/M Denotes a PR that changes [100,499] lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants