Skip to content

Conversation

@wangmm0220
Copy link
Contributor

Description

Please briefly describe the code changes in this pull request.

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?

SallyHuo-TAOS and others added 23 commits October 13, 2025 18:19
Refactor test_subscribeDb0.py to improve readability and maintainability.
feat: unique getBuildPath invoke and ignore .git branch name contain …
* fix: test case

* fix: exception desc
* enh(stream): add max wait config for stream batch request

* enh: add runner low latency handling

---------

Co-authored-by: Jinqing Kuang <[email protected]>
* docs: add error code prefix define introduct

* docs: modify english docs

* docs: remove show error code command

* docs: add TDengine TSDB Error Code chapter

* docs: remove tips area

* docs: rename title to TDengine TSDB Business Error

* docs: rename error code struct

* Update docs/en/14-reference/09-error-code.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update docs/zh/14-reference/09-error-code.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* docs: linux error codes url link to chrom

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…#33266)

* chore(jdbc): update jdbc version

* docs: add connection type descriptions in 05-connector

* docs: add WebSocket error codes for C# connector

* docs: add rust connector error codes

* docs: modify conector and error code page

---------

Co-authored-by: t_max <[email protected]>
Co-authored-by: qevolg <[email protected]>
* enh: add wrapper hint

* fix: build error

* fix: build error for bit move

* fix: update copyright to 2025

* fix: accept review advise for ci

* fix: markdown blank remove

* fix: restore 09-error-code.md from main branch
@wangmm0220 wangmm0220 merged commit e53920d into fix/TD-37251-tablelist-main Oct 16, 2025
3 checks passed
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @wangmm0220, 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 broad set of changes from the main development branch, primarily focusing on improving the clarity and maintainability of TDengine's documentation, enhancing the robustness of error handling mechanisms, and refining the core logic for stream processing. It also includes significant updates to the test suite to reflect these changes and ensure continued stability.

Highlights

  • Documentation Refactoring: Centralized and streamlined documentation for connector types, supported platforms, and error codes across multiple language-specific guides (C/C++, Java, Python, Go, Node.js, C#, Rust) by introducing reusable MDX components and a comprehensive error code reference.
  • Enhanced Error Handling and Diagnostics: Improved client driver loading error messages with new wrapper hint functionality, providing more user-friendly diagnostic information. Detailed error code documentation was expanded with structured prefixes and examples.
  • Stream Processing Enhancements: Introduced a new configuration parameter tsStreamBatchRequestWaitMs to control batch request waiting time for stream processing, and added lowLatencyCalc to stream runner deployment messages, allowing for more granular control over stream calculation latency.
  • Internal Code Refinements: Refactored stream execution task reset logic, improved memory management in various components (e.g., nodesCallocImpl, buildCmdMsg), and enhanced error logging in monitoring and database operations.
  • Test Infrastructure Updates: Updated numerous Python test cases to use a centralized utility function tdCom.getBuildPath() for locating build artifacts, re-enabled decimal type test cases, and added a new test for the LAST aggregate function with composite primary keys.
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
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 appears to be a large merge from the main branch, incorporating a wide variety of changes. Key updates include a significant refactoring of the documentation to centralize information on connectors and error codes, which improves maintainability. The REST connector seems to be deprecated in favor of WebSocket, and this is reflected in the documentation. The C/C++ codebase has received several critical bug fixes, addressing memory leaks and improving correctness. A new feature for low-latency stream processing has been added. Additionally, error handling for the client wrapper has been improved with user-friendly hints.

While the changes are largely positive, I've identified a critical security vulnerability in one of the new Java examples due to SQL injection risk. I've also noted a place in the stream processing logic where error handling could be made more transparent with a comment. Please see the specific comments for details.

For future merges, providing a summary of the key changes in the pull request description would be very helpful for reviewers, even for merge commits.

@Update("drop stable if exists meters")
void dropTable();

@Select("select count(*) from meters where tbname = '${tbname}'")
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

Using string interpolation (${...}) in SQL queries is vulnerable to SQL injection. This is a critical security risk because it allows attackers to execute arbitrary SQL commands. You should use parameter binding (#{...}) instead, which lets MyBatis use prepared statements to safely substitute values.

Suggested change
@Select("select count(*) from meters where tbname = '${tbname}'")
@Select("select count(*) from meters where tbname = #{tbname}")

Comment on lines +3163 to +3165
if (code == TSDB_CODE_PAR_TABLE_NOT_EXIST || code == TSDB_CODE_TDB_TABLE_NOT_EXIST){
code = TDB_CODE_SUCCESS;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This logic swallows TABLE_NOT_EXIST errors and treats them as success. While this might be intentional for stream processing to be robust against dropped source tables, it can hide bugs where a table is unexpectedly missing. To improve maintainability and prevent future confusion, please add a comment explaining why this error is being safely ignored.

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.