Commit graph

4344 commits

Author SHA1 Message Date
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
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
Kaili Xu
79e9709cc5
fix(rbac): privilege of change passwd[manual-only] (#35284) 2026-05-09 15:46:04 +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
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
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
Kaili Xu
fde63d139e
feat(mac): sod mandatory and mac[manual-only] (#35121) 2026-04-22 20:26:42 +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
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
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
Pan Wei
8456ef3f0a
fix: case when and decimal query crash issues (#34991)
* 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: 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>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-31 15:13:16 +08:00
WANG MINGMING
195b7a8f5a
fix(stream): heap use after free (#34990) 2026-03-30 20:35:48 +08:00
dongming chen
9eb653a33f
feat: restore on one vnode (#34984) 2026-03-30 18:31:43 +08:00
Mario Peng
25a76f0496
enh:stream nodelay create out table (#34954) 2026-03-29 11:22:27 +08:00
Jinqing Kuang
27a537829b
feat(query): support external windows (#34933) 2026-03-29 09:38:08 +08:00
Mario Peng
28a88ebc14
fix: stmt2 memleak (#34932) 2026-03-26 10:16:26 +08:00
Jing Sima
f947ef4713
fix: [6789525493] Fix tsma drop with if exists. (#34858) 2026-03-26 09:56:17 +08:00
guichuan zhang
4c970bbef0
fix(xnode): support granting system privileges to xnode/agent and object privileges to xnode tasks (#34901)
Closes [6658956251](https://project.feishu.cn/taosdata_td/feature/detail/6658956251)
2026-03-25 08:57:26 +08:00
Jinqing Kuang
b9eb340111
feat(stream): implement idle trigger for stream partitions (#34902)
- Add IDLE_TIMEOUT(duration_time) option to STREAM_OPTIONS for
  configuring partition idle detection (valid range: [1s, 10d])
- Add IDLE and RESUME event types to EVENT_TYPE option
- Track per-partition last-receive time using monotonic clock to
  detect idle state transitions (ACTIVE -> IDLE -> ACTIVE)
- Trigger IDLE event once when a partition exceeds idle timeout;
  trigger RESUME event immediately when idle partition receives data
- Provide _tidlestart/_tidleend placeholders for idle/resume
  computation SQL (ns precision; incompatible with _twstart/_twend)
- Add idle/resume fields to notification payload: idleStart,
  idleEnd, idleDurationMs; IDLE and RESUME share the same triggerId
- Add system test: test/cases/18-StreamProcessing/04-Options/
  test_idle_trigger.py covering basic detection, resume, multiple
  partitions, timeout config, placeholder values, event combinations
- Update zh/en SQL reference and advanced-usage docs; add IDLE,
  IDLE_TIMEOUT, RESUME to reserved keywords list (3.3.4.0+)

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 10:14:40 +08:00
Simon Guan
e2e9efd903 Merge branch '3.0' into merge/mainto3.0 2026-03-22 21:23:58 +08:00
Simon Guan
1f130ae0ba Merge branch 'main' into merge/mainto3.0 2026-03-22 21:23:52 +08:00
Yihao Deng
791758985b
enh: add support for CAST and SUBSTR functions on BLOB type (#34886) 2026-03-21 21:16:30 +08:00
Tony Zhang
6f547e0b3e
fix(parser): set agg in unionall to useless error (#34874) 2026-03-21 12:14:41 +08:00
Yihao Deng
43dca0dae9
enh: add reference verification capabilities between virtual tables and source tables, including reference relationship storage, source table change verification, reference relationship query and virtual table availability verification functions (#34740) 2026-03-21 11:49:50 +08:00
WANG MINGMING
7394319536
fix(taosd): add logic in altering table for tmq/stream (#34809) 2026-03-21 11:38:22 +08:00
Zhixiao Bao
d0c6d74502
feat: last cache shard-bits (#34857) 2026-03-20 13:56:20 +08:00
Bomin Zhang
1138439542
feat: batch tag value update (#34564) 2026-03-18 14:19:15 +08:00
Yihao Deng
9d746e0730
fix compile error (#34803) 2026-03-17 13:49:08 +08:00
Yihao Deng
4c94cbe5da
enh: add safefunc (#34436) 2026-03-16 20:27:15 +08:00
Zhixiao Bao
e29fadda2e
feat: support secure delete option. (#34591) 2026-03-16 20:26:22 +08:00
Simon Guan
350e43a19c fix: conflicts 2026-03-16 17:30:27 +08:00
Minglei Jin
49a1c6908a
calc subq to runner (#34457) 2026-03-16 14:10:31 +08:00
Jinqing Kuang
163aa941de
feat(stream): add natural time units support for PERIOD trigger (#34766)
Implement week/month/year units for stream PERIOD trigger with natural
boundary alignment and offset support.

Key changes:
- Parser: Add validation for natural time units (w/n/y) and offset parameter
- Time utilities: Add getDuration() support for week/month/year units
- TriggerTask: Implement window calculation with natural boundary alignment
  - Week: align to Monday 00:00:00
  - Month: align to 1st of month 00:00:00
  - Year: align to Jan 1st 00:00:00
- Add offset support: PERIOD(1w, 1d) shifts window by 1 day
- Unit tests: Parser validation, time utilities, TriggerTask window calculation
- System tests: End-to-end tests for week/month/year units with offset
- Documentation: Update user manual with natural time unit examples

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 15:43:36 +08:00
guichuan zhang
14a743d063
fix(xnode): force show xnode task clause order by id (#34759)
Closes [6856696160](https://project.feishu.cn/taosdata_td/defect/detail/6856696160)
2026-03-12 19:47:23 +08:00
Simon Guan
b8f11c5912 fix: conflicts 2026-03-12 09:41:15 +08:00
Kaili Xu
0435899ec4
enh: support grammar of 3.3[manual-only] (#34743) 2026-03-11 14:13:00 +08:00
Simon Guan
1e1c92e4ae
merge: from main to 3.0 branch #34720 2026-03-09 17:04:21 +08:00
WANG MINGMING
f2bae7e798
enh(tmq): support for vtable (#34587) 2026-03-09 10:49:14 +08:00
Haojun Liao
156da4e68f
feat(TDgpt): support multiple input data columns for anomaly detection. (#34606) 2026-03-06 17:48:39 +08:00
Kaili Xu
45c0826791
fix: privilege, error prompt and memory leak (#34675) 2026-03-06 16:04:33 +08:00
Pan Wei
30c4ea4986
feat: support any/some/all/exists with subqueries (#34632) 2026-03-06 14:45:30 +08:00
Simon Guan
08007692be fix: conflicts 2026-03-04 14:44:07 +08:00
Mario Peng
624607cfa6
fix: stmt vtable query core (#34640) 2026-03-04 14:23:45 +08:00