fix: interlace=0 with fixed tags memory bad access (#30392)

This commit is contained in:
Mario Peng 2025-03-24 16:54:32 +08:00 committed by GitHub
parent 0000a2edca
commit 30402f66a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -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;

View File

@ -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");