diff --git a/src/kit/taosdemo/src/demoCommandOpt.c b/src/kit/taosdemo/src/demoCommandOpt.c index 59d20710a02e453c63af4262a151fec32e59e7d4..3300c9ab889fc9b4664740f09e30de377fb33494 100644 --- a/src/kit/taosdemo/src/demoCommandOpt.c +++ b/src/kit/taosdemo/src/demoCommandOpt.c @@ -736,10 +736,12 @@ int parse_args(int argc, char *argv[]) { g_args.columnCount = MAX_NUM_COLUMNS; } - for (int col = DEFAULT_DATATYPE_NUM; col < g_args.columnCount; + for (int col = 0; col < g_args.columnCount; col++) { - g_args.dataType[col] = "INT"; - g_args.data_type[col] = TSDB_DATA_TYPE_INT; + if (g_args.data_type[col] == TSDB_DATA_TYPE_NULL) { + g_args.dataType[col] = "INT"; + g_args.data_type[col] = TSDB_DATA_TYPE_INT; + } } for (int col = g_args.columnCount; col < MAX_NUM_COLUMNS; col++) { g_args.dataType[col] = NULL; @@ -830,8 +832,10 @@ int parse_args(int argc, char *argv[]) { g_args.data_type[0] = TSDB_DATA_TYPE_NULL; } g_args.dataType[0] = dataType; - g_args.dataType[1] = NULL; - g_args.data_type[1] = TSDB_DATA_TYPE_NULL; + if (g_args.data_type[1] != TSDB_DATA_TYPE_INT) { + g_args.dataType[1] = NULL; + g_args.data_type[1] = TSDB_DATA_TYPE_NULL; + } } else { // more than one col int index = 0; @@ -899,8 +903,10 @@ int parse_args(int argc, char *argv[]) { token = strsep(&running, ","); if (index >= MAX_NUM_COLUMNS) break; } - g_args.dataType[index] = NULL; - g_args.data_type[index] = TSDB_DATA_TYPE_NULL; + if (g_args.data_type[index] != TSDB_DATA_TYPE_INT) { + g_args.dataType[index] = NULL; + g_args.data_type[index] = TSDB_DATA_TYPE_NULL; + } } } else if ((0 == strncmp(argv[i], "-w", strlen("-w"))) || (0 == diff --git a/tests/pytest/tools/taosdemoAllTest/TD-10539/create_taosdemo.py b/tests/pytest/tools/taosdemoAllTest/TD-10539/create_taosdemo.py index d7926d6e5b5a3db80f3c66df0655266a5c673999..d64bf201f6cd7d9a1ce7870c578e7a80761f3c9c 100644 --- a/tests/pytest/tools/taosdemoAllTest/TD-10539/create_taosdemo.py +++ b/tests/pytest/tools/taosdemoAllTest/TD-10539/create_taosdemo.py @@ -112,7 +112,7 @@ class TDTestCase: tdSql.checkRows(11) tdSql.query("show create table test.`%s1` ; " %self.tsdemo) tdSql.checkData(0, 0, self.tsdemo+str(1)) - tdSql.checkData(0, 1, "create table `%s1` (ts TIMESTAMP,c0 FLOAT,c1 INT,c2 INT,c3 INT,c4 INT,c5 INT,c6 INT,c7 INT,c8 INT,c9 INT)" %self.tsdemo) + tdSql.checkData(0, 1, "create table `%s1` (ts TIMESTAMP,c0 FLOAT,c1 INT,c2 FLOAT,c3 INT,c4 INT,c5 INT,c6 INT,c7 INT,c8 INT,c9 INT)" %self.tsdemo) print("==============drop table\stable") try: