fix database not found bug

This commit is contained in:
pengrongkun94@qq.com 2024-12-25 18:32:33 +08:00
parent c6ad69ae5d
commit c181cffe1e
2 changed files with 4 additions and 3 deletions

View File

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

View File

@ -5,8 +5,8 @@
#include <unistd.h>
#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);