未验证 提交 fc33e105 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #2403 from taosdata/bugfix/td-594

fix bug: return buffer in stack
......@@ -989,13 +989,11 @@ static int32_t tscCheckIfCreateTable(char **sqlstr, SSqlObj *pSql) {
}
int validateTableName(char *tblName, int len, SSQLToken* psTblToken) {
char buf[TSDB_TABLE_ID_LEN] = {0};
tstrncpy(buf, tblName, sizeof(buf));
tstrncpy(psTblToken->z, tblName, TSDB_TABLE_ID_LEN);
psTblToken->n = len;
psTblToken->type = TK_ID;
psTblToken->z = buf;
tSQLGetToken(buf, &psTblToken->type);
tSQLGetToken(psTblToken->z, &psTblToken->type);
return tscValidateName(psTblToken);
}
......@@ -1081,7 +1079,9 @@ int tsParseInsertSql(SSqlObj *pSql) {
}
pCmd->curSql = sToken.z;
char buf[TSDB_TABLE_ID_LEN];
SSQLToken sTblToken;
sTblToken.z = buf;
// Check if the table name available or not
if (validateTableName(sToken.z, sToken.n, &sTblToken) != TSDB_CODE_SUCCESS) {
code = tscInvalidSQLErrMsg(pCmd->payload, "table name invalid", sToken.z);
......
......@@ -141,7 +141,7 @@ class TDTestCase:
tdSql.prepare()
# 8 bytes for timestamp
maxRowSize = 65535 - 8
maxRowSize = self.getLimitFromSourceCode('TSDB_MAX_BYTES_PER_ROW') - 8
maxCols = self.getLimitFromSourceCode('TSDB_MAX_COLUMNS') - 1
# for binary cols, 2 bytes are used for length
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册