提交 0535588c 编写于 作者: S shenglian zhou

(insert):fix upper case stable name in taos statement results table can not be found

上级 dd82e9a1
......@@ -1658,7 +1658,7 @@ int taos_stmt_prepare(TAOS_STMT* stmt, const char* sql, unsigned long length) {
pRes->qId = 0;
pRes->numOfRows = 0;
strcpy(pSql->sqlstr, sql);
strntolower(pSql->sqlstr, sql, sqlLen);
tscDebugL("0x%"PRIx64" SQL: %s", pSql->self, pSql->sqlstr);
if (tscIsInsertData(pSql->sqlstr)) {
......@@ -1850,6 +1850,18 @@ int taos_stmt_set_tbname_tags(TAOS_STMT* stmt, const char* name, TAOS_BIND* tags
pCmd->insertParam.pTableBlockHashList = hashList;
}
int32_t sqlLen = (int32_t)strlen(pStmt->pSql->sqlstr);
char* sqlstr = pStmt->pSql->sqlstr;
pStmt->pSql->sqlstr = calloc(1, sqlLen + 1);
if (pSql->sqlstr == NULL) {
tscError("0x%"PRIx64" failed to malloc sql string buffer", pSql->self);
free(tname.z);
STMT_RET(TSDB_CODE_TSC_OUT_OF_MEMORY);
}
strntolower(pStmt->pSql->sqlstr, sqlstr, sqlLen);
free(sqlstr);
code = tsParseSql(pStmt->pSql, true);
if (code == TSDB_CODE_TSC_ACTION_IN_PROGRESS) {
// wait for the callback function to post the semaphore
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册