Skip to content

merge: from main to 3.0 branch#34720

Merged
guanshengliang merged 21 commits into
3.0from
main
Mar 9, 2026
Merged

merge: from main to 3.0 branch#34720
guanshengliang merged 21 commits into
3.0from
main

Conversation

@guanshengliang
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?

tomchon and others added 21 commits March 5, 2026 18:06
docs(pspace): taosx pspace docs #6653327869
* feat(taosdump): delete the contents related to RESTful

* feat(taosdump): delete parameter parsing related to RESTful

* feat(cli): delete the contents related to RESTful
Add installation instructions for 'screen' package.
test:add installation instructions for screen
Signed-off-by: WANG Xu <feici02@outlook.com>
* feat: add SSH timeout options for remote commands

* refactor: remove timeout from SSH and SCP commands for local execution

* feat: add timeout handling for remote SSH commands
…34680)

* fix: refactor file handling in TDCom class for improved readability

* fix: enhance process cleanup in clean_taos_process to avoid terminating Jenkins agents

* fix: remove redundant safe_rmtree function implementation

* fix: add signal handling for graceful termination of subprocesses in run_win_cases

* fix: declare exit_flag as global in process_pytest_file function

* fix: refactor file handling in TDCom class for improved readability

* fix: refactor file handling in TDCom class for improved readability

* fix: improve code formatting and readability in TDCom class

* fix: update exclusion list for Windows CI compatibility and improve cleanup process

* test: add test_cases.task

* feat: add Windows CI pipeline

* fix: reduce wait time in process_pytest_file function

* fix: update Windows pipeline for Python 3.8 support and improve path handling

* test: delete test task

* fix: enhance pytest command parsing with format validation and error logging
* Initial plan

* Add weekly report GitHub Agentic Workflow

Co-authored-by: feici02 <5568663+feici02@users.noreply.github.com>

* chore: fix review comments and re-compile [skip ci]

Signed-off-by: WANG Xu <feici02@outlook.com>

---------

Signed-off-by: WANG Xu <feici02@outlook.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: feici02 <5568663+feici02@users.noreply.github.com>
Co-authored-by: WANG Xu <feici02@outlook.com>
Copilot AI review requested due to automatic review settings March 9, 2026 08:25
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 integrates a wide array of enhancements and fixes from the main branch into the 3.0 branch, primarily focusing on bolstering Windows platform support, refining privilege management, and optimizing stream processing capabilities. It also includes extensive documentation updates and general stability improvements across the query engine and catalog services. These changes collectively aim to improve the development experience, enhance security, and ensure more reliable data handling within the system.

Highlights

  • Enhanced Windows Build and CI: Significant improvements have been made to the Windows build process, including updated CMake configurations for libcurl, removal of Windows-specific conditional compilation for tcurl, and a refactored Python script for handling Git ref locks. A new Jenkins pipeline for Windows CI has been added, along with a reduced list of ignored test cases, indicating broader test coverage on Windows.
  • Refined Privilege Management: New LOCK ROLE and UNLOCK ROLE privileges have been introduced, and user/role unlock/lock permissions have been adjusted to SYS_ADMIN_CORE_ROLES. Column-level permissions and tag-to-tag comparisons in queries are now handled more robustly, preventing crashes and ensuring correct authorization.
  • Stream Processing and Data Sink Optimizations: Internal comments and logic within the data sink mechanism have been refactored for clarity, including improved explanations for memory and file block management. Scalar expression calculations in stream triggers now utilize data block capacity more efficiently and correctly handle temporary column data.
  • Comprehensive Documentation Updates: New documentation for pSpace data migration/synchronization has been added in both English and Chinese. Installation guides have been updated with the latest TDengine TSDB-OSS version (3.4.0.9) across various platforms. The Python connector connect function description has been clarified, and Docker Hub troubleshooting has been added to the Chinese FAQ.
  • Improved Query Engine and Catalog Stability: More robust error checking and cleanup have been implemented in catalog operations, group cache management, and vnode synchronization. The deprecated -R (RESTful mode) option has been removed from taos-cli and taosdump tools. Additionally, debug logging for paged buffer file operations has been enhanced.

