fix: 3 bugs related to token and user - #34219
Conversation
Summary of ChangesHello @localvar, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses three distinct bugs to improve user management and parsing capabilities. It rectifies an issue preventing the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Pull request overview
This PR fixes three bugs related to token management and user security settings:
- Enables setting
allow_token_numto 0 to disallow tokens for a user - Corrects the table mapping for
SHOW TOKENSstatement which was incorrectly pointing to the encrypt_status table - Prevents upgraded super users from being locked out after failed login attempts by initializing security fields appropriately
Key Changes
- Modified validation logic to allow
allow_token_num = 0as a valid value - Swapped the table name mappings for SHOW_TOKENS_STMT and SHOW_ENCRYPT_STATUS_STMT
- Updated user initialization for older database versions to set super user security fields to -1 (unlimited) instead of restrictive defaults
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| source/libs/parser/src/parTranslater.c | Swaps the table mappings for SHOW TOKENS and SHOW ENCRYPT STATUS statements to fix incorrect query routing |
| source/libs/parser/src/parAstCreater.c | Removes validation that rejected allow_token_num = 0, allowing users to disable token generation |
| source/dnode/mnode/impl/src/mndUser.c | Adds conditional initialization of security fields for super users during database upgrades, setting them to -1 to prevent lockouts, with separate handling for enterprise and non-enterprise builds |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request introduces fixes for three bugs related to user and token management. The changes correctly handle allow_token_num=0, resolve a parsing issue with show tokens, and prevent superusers from being locked out after an upgrade. The logic for these fixes appears sound. I have one suggestion to improve code maintainability in mndUser.c by removing a duplicated line of code.
aea4d29 to
f47b99c
Compare
f47b99c to
1e973b0
Compare
Description
fix 3 bugs:
allow_token_numto 0show tokensstatements cannot be parsedIssue(s)
Checklist
Please check the items in the checklist if applicable.