[td-225] fix bugs in dynamic set tags values during on demand create table

This commit is contained in:
Haojun Liao 2020-06-02 17:09:56 +08:00
parent 7baed33533
commit 9d492a8d93
1 changed files with 5 additions and 1 deletions

View File

@ -925,8 +925,12 @@ static int32_t tscCheckIfCreateTable(char **sqlstr, SSqlObj *pSql) {
for (int32_t i = 0; i < spd.numOfCols; ++i) {
if (!spd.hasVal[i]) { // current tag column do not have any value to insert, set it to null
if (pTagSchema[i].type == TSDB_DATA_TYPE_BINARY || pTagSchema[i].type == TSDB_DATA_TYPE_NCHAR) {
setVardataNull(ptr, pTagSchema[i].type);
} else {
setNull(ptr, pTagSchema[i].type, pTagSchema[i].bytes);
}
}
ptr += pTagSchema[i].bytes;
}