🧠 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
  • cmake/external.cmake
    • Updated ext_curl configuration for Windows, linking crypt32 wldap32 normaliz secur32 bcrypt libraries.
    • Defined CURL_STATICLIB for Windows builds.
    • Refactored libcurl external project setup to be conditional on TD_WINDOWS.
    • Moved add_dependencies for ext_curl outside the conditional block.
  • docs/en/06-advanced/05-data-in/22-pspace.md
    • Added new documentation for pSpace data migration and synchronization.
  • docs/en/14-reference/02-tools/07-taos-cli.md
    • Removed the -R (RESTful mode) option from taos-cli documentation.
    • Corrected minor formatting issues (removed trailing spaces).
  • docs/en/14-reference/05-connector/30-python.md
    • Updated the description for the Python connector's connect function.
  • docs/zh/04-get-started/_03-docker.md
    • Added troubleshooting steps for Docker Hub image pull failures.
  • docs/zh/06-advanced/05-data-in/22-pspace.mdx
    • Added new Chinese documentation for pSpace data migration and synchronization.
  • docs/zh/08-operation/03-install.md
    • Updated TDengine TSDB-OSS package versions from 3.3.8.8 to 3.4.0.9 across various installation methods (tar.gz, deb, rpm, Windows, macOS).
  • docs/zh/14-reference/02-tools/07-taos-cli.md
    • Removed the -R (RESTful mode) option from Chinese taos-cli documentation.
    • Corrected minor formatting issues (removed trailing spaces).
  • docs/zh/14-reference/02-tools/09-taosdump.md
    • Removed the -R (RESTful mode) option from Chinese taosdump documentation.
  • docs/zh/14-reference/05-connector/30-python.mdx
    • Updated the description for the Python connector's connect function in Chinese documentation.
  • docs/zh/14-reference/05-connector/_linux_install.mdx
    • Updated TDengine TSDB-OSS Client version from 3.3.8.8 to 3.4.0.9.
  • docs/zh/14-reference/05-connector/_macos_install.mdx
    • Updated TDengine TSDB-OSS Client version from 3.3.8.8 to 3.4.0.9.
  • docs/zh/14-reference/05-connector/_windows_install.mdx
    • Updated TDengine TSDB-OSS Client version from 3.3.8.8 to 3.4.0.9.
  • docs/zh/27-train-faq/01-faq.md
    • Added a new FAQ entry regarding Docker Hub image pull failures.
  • include/libs/new-stream/dataSink.h
    • Refactored and clarified comments for DataSink structures and functions.
    • Included stdbool.h.
  • include/libs/nodes/querynodes.h
    • Added appendByPrivCond bitfield to SColumnNode flags.
  • include/util/tcurl.h
    • Defined CURL_STATICLIB for Windows.
    • Removed conditional compilation for tcurlSend and closeThreadNotificationConn.
  • include/util/tpriv.h
    • Incremented PRIV_INFO_TABLE_VERSION to 4.
  • packaging/delete_ref_lock.py
    • Refactored the script to use an abstract base class and factory for handling Git ref lock errors.
    • Improved error handling and robustness for deleting Git references and lock files.
  • source/client/src/clientHb.c
    • Changed taosArrayDestroy to tFreeSUserAuthBatchRsp for proper cleanup.
  • source/common/CMakeLists.txt
    • Added DEP_ext_curl(common) for Windows builds.
  • source/common/src/tpriv.c
    • Defined SYS_ADMIN_CORE_ROLES.
    • Updated privileges for PRIV_USER_UNLOCK, PRIV_USER_LOCK, PRIV_ROLE_UNLOCK, and PRIV_ROLE_LOCK.
    • Added PRIV_ROLE_UNLOCK and PRIV_ROLE_LOCK to the privilege information table.
  • source/dnode/mnode/impl/src/mndConsumer.c
    • Ensured mndReleaseUser is called for cleanup in mndRetrieveConsumer.
  • source/dnode/mnode/impl/src/mndDb.c
    • Included keepTimeOffset in the mndDumpDbInfoData output for SHOW DATABASES.
  • source/dnode/vnode/src/vnd/vnodeSync.c
    • Clarified log messages for vnode synchronization pre-close, post-close, and close operations.
  • source/libs/catalog/src/catalog.c
    • Clarified the comment for catalogGetUserAuth regarding shallow copy behavior.
  • source/libs/catalog/src/ctgCache.c
    • Modified ctgEnqueue to optionally track if an operation was successfully enqueued.
    • Updated ctgUpdateUserEnqueue to conditionally free pAuth based on enqueue status, transferring ownership on success.
    • Updated other ctgEnqueue calls to pass NULL for the new enqueued parameter.
  • source/libs/executor/src/groupcacheoperator.c
    • Added error checking and TAOS_CHECK_EXIT macros for improved robustness in resetGroupCacheDownstreamCtx and resetGroupCacheOperState.
  • source/libs/index/src/indexFilter.c
    • Added validation to sifInitOperParams to ensure the right node is a value node for 2-parameter operations.
    • Prevented index filter usage for column-to-column comparisons in sifShouldUseIndexBasedOnType.
  • source/libs/new-stream/src/dataSinkCache.c
    • Updated comment for setNextIteratorFromMem.
  • source/libs/new-stream/src/dataSinkFile.c
    • Updated comments for setNextIteratorFromFile, readFileDataToSlidingWindows, and moveSlidingGrpMemCache.
  • source/libs/new-stream/src/dataSinkMgr.c
    • Corrected a semicolon in initStreamDataSink.
    • Updated comments for initStreamDataCache and destroyStreamDataCache.
  • source/libs/new-stream/src/streamTriggerTask.c
    • Adjusted capacity allocation for result columns in stRealtimeContextCalcExpr and stHistoryContextCalcExpr to use pDataBlock->info.capacity.
    • Introduced a temporary column for scalar calculations to ensure correct data assignment.
  • source/libs/new-stream/src/streamUtil.c
    • Removed Windows-specific conditional compilation for curl/curl.h and streamSendNotifyContent.
  • source/libs/nodes/src/nodesCloneFuncs.c
    • Added flags field to be copied in columnNodeCopy.
  • source/libs/nodes/src/nodesUtilFuncs.c
    • Improved doCollect logic for cloning and storing SNode pointers, and added handling for appendByPrivCond flag.
  • source/libs/parser/inc/sql.y
    • Added PRIV_ROLE_UNLOCK and PRIV_ROLE_LOCK to privilege types.
  • source/libs/parser/src/parAuthenticator.c
    • Set pCol->appendByPrivCond = 1 in rewriteAuthTable.
  • source/libs/parser/src/parInsertSql.c
    • Added cleanup for pPrivCols and pTagCond in setVnodeModifOpStmt.
  • source/libs/parser/src/parTranslater.c
    • Implemented stricter column permission checks in findAndSetRealTableColumn.
    • Modified translateCheckPrivCols to skip columns with appendByPrivCond set.
    • Included tags in columnNum calculation in fillPrivSetRowCols.
  • source/libs/sync/src/syncMain.c
    • Clarified log message in syncNodeClose.
    • Added a warning message if syncNodeStopPingTimer attempts to stop an already stopped timer.
  • source/util/src/tcurl.c
    • Removed Windows-specific conditional compilation.
  • source/util/src/tpagedbuf.c
    • Added detailed debug logging for paged buffer file creation, closing, and clearing, including real file size and statistics.
  • test/README.md
    • Updated formatting for section links and code blocks.
    • Added apt install screen -y to prerequisites.
  • test/cases/15-TagIndices/test_index_tag_basic.py
    • Modified the database name used in longname_idx to db_ts4403.
    • Added do_tag_column_comparison test to verify tag-to-tag comparisons without crashing.
    • Included the new tag-to-tag comparison test in test_index_tag_basic.
  • test/cases/24-Users/test_user_privilege_sysinfo.py
    • Corrected expected behavior for show db.vgroups and show d2.vgroups to expect errors for non-privileged users.
    • Added a specific permission denied check for keep column in information_schema.ins_databases.
  • test/cases/25-Privileges/test_priv_control.py
    • Adjusted assertion for SELECT temperature FROM {db_name}.ct2 to expect zero rows due to row-level authorization.
  • test/cases/25-Privileges/test_priv_rbac.py
    • Imported Consumer from taos.tmq.
    • Added grant lock role,unlock role,lock user,unlock user to u1.
    • Implemented do_check_column_privileges and do_check_topic_privileges tests.
    • Enabled do_check_column_privileges and do_check_topic_privileges in test_priv_basic.
  • test/ci/cases.task
    • Added test_index_tag_basic.py to the CI test list.
    • Modified the entry for test_benchmark_basic.py.
  • test/ci/run.sh
    • Introduced timeout_val, get_timeout_val, get_local_workdir, and save_build_artifacts functions.
    • Enhanced remote SSH commands with timeout and ServerAliveInterval/CountMax.
    • Updated transfer_debug_dirs and run_thread to leverage new SCP and timeout mechanisms, and artifact saving.
  • test/ci/run_win_cases.py
    • Implemented Ctrl+C signal handling for graceful exit.
    • Expanded process keywords for clean_taos_process and added Jenkins agent exclusion.
    • Improved safe_rmtree with increased retries, delay, and Windows-specific sleep.
    • Refactored test execution loop with pre/post-case cleanup, robust error handling, and subprocess timeout management.
  • test/ci/win.pipline
    • Added a new Jenkins pipeline for Windows CI, including environment setup, Git operations, build (with skip option), Python dependency installation, and test execution stages.
  • test/ci/win_ignore_cases
    • Significantly reduced the list of ignored test cases for Windows CI.
  • test/new_test_framework/utils/common.py
    • Minor formatting adjustment in generate_query_result_file.
    • Improved SQL line parsing in execute_query_file.
  • tools/taos-tools/src/taosdump.c
    • Removed the -R (RESTful mode) option from taosdump command-line options and parsing logic.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/weekly-report.lock.yml
    • .github/workflows/weekly-report.md
