[TD-2984] <fix>: combine taosdemo and taosdemox. solve windows build issue.
This commit is contained in:
parent
e0711cbef7
commit
d9b8504278
Binary file not shown.
|
@ -25,7 +25,13 @@ IF (TD_LINUX)
|
||||||
ELSEIF (TD_WINDOWS)
|
ELSEIF (TD_WINDOWS)
|
||||||
AUX_SOURCE_DIRECTORY(. SRC)
|
AUX_SOURCE_DIRECTORY(. SRC)
|
||||||
ADD_EXECUTABLE(taosdemo ${SRC})
|
ADD_EXECUTABLE(taosdemo ${SRC})
|
||||||
TARGET_LINK_LIBRARIES(taosdemo taos_static cJson)
|
SET_SOURCE_FILES_PROPERTIES(./taosdemo.c PROPERTIES COMPILE_FLAGS -w)
|
||||||
|
find_library(LIBCURL_A libcurl_a HINTS ${TD_COMMUNITY_DIR}/deps/libcurl/lib/win64)
|
||||||
|
IF (TD_SOMODE_STATIC)
|
||||||
|
TARGET_LINK_LIBRARIES(taosdemo taos_static cJson ${LIBCURL_A})
|
||||||
|
ELSE ()
|
||||||
|
TARGET_LINK_LIBRARIES(taosdemo taos cJson ${LIBCURL_A})
|
||||||
|
ENDIF ()
|
||||||
ELSEIF (TD_DARWIN)
|
ELSEIF (TD_DARWIN)
|
||||||
# missing a few dependencies, such as <argp.h>
|
# missing a few dependencies, such as <argp.h>
|
||||||
# AUX_SOURCE_DIRECTORY(. SRC)
|
# AUX_SOURCE_DIRECTORY(. SRC)
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "cJSON.h"
|
|
||||||
#include <argp.h>
|
#include <argp.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
@ -51,12 +50,14 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
|
|
||||||
#pragma comment ( lib, "libcurl.lib" )
|
#pragma comment ( lib, "libcurl_a.lib" )
|
||||||
#pragma comment ( lib, "ws2_32.lib" )
|
#pragma comment ( lib, "ws2_32.lib" )
|
||||||
#pragma comment ( lib, "winmm.lib" )
|
#pragma comment ( lib, "winmm.lib" )
|
||||||
#pragma comment ( lib, "wldap32.lib" )
|
#pragma comment ( lib, "wldap32.lib" )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "cJSON.h"
|
||||||
|
|
||||||
#include "taos.h"
|
#include "taos.h"
|
||||||
#include "tutil.h"
|
#include "tutil.h"
|
||||||
|
|
||||||
|
@ -2238,7 +2239,7 @@ int readTagFromCsvFileToMem(SSuperTable * superTblInfo) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((readLen = getline(&line, &n, fp)) != -1) {
|
while ((readLen = tgetline(&line, &n, fp)) != -1) {
|
||||||
if (('\r' == line[readLen - 1]) || ('\n' == line[readLen - 1])) {
|
if (('\r' == line[readLen - 1]) || ('\n' == line[readLen - 1])) {
|
||||||
line[--readLen] = 0;
|
line[--readLen] = 0;
|
||||||
}
|
}
|
||||||
|
@ -2292,7 +2293,7 @@ int readSampleFromCsvFileToMem(FILE *fp, SSuperTable* superTblInfo, char* sample
|
||||||
|
|
||||||
memset(sampleBuf, 0, MAX_SAMPLES_ONCE_FROM_FILE* superTblInfo->lenOfOneRow);
|
memset(sampleBuf, 0, MAX_SAMPLES_ONCE_FROM_FILE* superTblInfo->lenOfOneRow);
|
||||||
while (1) {
|
while (1) {
|
||||||
readLen = getline(&line, &n, fp);
|
readLen = tgetline(&line, &n, fp);
|
||||||
if (-1 == readLen) {
|
if (-1 == readLen) {
|
||||||
if(0 != fseek(fp, 0, SEEK_SET)) {
|
if(0 != fseek(fp, 0, SEEK_SET)) {
|
||||||
printf("Failed to fseek file: %s, reason:%s\n", superTblInfo->sampleFile, strerror(errno));
|
printf("Failed to fseek file: %s, reason:%s\n", superTblInfo->sampleFile, strerror(errno));
|
||||||
|
@ -4350,7 +4351,7 @@ int insertTestProcess() {
|
||||||
fprintf(g_fpOfInsertResult, "Spent %.4f seconds to create %d tables with %d thread(s)\n\n", end - start, g_totalChildTables, g_Dbs.threadCount);
|
fprintf(g_fpOfInsertResult, "Spent %.4f seconds to create %d tables with %d thread(s)\n\n", end - start, g_totalChildTables, g_Dbs.threadCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
usleep(1000*1000);
|
taosMsleep(1000);
|
||||||
|
|
||||||
// create sub threads for inserting data
|
// create sub threads for inserting data
|
||||||
//start = getCurrentTime();
|
//start = getCurrentTime();
|
||||||
|
|
Loading…
Reference in New Issue