diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 52a918bbe22589d85fc89cbff8249065129f1618..126aa3bc046b1e1d133a4d5f28a30a51fe537846 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -1536,7 +1536,17 @@ int tscBuildCreateTableMsg(SSqlObj *pSql, SSqlInfo *pInfo) { pMsg += sizeof(SCreateTableMsg); SCreatedTableInfo* p = taosArrayGet(list, i); - strcpy(pCreate->tableName, p->fullname); + //what pCreate->tableName point is a fixed char array which size is 237 + //what p->fullname point is a char* + //before the time we copy p->fullname to pCreate->tableName , we need to check the length of p->fullname + if (strlen(p->fullname) > 237) { + tscError("failed to write this name, which is over 237, just save the first 237 char here"); + strncpy(pCreate->tableName, p->fullname,237); + pCreate->tableName[236]='\0';//I don't know if this line is working properly + }else{ + strcpy(pCreate->tableName, p->fullname); + } + pCreate->igExists = (p->igExist)? 1 : 0; // use dbinfo from table id without modifying current db info