Activity
  • The pull request is a merge from the main branch to the 3.0 branch, indicating a consolidation of recent developments.
  • The description includes a standard checklist for user manual updates, test cases, and test coverage, which are currently unchecked.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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

Merge from main into the 3.0 branch, bringing in cross-cutting updates across CI (notably Windows), privilege enforcement, stream/index stability fixes, build/linking changes (curl on Windows), and documentation refreshes.

Changes:

  • Update Windows CI execution (new Jenkins pipeline file, revamped Windows case runner, refreshed Windows ignore list).
  • Enhance privilege/permission behavior (lock/unlock role/user privileges, stricter column visibility checks, new/updated privilege tests).
  • Improve runtime stability/behavior in core components (index filter guards, paged buffer cleanup/logging, stream trigger expression evaluation changes) and update build/docs accordingly.

Reviewed changes

Copilot reviewed 58 out of 70 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tools/taos-tools/src/taosdump.c Removes unsupported -R/--restful CLI option handling.
test/new_test_framework/utils/common.py Minor formatting/quoting tweaks in query-file execution helper.
test/ci/win_ignore_cases Reworks Windows exclusion list (notably removes many prior exclusions).
test/ci/win.pipline Adds/defines a Jenkins Windows pipeline script for build + test execution.
test/ci/run_win_cases.py Refactors Windows pytest runner: signal handling, cleanup, timeouts, logging.
test/ci/run.sh Adds timeout propagation for ssh/scp and improves artifact collection + local/remote execution handling.
test/ci/cases.task Adds a TagIndices test, and fixes a benchmark entry format.
test/cases/25-Privileges/test_priv_rbac.py Extends RBAC tests (column privileges + TMQ topic subscribe privilege coverage).
test/cases/25-Privileges/test_priv_control.py Updates expected behavior for combined column/row privilege test.
test/cases/24-Users/test_user_privilege_sysinfo.py Tightens sysinfo privilege expectations (more operations expected to error).
test/cases/15-TagIndices/test_index_tag_basic.py Adds regression test ensuring tag-to-tag comparison doesn’t crash.
test/README.md Documentation formatting and prerequisite updates (e.g., install screen).
source/util/src/tpagedbuf.c Adds debug/stat logging, stronger cleanup/reset behavior, and file truncation on clear.
source/util/src/tcurl.c Removes Windows no-op branch; always builds curl-backed notification connection handling.
source/libs/sync/src/syncMain.c Improves log messages and warns on failed ping-timer stop.
source/libs/parser/src/parTranslater.c Adjusts invisible column handling to return permission errors; refines privilege column checks; includes tags in row-priv column set.
source/libs/parser/src/parInsertSql.c Clears per-statement privilege/tag-condition state to avoid reuse/leaks across calls.
source/libs/parser/src/parAuthenticator.c Marks rewritten auth columns with appendByPrivCond flag.
source/libs/parser/inc/sql.y Adds LOCK ROLE / UNLOCK ROLE privilege grammar.
source/libs/nodes/src/nodesUtilFuncs.c Fixes column collection to hash cloned nodes; updates appendByPrivCond propagation logic.
source/libs/nodes/src/nodesCloneFuncs.c Ensures SColumnNode.flags is copied during cloning.
source/libs/new-stream/src/streamUtil.c Removes Windows-specific stub; stream notify code now always built.
source/libs/new-stream/src/streamTriggerTask.c Refactors trigger expression evaluation and temp-column handling; changes capacity/clearing behavior.
source/libs/new-stream/src/dataSinkMgr.c Fixes function terminator and replaces Chinese comments with English in touched spots.
source/libs/new-stream/src/dataSinkFile.c Replaces Chinese comments with English in touched spots.
source/libs/new-stream/src/dataSinkCache.c Replaces Chinese comments with English in touched spots.
source/libs/index/src/indexFilter.c Adds guards/validation around operator params and skips index use for column-to-column comparisons.
source/libs/executor/src/groupcacheoperator.c Adds error propagation/logging for downstream context reset and hash puts.
source/libs/catalog/src/ctgCache.c Extends enqueue API to report ownership transfer; fixes user-auth enqueue ownership/cleanup semantics.
source/libs/catalog/src/catalog.c Clarifies “shallow copy” caveat in catalogGetUserAuth doc comment.
source/dnode/vnode/src/vnd/vnodeSync.c Improves vnode sync lifecycle log messages.
source/dnode/mnode/impl/src/mndDb.c Populates additional DB info field (keepTimeOffset) in dump output.
source/dnode/mnode/impl/src/mndConsumer.c Fixes missing mndReleaseUser call on exit path.
source/common/src/tpriv.c Adds role lock/unlock privilege metadata and adjusts required roles for lock/unlock user.
source/common/CMakeLists.txt Adds curl dependency linkage for Windows common target.
source/client/src/clientHb.c Fixes cleanup by freeing full SUserAuthBatchRsp instead of only its array.
packaging/delete_ref_lock.py Refactors git ref-lock cleanup into handler/factory structure with retries.
include/util/tpriv.h Bumps PRIV_INFO_TABLE_VERSION for privilege table updates.
include/util/tcurl.h Enables curl headers on Windows (static lib define) and removes prior Windows exclusion.
include/libs/nodes/querynodes.h Adds appendByPrivCond bitfield to SColumnNode.
include/libs/new-stream/dataSink.h Replaces large Chinese design block with shorter English notes; adds includes and comment cleanups.
docs/zh/27-train-faq/01-faq.md Adds FAQ entry about Docker Hub pull failures and mitigation.
docs/zh/14-reference/05-connector/_windows_install.mdx Updates referenced client package version to 3.4.0.9.
docs/zh/14-reference/05-connector/_macos_install.mdx Updates referenced client package version to 3.4.0.9.
docs/zh/14-reference/05-connector/_linux_install.mdx Updates referenced client package version and example tarball name.
docs/zh/14-reference/05-connector/30-python.mdx Clarifies Python connector connect() description.
docs/zh/14-reference/02-tools/09-taosdump.md Removes -R/--restful from taosdump docs.
docs/zh/14-reference/02-tools/07-taos-cli.md Removes -R RESTful mention and trims trailing whitespace.
docs/zh/08-operation/03-install.md Updates install doc versions to 3.4.0.9 and tarball names.
docs/zh/06-advanced/05-data-in/pic/pspace-06.png Adds new pSpace screenshot asset (binary).
docs/zh/06-advanced/05-data-in/22-pspace.mdx Adds Chinese pSpace Explorer “Data In” documentation page.
docs/zh/04-get-started/_03-docker.md Adds link to Docker Hub failure FAQ in troubleshooting section.
docs/en/assets/pspace-06.png Adds new pSpace screenshot asset (binary).
docs/en/assets/pspace-02.png Adds new pSpace screenshot asset (binary).
docs/en/14-reference/05-connector/30-python.md Clarifies Python connector connect() description (English).
docs/en/14-reference/02-tools/09-taosdump.md Removes -R/--restful from taosdump docs (English).
docs/en/14-reference/02-tools/07-taos-cli.md Removes -R RESTful mention and trims trailing whitespace (English).
docs/en/06-advanced/05-data-in/22-pspace.md Adds English pSpace Explorer “Data In” documentation page.
cmake/external.cmake Adds Windows ext_curl build/link settings and ensures build_externals depends on ext_curl across platforms.
.github/workflows/weekly-report.md Adds/updates gh-aw weekly reporting workflow source.
Comments suppressed due to low confidence (1)

