add null pointer check
This commit is contained in:
parent
096fadd75e
commit
76c2993e90
|
@ -1462,6 +1462,11 @@ int taos_stmt_prepare(TAOS_STMT* stmt, const char* sql, unsigned long length) {
|
|||
STMT_RET(TSDB_CODE_TSC_DISCONNECTED);
|
||||
}
|
||||
|
||||
if (sql == NULL) {
|
||||
tscError("sql is NULL");
|
||||
STMT_RET(invalidOperationMsg(tscGetErrorMsgPayload(&pStmt->pSql->cmd), "sql is NULL"));
|
||||
}
|
||||
|
||||
if (pStmt->last != STMT_INIT) {
|
||||
tscError("prepare status error, last:%d", pStmt->last);
|
||||
STMT_RET(invalidOperationMsg(tscGetErrorMsgPayload(&pStmt->pSql->cmd), "prepare status error"));
|
||||
|
|
Loading…
Reference in New Issue