Commit graph

25690 commits

Author SHA1 Message Date
Simon Guan
a63e8e398d fix: more 2026-05-24 14:31:02 +08:00
WANG Xu
c52c68aa4f
sync: apply remaining build system changes from monorepo (main)
The following commits could not be applied individually due to context
differences between the monorepo and the public repo's build files.
They have been applied as a cumulative diff to ensure the final state
matches the monorepo exactly:

- chore: sync CI files with 3.0 branch to eliminate merge conflicts (rd-public/tsdb!271)
- revert(refactor): dynamically link taosd taosudf taosmqtt against libtaosnative.so to reduce binary size (revert #183) (rd-public/tsdb!282)
- fix(docs): autofix formatting issues across all doc files (rd-public/tsdb!296)
- feat: support -DBUILD_SANITIZER=true on windows for debug build (rd-public/tsdb!291)
- feat(build): build cache, mirror, and sccache optimizations (rd-public/tsdb!326)
- docs: update image for three replica (rd-public/tsdb!324)
- enh: shared storage on windows (rd-public/tsdb!333)
- fix(cmake): convert ext_libs3 from git clone to URL tarball download (rd-public/tsdb!360)
- feat: dual-source deps and comprehensive docs/packaging (cherry-pick to main) (rd-public/tsdb!352)
- fix(cmake): guard DOWNLOAD_EXTRACT_TIMESTAMP for CMake < 3.24 and fix duplicate Cargo.lock entry (rd-public/tsdb!369)
- fix: test case execution failure in pytest.sh (rd-public/tsdb!338)
- enh: built-in compilation support for Python UDF plugins use abi3 (rd-public/tsdb!325)
2026-05-23 14:11:50 +08:00
mariopeng
225fb2a628
enh(stmt2): select support timestamp adaptive preicision (rd-public/tsdb!320) 2026-05-23 14:11:27 +08:00
mljin
1c02910dd3
fix(subq/stream): stream subquery per-event re-evaluation (#6984935627) (rd-public/tsdb!242) 2026-05-23 14:11:27 +08:00
berylbao
9939b11a43
fix(stream): backward-compatible checkpoint format read for pre-5eafbe2 records (rd-public/tsdb!323) 2026-05-23 14:11:26 +08:00
wpan
ddc6982cb8
fix(mnode): resolve taosd deadlock when querying ins_stables with many supertables (rd-public/tsdb!309) 2026-05-23 14:11:26 +08:00
Peng Rongkun
1af59324f4
feat: implement SHOW CREATE STREAM statement (#35158)
Some checks are pending
TDengine Release Build / Run on macos-14 (push) Waiting to run
TDengine Release Build / Run on ubuntu-22.04 (push) Waiting to run
2026-05-16 20:39:39 +08:00
Peng Rongkun
c69724a279
fix: stmt retry when table recreate (#35303) 2026-05-13 09:11:04 +08:00
xinsheng Ren
107e3f7329
enh: timerange pushdown in asof join sql (#35289) 2026-05-12 13:42:45 +08:00
Jinqing Kuang
66692d5044
fix(stream): link event subwindow notifications to parent (#35308)
Some checks are pending
TDengine Release Build / Run on macos-14 (push) Waiting to run
TDengine Release Build / Run on ubuntu-22.04 (push) Waiting to run
2026-05-12 09:18:36 +08:00
Kaili Xu
79e9709cc5
fix(rbac): privilege of change passwd[manual-only] (#35284) 2026-05-09 15:46:04 +08:00
xinsheng Ren
e4de207edc
enh: add perm entropy agg example for udf (#35271) 2026-05-09 09:24:30 +08:00
Jinqing Kuang
09a0b9b638
fix(stream): align external window join indices (#35291) 2026-05-08 10:26:36 +08:00
dongming chen
3d2865584a
fix: [6980850041] avoid vote at learner state (#35258) 2026-05-07 15:16:55 +08:00
Jinqing Kuang
5f8c328226
feat(stream): support external window join subqueries (#35255)
Some checks failed
TDengine Release Build / Run on macos-14 (push) Has been cancelled
TDengine Release Build / Run on ubuntu-22.04 (push) Has been cancelled
2026-05-06 09:53:29 +08:00
WANG MINGMING
8a13299e56
fix(stream): coredump when UDF used in stream WHERE clause (#35250) 2026-04-29 19:51:23 +08:00
Yihao Deng
787ecedbc0
fix: sasl recheck var (#35249)
Co-authored-by: taos-support <kjduan@taosdata.com>
2026-04-28 16:18:30 +08:00
Kaili Xu
cd5ca210d4
enh(mac): test case for alter db/table security level and insert into file[manual-only] (#35245) 2026-04-28 13:12:25 +08:00
Kaili Xu
024df8791f
fix(mac): nwd when insert by taos -s[manual-only] (#35243) 2026-04-28 10:33:16 +08:00
Yihao Deng
bcb215522a
fix(transport): fix SASL null pointer check and build config (#35221) 2026-04-28 10:04:37 +08:00
Kaili Xu
9b303d6777
enh(rbac): column level SELECT mask privilege for data desensitization (#35232) 2026-04-27 15:56:44 +08:00
Kaili Xu
908abd44c8
fix(rbac): access control[manual-only] (#35213) 2026-04-27 14:57:54 +08:00
Alex Duan
487aa134e0
security check: int32 with size_t mixed calc on memcpy parameter (#35218) 2026-04-24 14:52:41 +08:00
Kaili Xu
460361b679
fix(rbac): privilege exemption for db owner by sml (#35209) 2026-04-24 09:52:21 +08:00
Kaili Xu
fde63d139e
feat(mac): sod mandatory and mac[manual-only] (#35121) 2026-04-22 20:26:42 +08:00
Jinqing Kuang
b403f3dfd1
fix(stream): handle notify output for nested diff external window (#35146) 2026-04-21 09:52:04 +08:00
Pan Wei
4bd8dfe637
fix: remove queryBufferSize and cacheLazyLoadThreshold in code and docs (#35176)
* docs: remove queryBufferSize configuration description

* refactor: remove deprecated queryBufferSize and cacheLazyLoadThreshold configs

Both configs were dead code with no actual effect:
- queryBufferSize/tsQueryBufferSize/tsQueryBufferSizeBytes: explicitly
  documented as 'not effective yet'; checkForQueryBuf/releaseQueryBuf
  were defined but never called anywhere
- tsCacheLazyLoadThreshold/cacheLazyLoadThreshold: registered and read
  from config but never referenced in any business logic

Remove variable declarations, definitions, config registrations, config
loading, associated functions, cfg file examples, docs, and test entries.
2026-04-20 17:42:14 +08:00
xinsheng Ren
71d1ad3f11
fix: taos_cleanup (#35079) 2026-04-17 13:38:41 +08:00
Zhixiao Bao
d10efc9d4a
fix: lost data while last wal log file corrupted. (#35138) 2026-04-15 11:20:41 +08:00
Alex Duan
b64bdd2f26
fix: windows pList not locked and add more info to minidump file (#35080) 2026-04-15 09:10:39 +08:00
Alex Duan
29cc3ea913
fix: memory leak while taos_query blocked then terminal signal received (#35064) 2026-04-14 15:01:03 +08:00
Zhixiao Bao
ec53c59a80
fix: process the return value at metrics.c. (#34742) 2026-04-14 13:52:30 +08:00
Pan Wei
6b87d4d439
fix(nodes,scalar): fix EXPLAIN crash and wrong scan range with CASE WHEN expression (#35125) 2026-04-14 13:50:43 +08:00
Pan Wei
f16b351ce7
fix(scalar): prevent crash on NULL varbinary in BETWEEN timestamp expression (#35113) 2026-04-14 10:16:24 +08:00
dongming chen
9d9b96ff03
fix: [6955525222] check applied before quit assinged (#35117) 2026-04-14 10:14:27 +08:00
Jinqing Kuang
f16ff1f470
fix(stream): force read all data for count window (#35108) 2026-04-13 10:04:09 +08:00
xinsheng Ren
034afe9c60
fix: Improve the externalwindow documentation while fixing the bug in the group_concat function (#35078) 2026-04-10 10:21:28 +08:00
WANG MINGMING
0ea4a3bb80
fix(tmq): optimize poll logic & vtable meta error & dead lock in sometimes (#35086) 2026-04-09 16:12:12 +08:00
Bomin Zhang
ce01f7a726
enh: timezone to conform iso8601 - main (#35081) 2026-04-09 15:58:13 +08:00
Jinqing Kuang
3a9e444b41
fix(parser): relax stream tag type modifier checks for stream tags (#35089) 2026-04-09 14:00:07 +08:00
xinsheng Ren
0c7c05d823
fix: colDataKeepFirstNRows reset varmeta.length when all kept rows ar… (#35061) 2026-04-07 19:22:20 +08:00
Mario Peng
aa7cc4ace6
fix(stmt2): correct DECIMAL in KV+blob row build and align bind path with parsed columns (#35010)
* fix: decimal string conversion missing in tRowBuildFromBind2WithBlob

Root cause: tRowBuildFromBind2WithBlob lacked the DECIMAL/DECIMAL64
string-to-binary conversion that exists in tRowBuildFromBind2. When a
table contains both DECIMAL and BLOB columns, the blob code path is
taken (tRowBuildFromBind2WithBlob), which treated DECIMAL as a raw
fixed-size binary type and read 16 bytes directly from the user buffer.
Since the user provides decimal values as text strings (e.g. "21.4300"),
the 15-byte buffer was too small, causing a stack-buffer-overflow.

Fix: Add pSchemaExt parameter to tRowBuildFromBind2WithBlob and add
DECIMAL/DECIMAL64 string-to-binary conversion (decimal128FromStr /
decimal64FromStr) in the fixed-size else branch, mirroring the logic
in tRowBuildFromBind2. Update the call site in parInsertStmt.c to pass
pSchemaExt.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(stmt2): correct DECIMAL in KV+blob row build and align bind path with parsed columns

- tRowBuildKVRowWithBlob / tRowBuildKVRowWithBlob2: copy fixed columns via
  VALUE_GET_DATUM() so DECIMAL uses pData instead of the trivial val field.
- tRowBuildFromBind2WithBlob: mirror tRowBuildFromBind2 — accept parsedCols,
  correct bufArray indexing with numOfFixedValue, TAOS_CHECK_GOTO/lino, and
  free decimal128 heap after each successful row (and on error) to plug leaks.
- parInsertStmt: pass parsedCols into tRowBuildFromBind2WithBlob.
- Add stmt2Case.stmt2_decimal_blob_interleaved in stmt2Test

* fix review

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-07 19:20:47 +08:00
Pan Wei
7240c789a8
fix: cast to json unknown 65535 error and add ut cases (#35073) 2026-04-07 19:16:47 +08:00
Pan Wei
f6c8577ee5
fix:query return error unknown error 65535 issue (#35003)
* fix(scalar): prevent crash when IN expression has invalid type from unhandled node

Root cause: sclGetNodeType() silently set *type = -1 and returned
TSDB_CODE_SUCCESS for unhandled node types. This propagated -1 as
ctx->type.selfType, which was then cast to (uint32_t)-1 = 4294967295
and used as an index into tDataTypes[], causing an out-of-bounds
crash in scalarGenerateSetFromList().

The bug was triggered by semantically odd SQL such as:
  ifnull(b not between vb and a, n in (...)) in (today(), today(), now())
where a boolean result is compared against a timestamp list.

Fixes:
1. sclGetNodeType(): return TSDB_CODE_QRY_INVALID_INPUT for unhandled
   node types instead of silently setting type = -1.
2. sclInitParam(): validate selfType before using it as list element
   type to prevent OOB access in vectorGetConvertType(-1, ...).
3. scalarGenerateSetFromList(): add IS_INVALID_TYPE() guard at entry
   as a defensive check against any future invalid-type paths.

Add regression test: test_scalar_invalid_type.py

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: case when and decimal query crash issues

* fix: CAST to JSON returns Unknown error 65535; mavg/csum/diff with constant arg returns invalid input

- builtins.c: reject CAST(expr AS JSON) in translateCast() with
  TSDB_CODE_CAST_TO_JSON_NOT_ALLOWED instead of silently passing
  validation and failing at execution with TSDB_CODE_FAILED (-1)
- scalar.c: add QUERY_NODE_LEFT_VALUE case in sclGetNodeType() so
  rewritten constant operands (ASSIGN operator left side) resolve
  their type from ctx->type.opResType instead of hitting the
  'unsupported node type' fallthrough (error 0x070F invalid input)
- executorInt.c: create dummy column for the first arg of indefinite-
  rows functions when it is a constant, preventing NULL pData[0]
- test_fun_sca_cast.py: add do_cast_to_json_invalid() covering all
  19 sql-fuzzing repro queries for the CAST-to-JSON bug

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: sclGetNodeType missing cases cause invalid input in query/subquery

Add missing node type cases to sclGetNodeType() that were hit after
ed9de01 changed the fallthrough from silent type=-1 to hard error:

1. QUERY_NODE_LEFT_VALUE (27): return ctx->type.opResType, used when
   the planner rewrites constants into ASSIGN(LEFT_VALUE, VALUE)
   operators for scalarSup pre-processing (e.g. mavg(2.0, 3))

2. QUERY_NODE_REMOTE_VALUE_LIST (61): read resType from SExprNode,
   used when IN subquery RHS is a remote value list node

3. QUERY_NODE_REMOTE_VALUE / QUERY_NODE_REMOTE_ZERO_ROWS /
   QUERY_NODE_REMOTE_ROW: read resType from embedded SValueNode,
   defensive coverage for other remote node types

Also extend doSetInputDataBlock() dummy-column creation to cover
the first constant argument of indefinite-rows functions (mavg, csum,
diff) so pInput->pData[0] is not NULL at function execution time.

Fixes: select distinct t1,'abc',tbname from st1 -> invalid input
Fixes: 1 in (select 1 from st1) -> invalid input
Fixes: mavg(cast(2 as float), 3) -> invalid input

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove QUERY_NODE_LEFT_VALUE case from switch statement

Removed handling for QUERY_NODE_LEFT_VALUE case in scalar.c

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-07 07:55:15 +08:00
Jinqing Kuang
395d03fa24
fix(planner): verify %%tbname to use single-table external window (#35054) 2026-04-06 13:49:52 +08:00
Mario Peng
3cd981d475
fix(stream): tolerate existing output table on submit;fix stream out-column timestamp precision checks (#35044) 2026-04-03 16:01:16 +08:00
Jing Sima
e95e6a47f7
fix: [6930747799] Virtual table support decimal. (#35026) 2026-04-03 15:56:30 +08:00
Pan Wei
21a5fe4dc9
fix(parser,scalar): fix crash in sclfunc.c:4748 caused by window funcs in query without FROM (#35043) 2026-04-02 14:28:39 +08:00
Minglei Jin
3ae0d160dc
fix(query/mem): release msg memory immediately instead of response (#34988) 2026-04-02 14:26:43 +08:00
Bomin Zhang
2f3405ee6b
fix: resolve many tdb bugs (#35006) 2026-04-01 15:42:58 +08:00