cmake/external.cmake:930

  • The ExternalProject_Add(ext_curl ...) configuration uses URL_HASH MD5=... to verify the downloaded curl tarball. Weak algorithm MD5 is used for integrity verification of a third-party build dependency, which is vulnerable to collision attacks and no longer appropriate for supply-chain protection. Please switch URL_HASH to a stronger hash such as SHA-256 (or use an official signature mechanism) for all ext_curl platforms so that tampered archives cannot bypass integrity checks.
    ExternalProject_Add(ext_curl
        URL ${_url}
        URL_HASH MD5=b25588a43556068be05e1624e0e74d41
        PREFIX "${_base}"
        CMAKE_ARGS -DCMAKE_BUILD_TYPE:STRING=${TD_CONFIG_NAME}
        CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:STRING=${_ins}
        CMAKE_ARGS -DCMAKE_INSTALL_LIBDIR:PATH=lib
        CMAKE_ARGS -DBUILD_SHARED_LIBS:BOOL=OFF
        CMAKE_ARGS -DBUILD_TESTING:BOOL=OFF
        CMAKE_ARGS -DBUILD_CURL_EXE:BOOL=OFF
        CMAKE_ARGS -DENABLE_WEBSOCKETS:BOOL=ON
        CMAKE_ARGS -DCURL_USE_SCHANNEL:BOOL=ON
        CMAKE_ARGS -DCURL_USE_OPENSSL:BOOL=OFF
        CMAKE_ARGS -DCURL_ZLIB:BOOL=OFF
        CMAKE_ARGS -DCURL_DISABLE_LDAP:BOOL=ON
        CMAKE_ARGS -DCURL_DISABLE_LDAPS:BOOL=ON
        BUILD_COMMAND
            COMMAND "${CMAKE_COMMAND}" --build . --config "${TD_CONFIG_NAME}"
        INSTALL_COMMAND
            COMMAND "${CMAKE_COMMAND}" --install . --config "${TD_CONFIG_NAME}" --prefix "${_ins}"
        EXCLUDE_FROM_ALL TRUE
        VERBATIM
    )
