Merge pull request #29223 from taosdata/fix/main/TD-33271

fix:[TD-33271] TSDB_TABLE_FNAME_LEN mismatch tbname with '
This commit is contained in:
Shengliang Guan 2024-12-20 13:49:37 +08:00 committed by GitHub
commit b21ab72613
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -101,10 +101,13 @@ int32_t insCreateSName(SName* pName, SToken* pTableName, int32_t acctId, const c
return buildInvalidOperationMsg(pMsgBuf, msg1);
}
} else { // get current DB name first, and then set it into path
if (pTableName->n >= TSDB_TABLE_NAME_LEN) {
char tbname[TSDB_TABLE_FNAME_LEN] = {0};
strncpy(tbname, pTableName->z, pTableName->n);
int32_t tbLen = strdequote(tbname);
if (tbLen >= TSDB_TABLE_NAME_LEN) {
return buildInvalidOperationMsg(pMsgBuf, msg1);
}
if (pTableName->n == 0) {
if (tbLen == 0) {
return generateSyntaxErrMsg(pMsgBuf, TSDB_CODE_PAR_INVALID_IDENTIFIER_NAME, "invalid table name");
}