fix tag file crash - #34607
fix tag file crash#34607
Conversation
Summary of ChangesHello, 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 resolves a severe crash encountered during queries that compare two tag columns. The solution involves refining the index filtering mechanism to correctly identify and bypass index usage for column-to-column comparisons, thereby ensuring query stability and proper execution. A dedicated test case has been added to confirm the robustness of this fix across different comparison types. 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. Changelog
Activity
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.
Code Review
This pull request aims to fix a crash that occurs when performing a column-to-column comparison on tags, such as WHERE tag1 = tag2. The fix involves adding a check to bypass the index filter for such comparisons, allowing the query to execute through a fallback path. A new test case is also added to verify this fix and prevent future regressions.
The core logic to detect and bypass the index for column-to-column comparisons in sifShouldUseIndexBasedOnType is correct. However, another change in sifInitOperParams seems to incorrectly introduce a hard failure for these same queries, which contradicts the goal of the PR. I've left a specific comment on that part of the code.
There was a problem hiding this comment.
Pull request overview
This pull request addresses a crash in the tag index filter when executing column-to-column comparison queries (e.g., SELECT * FROM st WHERE tag1=tag2). The crash occurred because the index filter code attempted to dereference a NULL condValue pointer when the right operand was a column reference rather than a literal value.
Changes:
- Added a NULL check in
sifShouldUseIndexBasedOnTypeto prevent using index filters for column-to-column comparisons - Added early validation in
sifInitOperParamsto reject non-VALUE right operands - Added comprehensive test case
do_tag_column_comparisonto verify the fix - Commented out the existing
do_ts4403test that appears to have issues
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| source/libs/index/src/indexFilter.c | Added validation and NULL checks to handle column-to-column comparisons |
| test/cases/15-TagIndices/test_index_tag_basic.py | Added test for tag-to-tag comparison and commented out problematic test |
| test/ci/cases.task | Enabled the updated test file in the CI pipeline |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
Issue(s)
Checklist
Please check the items in the checklist if applicable.