else()
    string(JOIN " " _c_flags ${_c_flags_list})
    # URL https://github.com/curl/curl/releases/download/curl-8_2_1/curl-8.2.1.tar.gz
    # URL_HASH MD5=b25588a43556068be05e1624e0e74d41
    get_from_local_if_exists("https://github.com/curl/curl/releases/download/curl-8_2_1/curl-8.2.1.tar.gz")
    ExternalProject_Add(ext_curl
        URL ${_url}
        URL_HASH MD5=b25588a43556068be05e1624e0e74d41

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

Comment on lines +439 to +442
if (nParam == 2 && node->pRight != NULL && (nodeType(node->pRight)) != QUERY_NODE_VALUE) {
indexError("right node should be value, node:%p, type:%d", node->pRight, nodeType(node->pRight));
SIF_ERR_RET(TSDB_CODE_QRY_INVALID_INPUT);
}
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

sifInitOperParams now hard-rejects any binary operator whose right operand is not a VALUE node. This conflicts with the later logic that tries to skip index usage for column-to-column comparisons (where right->condValue is NULL), and can turn valid predicates like tag1 = tag2 into TSDB_CODE_QRY_INVALID_INPUT instead of falling back to the non-index path. Consider marking the condition as SFLT_NOT_INDEX (or otherwise bypassing index filter) rather than returning an error when the right node is a column/expression.

Copilot uses AI. Check for mistakes.
Comment on lines 2969 to +2973
int32_t nrows = blockDataGetNumOfRows(pDataBlock);
code = colInfoDataEnsureCapacity(pResCol, nrows, false);
code = colInfoDataEnsureCapacity(pResCol, pDataBlock->info.capacity, false);
QUERY_CHECK_CODE(code, lino, _end);
TAOS_MEMSET(pResCol->nullbitmap, 0, BitmapLen(nrows));
TAOS_MEMSET(pResCol->pData, 0, nrows);
TAOS_MEMSET(pResCol->nullbitmap, 0, BitmapLen(pDataBlock->info.capacity));
TAOS_MEMSET(pResCol->pData, 0, pDataBlock->info.capacity);
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

In the pExpr == NULL || NODE_LIST branch, the code now sizes colInfoDataEnsureCapacity and memset using pDataBlock->info.capacity instead of the actual row count (blockDataGetNumOfRows). If capacity is much larger than nrows, this zero-fills and touches more memory than needed on every call. Consider using nrows for both ensure/clear operations (or only clearing the range [0, nrows)), to avoid a per-block performance regression.

Copilot uses AI. Check for mistakes.
Comment thread test/ci/run_win_cases.py
Comment on lines +162 to +180
# 定义清理函数(失败时抛出异常,终止测试)
def cleanup_environment(phase=""):
"""清理进程和目录,失败则抛出异常终止测试"""
logger.info(f"Cleaning up environment ({phase})...")

# 1. 结束残留进程
clean_taos_process()

# 2. 等待句柄释放
time.sleep(1)

# 3. 删除 sim 目录,失败则终止
if os.path.exists(work_dir):
try:
shutil.rmtree(work_dir)
logger.info(f"Removed {work_dir}")
except Exception as e:
logger.error(f"CRITICAL: Failed to remove {work_dir}: {e}")
raise RuntimeError(f"Cleanup failed: cannot remove work_dir") from e
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

cleanup_environment() deletes work_dir using plain shutil.rmtree(), but Windows often keeps file handles briefly after process termination (which you already note elsewhere) and you have a safe_rmtree() helper with retries. Using shutil.rmtree() here can make pre/post cleanup flaky and abort the entire suite. Consider switching this deletion to safe_rmtree(work_dir) (or an equivalent retry strategy).

Copilot uses AI. Check for mistakes.
Comment on lines +93 to +102
def subscribe_topic(self, user, password, group_id, topic_name):
attr = {
'group.id': group_id,
'td.connect.user': user,
'td.connect.pass': password,
'auto.offset.reset': 'earliest'
}
consumer = Consumer(attr)
consumer.subscribe([topic_name])

Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

subscribe_topic() creates a TMQ Consumer and subscribes, but never closes it. This can leak sockets/threads and interfere with subsequent privilege tests in the same process. Please ensure the consumer is closed/unsubscribed (ideally in a try/finally) once the subscribe check is complete.

Copilot uses AI. Check for mistakes.
Comment on lines +105 to +123
tdSql.connect("root", "taosdata")
tdSql.execute(f"create user u_topic pass '{self.test_pass}'")
tdSql.execute(f"create user u_consumer pass '{self.test_pass}'")
tdSql.execute(f"grant use on database d0 to u_topic")
tdSql.execute(f"grant create topic on database d0 to u_topic")
tdSql.execute(f"grant select on d0.stb0 to u_topic")
tdSql.connect("u_topic", self.test_pass)
time.sleep(5) # wait for privileges to take effect
tdSql.query("select * from d0.stb0")
tdSql.execute(f"create topic topic1 as select * from d0.stb0")
tdSql.error(f"create topic topic2 as select * from d0.stb1", expectErrInfo="Permission denied", fullMatched=False)
self.subscribe_topic("u_topic", self.test_pass, "g1", "topic1")
tdSql.connect("root", "taosdata")
tdSql.execute(f"grant use on database d0 to u_consumer")
tdSql.execute(f"grant subscribe on topic d0.topic1 to u_consumer")
tdSql.connect("u_consumer", self.test_pass)
time.sleep(5) # wait for privileges to take effect
self.subscribe_topic("u_consumer", self.test_pass, "g1", "topic1")

Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

do_check_topic_privileges() relies on fixed time.sleep(5) delays for privilege propagation. This can make the test flaky on slow/loaded CI. Consider replacing the sleeps with a bounded retry loop that attempts the operation until it succeeds (or times out), so the test adapts to real propagation latency.

Copilot uses AI. Check for mistakes.
Comment thread test/ci/win_ignore_cases
Comment on lines 1 to +16
# udf not supported in Windows CI
cases/uncatalog/system-test/0-others/test_udf_test.py
cases/uncatalog/system-test/0-others/test_udf_create.py
cases/uncatalog/system-test/0-others/test_udf_restart_taosd.py
cases/uncatalog/system-test/0-others/test_udf_cfg1.py
cases/uncatalog/system-test/0-others/test_udf_cfg2.py
cases/12-UDFs/test_udf_test.py
cases/12-UDFs/test_udf_create.py
cases/12-UDFs/test_udf_restart_taosd.py
cases/12-UDFs/test_udf_cfg1.py
cases/12-UDFs/test_udf_cfg2.py
cases/uncatalog/system-test/0-others/test_udfpy_main.py
cases/uncatalog/system-test/7-tmq/test_tmqUdf.py
cases/uncatalog/system-test/7-tmq/test_tmqUdf_multCtb_snapshot0.py
cases/uncatalog/system-test/7-tmq/test_tmqUdf_multCtb_snapshot1.py
# Stream not supported in Windows CI
cases/18-StreamProcessing/01-Snode/test_snode_mgmt_basic.py
cases/18-StreamProcessing/01-Snode/test_snode_mgmt_replica3.py
cases/18-StreamProcessing/01-Snode/test_snode_mgmt_replicas.py
cases/18-StreamProcessing/01-Snode/test_snode_params_alter_value.py
cases/18-StreamProcessing/01-Snode/test_snode_params_check_default.py
cases/18-StreamProcessing/01-Snode/test_snode_params_check_maxvalue.py
cases/18-StreamProcessing/01-Snode/test_snode_params_check_minvalue.py
cases/18-StreamProcessing/01-Snode/test_snode_privileges_recalc.py
cases/18-StreamProcessing/01-Snode/test_snode_privileges_stream.py
cases/18-StreamProcessing/01-Snode/test_snode_privileges_systable.py
cases/18-StreamProcessing/01-Snode/test_snode_privileges_twodb.py
cases/18-StreamProcessing/02-Stream/test_stream_check_name.py
cases/18-StreamProcessing/02-Stream/test_stream_long_name.py
cases/18-StreamProcessing/02-Stream/test_stream_no_snode.py
cases/18-StreamProcessing/02-Stream/test_stream_same_name.py
cases/18-StreamProcessing/03-TriggerMode/test_count_new.py
cases/18-StreamProcessing/03-TriggerMode/test_count.py
cases/18-StreamProcessing/03-TriggerMode/test_event_new.py
cases/18-StreamProcessing/03-TriggerMode/test_event.py
cases/18-StreamProcessing/03-TriggerMode/test_fill_history.py
cases/18-StreamProcessing/03-TriggerMode/test_period_1.py
cases/18-StreamProcessing/03-TriggerMode/test_sliding.py
cases/18-StreamProcessing/03-TriggerMode/test_state_new.py
cases/18-StreamProcessing/03-TriggerMode/test_state_disorder_update_new.py
cases/18-StreamProcessing/03-TriggerMode/test_state_window_close.py
cases/18-StreamProcessing/03-TriggerMode/test_state.py
cases/18-StreamProcessing/04-Options/test_abnormal_data_table.py
cases/18-StreamProcessing/04-Options/test_abnormal_data_vtable.py
cases/18-StreamProcessing/04-Options/test_meta_change_table.py
cases/18-StreamProcessing/04-Options/test_meta_change_vtable.py
cases/18-StreamProcessing/04-Options/test_options_abnormal.py
cases/18-StreamProcessing/04-Options/test_options_basic.py
cases/18-StreamProcessing/04-Options/test_options_ns.py
cases/18-StreamProcessing/04-Options/test_options_us.py
cases/18-StreamProcessing/04-Options/test_options_vtable.py
cases/18-StreamProcessing/05-Notify/test_notify.py
cases/18-StreamProcessing/06-ResultSaved/test_result_saved_comprehensive.py
cases/18-StreamProcessing/07-SubQuery/test_subquery_basic.py
cases/18-StreamProcessing/07-SubQuery/test_subquery_count_1.py
cases/18-StreamProcessing/07-SubQuery/test_subquery_count_2.py
cases/18-StreamProcessing/07-SubQuery/test_subquery_event.py
cases/18-StreamProcessing/07-SubQuery/test_subquery_sliding.py
cases/18-StreamProcessing/07-SubQuery/test_subquery_session.py
cases/18-StreamProcessing/07-SubQuery/test_subquery_state.py
cases/18-StreamProcessing/07-SubQuery/test_subquery_usage_restrict.py
cases/18-StreamProcessing/07-SubQuery/test_subquery_vtable_change.py
cases/18-StreamProcessing/08-Recalc/test_recalc_combined_options.py
cases/18-StreamProcessing/08-Recalc/test_recalc_delete_recalc.py
cases/18-StreamProcessing/08-Recalc/test_recalc_expired_time.py
cases/18-StreamProcessing/08-Recalc/test_recalc_ignore_disorder.py
cases/18-StreamProcessing/08-Recalc/test_recalc_manual_basic.py
cases/18-StreamProcessing/08-Recalc/test_recalc_manual_with_options.py
cases/18-StreamProcessing/08-Recalc/test_recalc_watermark.py
cases/18-StreamProcessing/20-UseCase/test_idmp_manager.py
cases/18-StreamProcessing/20-UseCase/test_idmp_meters.py
cases/18-StreamProcessing/20-UseCase/test_idmp_public.py
cases/18-StreamProcessing/20-UseCase/test_idmp_pv.py
cases/18-StreamProcessing/20-UseCase/test_idmp_tobacco.py
cases/18-StreamProcessing/20-UseCase/test_idmp_vehicle.py
cases/18-StreamProcessing/20-UseCase/test_idmp_yuxi.py
cases/18-StreamProcessing/20-UseCase/test_nevados.py
cases/18-StreamProcessing/20-UseCase/test_three_gorges_case4.py
cases/18-StreamProcessing/20-UseCase/test_three_gorges_case5.py
cases/18-StreamProcessing/20-UseCase/test_three_gorges_phase1.py
cases/18-StreamProcessing/20-UseCase/test_three_gorges_second_case1.py
cases/18-StreamProcessing/20-UseCase/test_three_gorges_second_case2.py
cases/18-StreamProcessing/20-UseCase/test_three_gorges_second_case3.py
cases/18-StreamProcessing/20-UseCase/test_three_gorges_second_case4.py
cases/18-StreamProcessing/20-UseCase/test_three_gorges_second_case6.py
cases/18-StreamProcessing/20-UseCase/test_three_gorges_second_case17.py
cases/18-StreamProcessing/20-UseCase/test_three_gorges_second_case18.py
cases/18-StreamProcessing/20-UseCase/test_three_gorges_second_case19.py
cases/18-StreamProcessing/20-UseCase/test_three_gorges_second_case19_bug1.py
cases/18-StreamProcessing/20-UseCase/test_three_gorges_second_case22.py
cases/18-StreamProcessing/20-UseCase/test_yuxi_TS_7152.py
cases/18-StreamProcessing/23-Compatibility/test_compatibility_cross_version.py
cases/18-StreamProcessing/30-OldPyCases/test_oldcase_at_once.py
cases/18-StreamProcessing/30-OldPyCases/test_oldcase_backquote_check.py
cases/18-StreamProcessing/30-OldPyCases/test_oldcase_checkpoint_info.py
cases/18-StreamProcessing/30-OldPyCases/test_oldcase_drop.py
cases/18-StreamProcessing/30-OldPyCases/test_oldcase_empty_identifier.py
cases/18-StreamProcessing/30-OldPyCases/test_oldcase_math_func.py
cases/18-StreamProcessing/30-OldPyCases/test_oldcase_snode_restart_with_checkpoint.py
cases/18-StreamProcessing/30-OldPyCases/test_oldcase_state_window.py
cases/18-StreamProcessing/30-OldPyCases/test_oldcase_stream_basic.py
cases/18-StreamProcessing/30-OldPyCases/test_oldcase_stream_multi_agg.py
cases/18-StreamProcessing/30-OldPyCases/test_oldcase_string_func.py
cases/18-StreamProcessing/30-OldPyCases/test_oldcase_taosdShell.py
cases/18-StreamProcessing/30-OldPyCases/test_oldcase_window_true_for.py
cases/18-StreamProcessing/31-OldTsimCases/test_oldcase_basic1.py
cases/18-StreamProcessing/31-OldTsimCases/test_oldcase_basic2.py
cases/18-StreamProcessing/31-OldTsimCases/test_oldcase_check.py
cases/18-StreamProcessing/31-OldTsimCases/test_oldcase_checkpoint.py
cases/18-StreamProcessing/31-OldTsimCases/test_oldcase_concat.py
cases/18-StreamProcessing/31-OldTsimCases/test_oldcase_continuewindowclose.py
cases/18-StreamProcessing/31-OldTsimCases/test_oldcase_state.py
cases/18-StreamProcessing/31-OldTsimCases/test_oldcase_twa.py
cases/18-StreamProcessing/23-Compatibility/test_compatibility_rolling_upgrade_all.py
cases/18-StreamProcessing/23-Compatibility/test_compatibility_backward_forward.py
cases/18-StreamProcessing/23-Compatibility/test_compatibility_rolling_upgrade.py
cases/uncatalog/system-test/7-tmq/test_tmq_td37436.py
# MQTT bnode not supported in Windows CI
cases/40-DataSubscription/03-MQTT/test_mqtt_smoking.py
cases/40-DataSubscription/03-MQTT/test_mqtt_bnodes.py
cases/40-DataSubscription/03-MQTT/test_mqtt_qos.py
cases/40-DataSubscription/03-MQTT/test_mqtt_special.py
cases/40-DataSubscription/03-MQTT/test_mqtt_rb.py
cases/17-DataSubscription/03-MQTT/test_mqtt_smoking.py
cases/17-DataSubscription/03-MQTT/test_mqtt_bnodes.py
cases/17-DataSubscription/03-MQTT/test_mqtt_qos.py
cases/17-DataSubscription/03-MQTT/test_mqtt_special.py
cases/17-DataSubscription/03-MQTT/test_mqtt_rb.py
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

win_ignore_cases no longer excludes the cases/18-StreamProcessing/... suite, but test/ci/cases.task still schedules a large number of StreamProcessing cases. This will make Windows CI attempt to run stream/snnode tests that are typically unsupported and likely fail. Please restore the StreamProcessing exclusions (or remove those cases from the Windows task list) so Windows CI only runs supported cases.

Copilot uses AI. Check for mistakes.
Comment thread test/ci/run.sh
Comment on lines 165 to +178
if [ -z "${passwords[index]}" ]; then
echo "ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}"
echo "timeout ${cmd_timeout} ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=3 ${usernames[index]}@${hosts[index]}"
else
echo "sshpass -p ${passwords[index]} ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}"
echo "timeout ${cmd_timeout} sshpass -p ${passwords[index]} ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=3 ${usernames[index]}@${hosts[index]}"
fi
}

