From 30402f66a6107b3fcaa1f8340e9dc29526ccd180 Mon Sep 17 00:00:00 2001 From: Mario Peng <48949600+Pengrongkun@users.noreply.github.com> Date: Mon, 24 Mar 2025 16:54:32 +0800 Subject: [PATCH] fix: interlace=0 with fixed tags memory bad access (#30392) --- source/client/src/clientMain.c | 2 +- source/client/test/stmt2Test.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index 50fadc9593..ee8fe8da30 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -2239,7 +2239,7 @@ int taos_stmt2_bind_param(TAOS_STMT2 *stmt, TAOS_STMT2_BINDV *bindv, int32_t col SVCreateTbReq *pCreateTbReq = NULL; if (bindv->tags && bindv->tags[i]) { code = stmtSetTbTags2(stmt, bindv->tags[i], &pCreateTbReq); - } else if (pStmt->sql.autoCreateTbl || pStmt->bInfo.needParse) { + } else if (pStmt->bInfo.tbNameFlag & IS_FIXED_TAG) { code = stmtCheckTags2(stmt, &pCreateTbReq); } else { pStmt->sql.autoCreateTbl = false; diff --git a/source/client/test/stmt2Test.cpp b/source/client/test/stmt2Test.cpp index f1f449455d..243019d49c 100644 --- a/source/client/test/stmt2Test.cpp +++ b/source/client/test/stmt2Test.cpp @@ -958,6 +958,11 @@ TEST(stmt2Case, stmt2_stb_insert) { "insert into stmt2_testdb_1.? using stmt2_testdb_1.stb (t1,t2)tags(?,?) (ts,b)values(?,?)", 3, 3, 3, true, true); } + // TD-34123 : interlace=0 with fixed tags + { + do_stmt("no-interlcace", taos, &option, "insert into `stmt2_testdb_1`.`stb` (tbname,ts,b,t1,t2) values(?,?,?,?,?)", + 3, 3, 3, false, true); + } // interlace = 0 & use db] do_query(taos, "use stmt2_testdb_1");