Skip to content

fix(taos-tools): remove custom duplicate macros and uniformly use the macro definitions under the project's include directory#35025

Merged
guanshengliang merged 5 commits intomainfrom
fix/6921496330-1
Apr 7, 2026
Merged

fix(taos-tools): remove custom duplicate macros and uniformly use the macro definitions under the project's include directory#35025
guanshengliang merged 5 commits intomainfrom
fix/6921496330-1

Conversation

@YamingPei
Copy link
Copy Markdown
Contributor

Description

Remove taos-tools's custom duplicate macros and uniformly use the macro definitions under the project's include directory

Issue(s)

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?

Copilot AI review requested due to automatic review settings April 1, 2026 03:44
@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 removes taos-tools’ locally duplicated TDengine macro definitions and updates taos-tools to rely on the project’s canonical headers (plus a tools-specific SQL length macro), while consistently switching internal SQL buffer sizing from TSDB_MAX_ALLOWED_SQL_LEN to TOOLS_MAX_ALLOWED_SQL_LEN.

Changes:

  • Simplifies toolsdef.h by dropping duplicated TSDB macros and including canonical project headers (types.h, taoserror.h, taosdef.h).
  • Replaces SQL buffer allocations/snprintf/fgets sizing across taosdump and benchmark sources to use TOOLS_MAX_ALLOWED_SQL_LEN.
  • Adjusts taos-tools/test and taos-tools/src CMake link definitions related to taos.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tools/taos-tools/test/CMakeLists.txt Updates unit test target link settings and minor formatting.
tools/taos-tools/src/taosdump.c Switches taosdump SQL buffer allocations/snprintf sizing to TOOLS_MAX_ALLOWED_SQL_LEN.
tools/taos-tools/src/CMakeLists.txt Updates taos-tools executable link visibility for taos.
tools/taos-tools/src/benchUtil.c Updates SQL string construction sizing to TOOLS_MAX_ALLOWED_SQL_LEN.
tools/taos-tools/src/benchQuery.c Updates per-thread SQL buffer allocation/reset sizing.
tools/taos-tools/src/benchJsonOpt.c Updates max SQL length config and file read buffers to TOOLS_MAX_ALLOWED_SQL_LEN.
tools/taos-tools/src/benchInsertMix.c Updates various SQL generation snprintf bounds to TOOLS_MAX_ALLOWED_SQL_LEN.
tools/taos-tools/src/benchInsert.c Updates SQL generation buffer sizes and bounds checks to TOOLS_MAX_ALLOWED_SQL_LEN.
tools/taos-tools/src/benchData.c Updates prepared SQL buffer sizes and related snprintf bounds to TOOLS_MAX_ALLOWED_SQL_LEN.
tools/taos-tools/src/benchCommandOpt.c Updates default max_sql_len and query command buffers.
tools/taos-tools/inc/toolsdef.h Removes duplicated TSDB macros; includes canonical headers; introduces TOOLS_MAX_ALLOWED_SQL_LEN.
tools/taos-tools/inc/dumpUtil.h Includes tdef.h to source shared constants from project headers.
tools/taos-tools/inc/bench.h Updates buffer size macros and SQL storage arrays to use TOOLS_MAX_ALLOWED_SQL_LEN.

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

Comment thread tools/taos-tools/src/benchData.c
Comment thread tools/taos-tools/src/benchData.c
Comment thread tools/taos-tools/src/benchInsert.c Outdated
Comment thread tools/taos-tools/src/taosdump.c Outdated
Comment thread tools/taos-tools/test/CMakeLists.txt Outdated
Comment thread tools/taos-tools/src/CMakeLists.txt Outdated
@YamingPei
Copy link
Copy Markdown
Contributor Author

失败case与PR无关
image

@guanshengliang guanshengliang merged commit fe070f0 into main Apr 7, 2026
11 of 12 checks passed
@guanshengliang guanshengliang deleted the fix/6921496330-1 branch April 7, 2026 11:19
wangmm0220 pushed a commit that referenced this pull request Apr 14, 2026
… macro definitions under the project's include directory (#35025)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants