[td-3272]<fix>: Change the error message in case of wrong type input during create table.

This commit is contained in:
Haojun Liao 2021-03-13 15:06:50 +08:00
parent 44bacd8758
commit 9e03384a0d
1 changed files with 6 additions and 7 deletions

View File

@ -1021,7 +1021,7 @@ static bool validateTableColumnInfo(SArray* pFieldList, SSqlCmd* pCmd) {
const char* msg1 = "first column must be timestamp"; const char* msg1 = "first column must be timestamp";
const char* msg2 = "row length exceeds max length"; const char* msg2 = "row length exceeds max length";
const char* msg3 = "duplicated column names"; const char* msg3 = "duplicated column names";
const char* msg4 = "invalid data types"; const char* msg4 = "invalid data type";
const char* msg5 = "invalid binary/nchar column length"; const char* msg5 = "invalid binary/nchar column length";
const char* msg6 = "invalid column name"; const char* msg6 = "invalid column name";
@ -1042,14 +1042,13 @@ static bool validateTableColumnInfo(SArray* pFieldList, SSqlCmd* pCmd) {
int32_t nLen = 0; int32_t nLen = 0;
for (int32_t i = 0; i < numOfCols; ++i) { for (int32_t i = 0; i < numOfCols; ++i) {
pField = taosArrayGet(pFieldList, i); pField = taosArrayGet(pFieldList, i);
if (!isValidDataType(pField->type)) {
if (pField->bytes == 0) { invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg4);
invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg5);
return false; return false;
} }
if (!isValidDataType(pField->type)) { if (pField->bytes == 0) {
invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg4); invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg5);
return false; return false;
} }
@ -1242,7 +1241,7 @@ bool validateOneColumn(SSqlCmd* pCmd, TAOS_FIELD* pColField) {
const char* msg1 = "too many columns"; const char* msg1 = "too many columns";
const char* msg2 = "duplicated column names"; const char* msg2 = "duplicated column names";
const char* msg3 = "column length too long"; const char* msg3 = "column length too long";
const char* msg4 = "invalid data types"; const char* msg4 = "invalid data type";
const char* msg5 = "invalid column name"; const char* msg5 = "invalid column name";
const char* msg6 = "invalid column length"; const char* msg6 = "invalid column length";