Skip to content

fix: [6789525493] Fix tsma drop with if exists.#34858

Merged
guanshengliang merged 1 commit intomainfrom
fix/main/6789525493
Mar 26, 2026
Merged

fix: [6789525493] Fix tsma drop with if exists.#34858
guanshengliang merged 1 commit intomainfrom
fix/main/6789525493

Conversation

@Simon9997
Copy link
Copy Markdown
Contributor

Description

Issue(s)

  • Close/close/Fix/fix/Resolve/resolve: Issue Link

Checklist

Please check the items in the checklist if applicable.

  • Is the user manual updated?
  • Are the test cases passed and automated?
  • Is there no significant decrease in test coverage?

@Simon9997 Simon9997 requested review from a team, dapan1121 and guanshengliang as code owners March 19, 2026 03:31
Copilot AI review requested due to automatic review settings March 19, 2026 03:31
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to make DROP TSMA IF EXISTS succeed when the target TSMA does not exist (instead of returning sma not exist), and adds a regression test for that behavior.

Changes:

  • Suppress parser error logging for the expected “TSMA not exist” condition when fetching TSMA metadata.
  • Update translateDropTSMA to treat TSDB_CODE_MND_SMA_NOT_EXIST as success when IF EXISTS is specified.
  • Add a regression test that drops a non-existent TSMA with IF EXISTS.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
test/cases/19-TSMAs/test_tsma.py Adds regression coverage for dropping a missing TSMA with IF EXISTS.
source/libs/parser/src/parUtil.c Avoids emitting parser error logs for TSDB_CODE_MND_SMA_NOT_EXIST from TSMA cache lookups.
source/libs/parser/src/parTranslater.c Adjusts TSMA lookup/error handling during drop translation to support IF EXISTS.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@Simon9997 Simon9997 force-pushed the fix/main/6789525493 branch from 226e7ea to fbab8ed Compare March 19, 2026 07:24
@Simon9997 Simon9997 force-pushed the fix/main/6789525493 branch from fbab8ed to d561670 Compare March 23, 2026 00:23
Copilot AI review requested due to automatic review settings March 23, 2026 00:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes DROP TSMA IF EXISTS behavior so that dropping a non-existent TSMA no longer fails, and adds regression coverage to ensure both the error-on-missing (without IF EXISTS) and no-op (with IF EXISTS) semantics behave correctly.

Changes:

  • Update TSMA drop translation to treat “TSMA not exist” as success when IF EXISTS is specified.
  • Extend TSMA test cases to validate repeated drops fail normally, while DROP TSMA IF EXISTS ... succeeds.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
source/libs/parser/src/parTranslater.c Makes translateDropTSMA return success (no cmd message) when TSMA is missing and IF EXISTS was used.
test/cases/19-TSMAs/test_tsma.py Adds assertions for post-drop error behavior and validates DROP TSMA IF EXISTS is a successful no-op.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@dapan1121 dapan1121 left a comment

Choose a reason for hiding this comment

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

LGTM

@guanshengliang guanshengliang merged commit f947ef4 into main Mar 26, 2026
19 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants