Hotfix/sangshuduo/td 3580 taosdump human timeformat (#5680)
* [TD-3580] <fix>: taosdump support human readable time format. * [TD-3580] <fix>: taosdump support human readable time format. fix no-value-given segfault. Co-authored-by: Shuduo Sang <sdsang@taosdata.com>
This commit is contained in:
parent
a13873e1f9
commit
6d31f34f78
|
@ -483,6 +483,7 @@ static int queryDbImpl(TAOS *taos, char *command) {
|
||||||
static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
for (int i = 1; i < argc; i++) {
|
for (int i = 1; i < argc; i++) {
|
||||||
if (strcmp(argv[i], "-E") == 0) {
|
if (strcmp(argv[i], "-E") == 0) {
|
||||||
|
if (argv[i+1]) {
|
||||||
char *tmp = argv[++i];
|
char *tmp = argv[++i];
|
||||||
int64_t tmpEpoch;
|
int64_t tmpEpoch;
|
||||||
if (strchr(tmp, ':') && strchr(tmp, '-')) {
|
if (strchr(tmp, ':') && strchr(tmp, '-')) {
|
||||||
|
@ -498,7 +499,10 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
|
||||||
sprintf(argv[i], "%"PRId64"", tmpEpoch);
|
sprintf(argv[i], "%"PRId64"", tmpEpoch);
|
||||||
debugPrint("%s() LN%d, tmp is: %s, argv[%d]: %s\n",
|
debugPrint("%s() LN%d, tmp is: %s, argv[%d]: %s\n",
|
||||||
__func__, __LINE__, tmp, i, argv[i]);
|
__func__, __LINE__, tmp, i, argv[i]);
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "Input end time error!\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
} else if (strcmp(argv[i], "-g") == 0) {
|
} else if (strcmp(argv[i], "-g") == 0) {
|
||||||
arguments->debug_print = true;
|
arguments->debug_print = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue