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 Apr 7, 2026
Conversation
… macro definitions under the project's include directory
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Contributor
There was a problem hiding this comment.
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.hby dropping duplicated TSDB macros and including canonical project headers (types.h,taoserror.h,taosdef.h). - Replaces SQL buffer allocations/
snprintf/fgetssizing across taosdump and benchmark sources to useTOOLS_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.
Contributor
Author
sheyanjie-qq
approved these changes
Apr 7, 2026
guanshengliang
approved these changes
Apr 7, 2026
wangmm0220
pushed a commit
that referenced
this pull request
Apr 14, 2026
… macro definitions under the project's include directory (#35025)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.