Skip to content

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

Open
Simon9997 wants to merge 1 commit intomainfrom
fix/main/6789525493
Open

fix: [6789525493] Fix tsma drop with if exists.#34858
Simon9997 wants to merge 1 commit intomainfrom
fix/main/6789525493

Conversation

@Simon9997
Copy link
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
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
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

PAR_ERR_JRET(getTsma(pCxt, &name, &pTsma));
code = getTsma(pCxt, &name, &pTsma);
if (code == TSDB_CODE_MND_SMA_NOT_EXIST) {
Copy link
Contributor

Choose a reason for hiding this comment

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

这个处理有点简单,能不能请求不要发送到服务端,因为缓存可能不一致,如果这时候服务端有了这个tsma,请求又没有带stream信息,那结果就不一定了

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.

3 participants