Merge remote-tracking branch 'origin/master' into hotfix/tmq
This commit is contained in:
commit
ec7fdb87ff
|
@ -45,6 +45,7 @@ int32_t tscNumOfObj = 0; // number of sqlObj in current process.
|
||||||
static void *tscCheckDiskUsageTmr;
|
static void *tscCheckDiskUsageTmr;
|
||||||
void *tscRpcCache; // cache to keep rpc obj
|
void *tscRpcCache; // cache to keep rpc obj
|
||||||
int32_t tscNumOfThreads = 1; // num of rpc threads
|
int32_t tscNumOfThreads = 1; // num of rpc threads
|
||||||
|
char tscLogFileName[12] = "taoslog";
|
||||||
static pthread_mutex_t rpcObjMutex; // mutex to protect open the rpc obj concurrently
|
static pthread_mutex_t rpcObjMutex; // mutex to protect open the rpc obj concurrently
|
||||||
static pthread_once_t tscinit = PTHREAD_ONCE_INIT;
|
static pthread_once_t tscinit = PTHREAD_ONCE_INIT;
|
||||||
static volatile int tscInitRes = 0;
|
static volatile int tscInitRes = 0;
|
||||||
|
@ -132,7 +133,7 @@ void taos_init_imp(void) {
|
||||||
printf("failed to create log dir:%s\n", tsLogDir);
|
printf("failed to create log dir:%s\n", tsLogDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(temp, "%s/taoslog", tsLogDir);
|
sprintf(temp, "%s/%s", tsLogDir, tscLogFileName);
|
||||||
if (taosInitLog(temp, tsNumOfLogLines, 10) < 0) {
|
if (taosInitLog(temp, tsNumOfLogLines, 10) < 0) {
|
||||||
printf("failed to open log file in directory:%s\n", tsLogDir);
|
printf("failed to open log file in directory:%s\n", tsLogDir);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1858,13 +1858,13 @@ int taosDumpTableData(FILE *fp, char *tbname, struct arguments *arguments, TAOS*
|
||||||
converStringToReadable((char *)row[col], length[col], tbuf, COMMAND_SIZE);
|
converStringToReadable((char *)row[col], length[col], tbuf, COMMAND_SIZE);
|
||||||
//pstr = stpcpy(pstr, tbuf);
|
//pstr = stpcpy(pstr, tbuf);
|
||||||
//*(pstr++) = '\'';
|
//*(pstr++) = '\'';
|
||||||
pstr += sprintf(pstr + curr_sqlstr_len, "\'%s\'", tbuf);
|
curr_sqlstr_len += sprintf(pstr + curr_sqlstr_len, "\'%s\'", tbuf);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TSDB_DATA_TYPE_NCHAR: {
|
case TSDB_DATA_TYPE_NCHAR: {
|
||||||
char tbuf[COMMAND_SIZE] = {0};
|
char tbuf[COMMAND_SIZE] = {0};
|
||||||
convertNCharToReadable((char *)row[col], length[col], tbuf, COMMAND_SIZE);
|
convertNCharToReadable((char *)row[col], length[col], tbuf, COMMAND_SIZE);
|
||||||
pstr += sprintf(pstr + curr_sqlstr_len, "\'%s\'", tbuf);
|
curr_sqlstr_len += sprintf(pstr + curr_sqlstr_len, "\'%s\'", tbuf);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TSDB_DATA_TYPE_TIMESTAMP:
|
case TSDB_DATA_TYPE_TIMESTAMP:
|
||||||
|
@ -1897,7 +1897,8 @@ int taosDumpTableData(FILE *fp, char *tbname, struct arguments *arguments, TAOS*
|
||||||
|
|
||||||
total_sqlstr_len += curr_sqlstr_len;
|
total_sqlstr_len += curr_sqlstr_len;
|
||||||
|
|
||||||
if ((count >= arguments->data_batch) || (sql_buf_len - total_sqlstr_len < TSDB_MAX_BYTES_PER_ROW)) {
|
if ((count >= arguments->data_batch)
|
||||||
|
|| (sql_buf_len - total_sqlstr_len < TSDB_MAX_BYTES_PER_ROW)) {
|
||||||
fprintf(fp, ";\n");
|
fprintf(fp, ";\n");
|
||||||
count = 0;
|
count = 0;
|
||||||
} //else {
|
} //else {
|
||||||
|
@ -1905,6 +1906,8 @@ int taosDumpTableData(FILE *fp, char *tbname, struct arguments *arguments, TAOS*
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("total_sqlstr_len: %d\n", total_sqlstr_len);
|
||||||
|
|
||||||
fprintf(fp, "\n");
|
fprintf(fp, "\n");
|
||||||
atomic_add_fetch_64(&totalDumpOutRows, totalRows);
|
atomic_add_fetch_64(&totalDumpOutRows, totalRows);
|
||||||
|
|
||||||
|
|
|
@ -40,10 +40,9 @@ extern "C" {
|
||||||
#define ASSERT(x)
|
#define ASSERT(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef UNUSED
|
#ifndef UNUSED
|
||||||
#undefine UNUSED
|
|
||||||
#endif
|
|
||||||
#define UNUSED(x) ((void)(x))
|
#define UNUSED(x) ((void)(x))
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef UNUSED_FUNC
|
#ifdef UNUSED_FUNC
|
||||||
#undefine UNUSED_FUNC
|
#undefine UNUSED_FUNC
|
||||||
|
|
Loading…
Reference in New Issue