function get_remote_scp_command() {
local index=$1
if [ -z "${passwords[index]}" ]; then
echo "scp -o StrictHostKeyChecking=no -r ${usernames[index]}@${hosts[index]}"
echo "scp -o StrictHostKeyChecking=no -r"
else
echo "sshpass -p ${passwords[index]} scp -o StrictHostKeyChecking=no -r"
fi
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

get_remote_ssh_command and get_remote_scp_command call ssh/scp with -o StrictHostKeyChecking=no and pass passwords via sshpass -p ${passwords[index]}. Disabling SSH host key verification makes it trivial for a man-in-the-middle on the network to impersonate a test host, and placing passwords on the command line exposes them via process listings or logs. Consider enforcing strict host key checking with a managed known_hosts file and switching to key-based authentication or alternative secret handling that does not embed plaintext passwords in command-line arguments.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request merges a significant number of changes from the main branch to the 3.0 branch. The changes span across build configuration, documentation, core source code, and testing infrastructure. Key improvements include adding support for building with curl on Windows, enhancing privilege management logic, fixing several resource leaks and correctness bugs, and substantially improving the robustness of the CI test scripts. The documentation has also been updated to reflect these changes. After a thorough review, the changes appear to be well-implemented and improve the overall quality and feature set of the codebase. I did not find any issues to report.

Note: Security Review is unavailable for this PR.

@guanshengliang guanshengliang merged commit 1e1c92e into 3.0 Mar 9, 2026
24 of 25 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.