From c181cffe1e00db011b978b67e1daaaf284605cb9 Mon Sep 17 00:00:00 2001 From: "pengrongkun94@qq.com" Date: Wed, 25 Dec 2024 18:32:33 +0800 Subject: [PATCH] fix database not found bug --- source/client/src/clientStmt2.c | 1 + tests/script/api/stmt2-performance.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/client/src/clientStmt2.c b/source/client/src/clientStmt2.c index acd118acc9..d48142811c 100644 --- a/source/client/src/clientStmt2.c +++ b/source/client/src/clientStmt2.c @@ -848,6 +848,7 @@ static int stmtSetDbName2(TAOS_STMT2* stmt, const char* dbName) { STMT_DLOG("start to set dbName: %s", dbName); pStmt->db = taosStrdup(dbName); + (void)strdequote(pStmt->db); STMT_ERR_RET(stmtCreateRequest(pStmt)); // The SQL statement specifies a database name, overriding the previously specified database diff --git a/tests/script/api/stmt2-performance.c b/tests/script/api/stmt2-performance.c index a539affaf1..7ab20d873f 100644 --- a/tests/script/api/stmt2-performance.c +++ b/tests/script/api/stmt2-performance.c @@ -5,8 +5,8 @@ #include #include "taos.h" -int CTB_NUMS = 2; -int ROW_NUMS = 2; +int CTB_NUMS = 1; +int ROW_NUMS = 1; int CYC_NUMS = 2; void do_query(TAOS* taos, const char* sql) { @@ -217,7 +217,7 @@ int main() { exit(1); } - do_stmt(taos, "insert into db.stb(tbname,ts,b,t1,t2) values(?,?,?,?,?)"); + do_stmt(taos, "insert into `db`.`stb` (tbname,ts,b,t1,t2) values(?,?,?,?,?)"); // do_stmt(taos, "insert into db.? using db.stb tags(?,?)values(?,?)"); // do_taosc(taos); taos_close(taos);