未验证 提交 c910cb0a 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

[TD-10904]<fix>: support Arch Linux compile (#8618)

* [TD-10904]<fix>: support Arch Linux compile

* split big query test case to smaller
上级 00c762cb
...@@ -121,7 +121,7 @@ IF (TD_MIPS_32) ...@@ -121,7 +121,7 @@ IF (TD_MIPS_32)
SET(COMMON_FLAGS "-Wall -Werror -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") SET(COMMON_FLAGS "-Wall -Werror -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
ENDIF () ENDIF ()
IF (TD_APLHINE) IF (TD_ALPINE)
SET(COMMON_FLAGS "${COMMON_FLAGS} -largp") SET(COMMON_FLAGS "${COMMON_FLAGS} -largp")
link_libraries(/usr/lib/libargp.a) link_libraries(/usr/lib/libargp.a)
ADD_DEFINITIONS(-D_ALPINE) ADD_DEFINITIONS(-D_ALPINE)
...@@ -172,7 +172,11 @@ IF (TD_LINUX) ...@@ -172,7 +172,11 @@ IF (TD_LINUX)
ENDIF () ENDIF ()
IF (TD_MEMORY_SANITIZER) IF (TD_MEMORY_SANITIZER)
IF (TD_ARCHLINUX)
SET(DEBUG_FLAGS "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=null -fno-sanitize=alignment -O0 -g3 -DDEBUG")
ELSE ()
SET(DEBUG_FLAGS "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=null -fno-sanitize=alignment -static-libasan -O0 -g3 -DDEBUG") SET(DEBUG_FLAGS "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=null -fno-sanitize=alignment -static-libasan -O0 -g3 -DDEBUG")
ENDIF ()
MESSAGE(STATUS "memory sanitizer detected as true") MESSAGE(STATUS "memory sanitizer detected as true")
ELSE () ELSE ()
SET(DEBUG_FLAGS "-O0 -g3 -DDEBUG") SET(DEBUG_FLAGS "-O0 -g3 -DDEBUG")
......
...@@ -21,7 +21,7 @@ SET(TD_LINUX FALSE) ...@@ -21,7 +21,7 @@ SET(TD_LINUX FALSE)
SET(TD_ARM_32 FALSE) SET(TD_ARM_32 FALSE)
SET(TD_MIPS_64 FALSE) SET(TD_MIPS_64 FALSE)
SET(TD_MIPS_32 FALSE) SET(TD_MIPS_32 FALSE)
SET(TD_APLHINE FALSE) SET(TD_ALPINE FALSE)
SET(TD_NINGSI FALSE) SET(TD_NINGSI FALSE)
SET(TD_NINGSI_60 FALSE) SET(TD_NINGSI_60 FALSE)
SET(TD_NINGSI_80 FALSE) SET(TD_NINGSI_80 FALSE)
...@@ -36,7 +36,7 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux") ...@@ -36,7 +36,7 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# Get OS information and store in variable TD_OS_INFO. # Get OS information and store in variable TD_OS_INFO.
# #
execute_process(COMMAND chmod 777 ${TD_COMMUNITY_DIR}/packaging/tools/get_os.sh) execute_process(COMMAND chmod 777 ${TD_COMMUNITY_DIR}/packaging/tools/get_os.sh)
execute_process(COMMAND ${TD_COMMUNITY_DIR}/packaging/tools/get_os.sh "" OUTPUT_VARIABLE TD_OS_INFO) execute_process(COMMAND sh ${TD_COMMUNITY_DIR}/packaging/tools/get_os.sh "" OUTPUT_VARIABLE TD_OS_INFO)
MESSAGE(STATUS "The current os is " ${TD_OS_INFO}) MESSAGE(STATUS "The current os is " ${TD_OS_INFO})
SET(TD_LINUX TRUE) SET(TD_LINUX TRUE)
...@@ -52,8 +52,13 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux") ...@@ -52,8 +52,13 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
ENDIF () ENDIF ()
IF (${TD_OS_INFO} MATCHES "Alpine") IF (${TD_OS_INFO} MATCHES "Alpine")
SET(TD_APLHINE TRUE) SET(TD_ALPINE TRUE)
MESSAGE(STATUS "The current OS is Alpine, append extra flags") MESSAGE(STATUS "The current OS is Alpine Linux, append extra flags")
ELSEIF (${TD_OS_INFO} MATCHES "Arch")
SET(TD_ARCHLINUX TRUE)
MESSAGE(STATUS "The current OS is Arch Linux")
ELSE ()
MESSAGE(STATUS "Ths distro is " ${TD_OS_INFO})
ENDIF() ENDIF()
ELSEIF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") ELSEIF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
SET(TD_DARWIN TRUE) SET(TD_DARWIN TRUE)
...@@ -155,7 +160,7 @@ ELSEIF (${OSTYPE} MATCHES "Linux") ...@@ -155,7 +160,7 @@ ELSEIF (${OSTYPE} MATCHES "Linux")
MESSAGE(STATUS "input osType: Linux") MESSAGE(STATUS "input osType: Linux")
ELSEIF (${OSTYPE} MATCHES "Alpine") ELSEIF (${OSTYPE} MATCHES "Alpine")
MESSAGE(STATUS "input osType: Alpine") MESSAGE(STATUS "input osType: Alpine")
SET(TD_APLHINE TRUE) SET(TD_ALPINE TRUE)
ELSE () ELSE ()
MESSAGE(STATUS "The user specified osType is unknown: " ${OSTYPE}) MESSAGE(STATUS "The user specified osType is unknown: " ${OSTYPE})
ENDIF () ENDIF ()
...@@ -1512,9 +1512,9 @@ static bool convertStrToNumber(TAOS_SML_KV *pVal, char *str, SSmlLinesInfo* info ...@@ -1512,9 +1512,9 @@ static bool convertStrToNumber(TAOS_SML_KV *pVal, char *str, SSmlLinesInfo* info
errno = 0; errno = 0;
uint8_t type = pVal->type; uint8_t type = pVal->type;
int16_t length = pVal->length; int16_t length = pVal->length;
int64_t val_s; int64_t val_s = 0;
uint64_t val_u; uint64_t val_u = 0;
double val_d; double val_d = 0.0;
strntolower_s(str, str, (int32_t)strlen(str)); strntolower_s(str, str, (int32_t)strlen(str));
if (IS_FLOAT_TYPE(type)) { if (IS_FLOAT_TYPE(type)) {
...@@ -1814,7 +1814,7 @@ static int32_t getTimeStampValue(char *value, uint16_t len, ...@@ -1814,7 +1814,7 @@ static int32_t getTimeStampValue(char *value, uint16_t len,
int32_t convertSmlTimeStamp(TAOS_SML_KV *pVal, char *value, int32_t convertSmlTimeStamp(TAOS_SML_KV *pVal, char *value,
uint16_t len, SSmlLinesInfo* info) { uint16_t len, SSmlLinesInfo* info) {
int32_t ret; int32_t ret;
SMLTimeStampType type; SMLTimeStampType type = SML_TIME_STAMP_NOW;
int64_t tsVal; int64_t tsVal;
ret = isTimeStamp(value, len, &type, info); ret = isTimeStamp(value, len, &type, info);
...@@ -2413,7 +2413,7 @@ static SSqlObj* createSmlQueryObj(TAOS* taos, int32_t affected_rows, int32_t cod ...@@ -2413,7 +2413,7 @@ static SSqlObj* createSmlQueryObj(TAOS* taos, int32_t affected_rows, int32_t cod
TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int protocol, int precision) { TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int protocol, int precision) {
int code = TSDB_CODE_SUCCESS; int code = TSDB_CODE_SUCCESS;
int affected_rows = 0; int affected_rows = 0;
SMLTimeStampType tsType; SMLTimeStampType tsType = SML_TIME_STAMP_NOW;
if (protocol == TSDB_SML_LINE_PROTOCOL) { if (protocol == TSDB_SML_LINE_PROTOCOL) {
code = convertPrecisionType(precision, &tsType); code = convertPrecisionType(precision, &tsType);
......
...@@ -400,7 +400,7 @@ typedef struct SColIndex { ...@@ -400,7 +400,7 @@ typedef struct SColIndex {
int16_t colId; // column id int16_t colId; // column id
int16_t colIndex; // column index in colList if it is a normal column or index in tagColList if a tag int16_t colIndex; // column index in colList if it is a normal column or index in tagColList if a tag
uint16_t flag; // denote if it is a tag or a normal column uint16_t flag; // denote if it is a tag or a normal column
char name[TSDB_COL_NAME_LEN + TSDB_DB_NAME_LEN + 1]; char name[TSDB_COL_NAME_LEN + TSDB_TABLE_NAME_LEN + 1];
} SColIndex; } SColIndex;
typedef struct SColumnFilterInfo { typedef struct SColumnFilterInfo {
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
static char **shellSQLFiles = NULL; static char **shellSQLFiles = NULL;
static int32_t shellSQLFileNum = 0; static int32_t shellSQLFileNum = 0;
static char shellTablesSQLFile[TSDB_FILENAME_LEN] = {0}; static char shellTablesSQLFile[4096] = {0};
typedef struct { typedef struct {
pthread_t threadID; pthread_t threadID;
......
...@@ -10969,7 +10969,7 @@ static void startMultiThreadInsertData(int threads, char* db_name, ...@@ -10969,7 +10969,7 @@ static void startMultiThreadInsertData(int threads, char* db_name,
} }
int64_t ntables = 0; int64_t ntables = 0;
uint64_t tableFrom; uint64_t tableFrom = 0;
if (stbInfo) { if (stbInfo) {
if (stbInfo->iface != SML_IFACE) { if (stbInfo->iface != SML_IFACE) {
......
...@@ -1293,7 +1293,7 @@ static int getTableDes( ...@@ -1293,7 +1293,7 @@ static int getTableDes(
length[0], tbuf, COL_VALUEBUF_LEN-2); length[0], tbuf, COL_VALUEBUF_LEN-2);
sprintf(tableDes->cols[i].value, "%s", tbuf); sprintf(tableDes->cols[i].value, "%s", tbuf);
} else { } else {
tableDes->cols[i].var_value = calloc(1, len * 4); tableDes->cols[i].var_value = calloc(1, nlen * 4);
if (tableDes->cols[i].var_value == NULL) { if (tableDes->cols[i].var_value == NULL) {
errorPrint("%s() LN%d, memory alalocation failed!\n", errorPrint("%s() LN%d, memory alalocation failed!\n",
__func__, __LINE__); __func__, __LINE__);
...@@ -1303,7 +1303,7 @@ static int getTableDes( ...@@ -1303,7 +1303,7 @@ static int getTableDes(
converStringToReadable( converStringToReadable(
(char *)row[TSDB_SHOW_TABLES_NAME_INDEX], (char *)row[TSDB_SHOW_TABLES_NAME_INDEX],
length[0], length[0],
(char *)(tableDes->cols[i].var_value), len); (char *)(tableDes->cols[i].var_value), nlen);
} }
break; break;
case TSDB_DATA_TYPE_TIMESTAMP: case TSDB_DATA_TYPE_TIMESTAMP:
......
...@@ -233,7 +233,7 @@ static int64_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index) ...@@ -233,7 +233,7 @@ static int64_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index)
int32_t once = 0; // last WAL has once ever been processed int32_t once = 0; // last WAL has once ever been processed
int64_t offset = 0; int64_t offset = 0;
uint64_t fversion = 0; uint64_t fversion = 0;
char fname[TSDB_FILENAME_LEN * 2] = {0}; // full path to wal file char fname[TSDB_FILENAME_LEN * 3] = {0}; // full path to wal file
// get full path to wal file // get full path to wal file
snprintf(fname, sizeof(fname), "%s/%s", pNode->path, wname); snprintf(fname, sizeof(fname), "%s/%s", pNode->path, wname);
......
...@@ -229,7 +229,7 @@ int tsdbWriteBlockIdx(SDFile *pHeadf, SArray *pIdxA, void **ppBuf) { ...@@ -229,7 +229,7 @@ int tsdbWriteBlockIdx(SDFile *pHeadf, SArray *pIdxA, void **ppBuf) {
SBlockIdx *pBlkIdx; SBlockIdx *pBlkIdx;
size_t nidx = taosArrayGetSize(pIdxA); size_t nidx = taosArrayGetSize(pIdxA);
int tlen = 0, size; int tlen = 0, size;
int64_t offset; int64_t offset = 0;
if (nidx <= 0) { if (nidx <= 0) {
// All data are deleted // All data are deleted
......
...@@ -1544,7 +1544,7 @@ static void mergeTwoRowFromMem(STsdbQueryHandle* pQueryHandle, int32_t capacity, ...@@ -1544,7 +1544,7 @@ static void mergeTwoRowFromMem(STsdbQueryHandle* pQueryHandle, int32_t capacity,
int16_t offset; int16_t offset;
bool isRow1DataRow = isDataRow(row1); bool isRow1DataRow = isDataRow(row1);
bool isRow2DataRow; bool isRow2DataRow = false;
bool isChosenRowDataRow; bool isChosenRowDataRow;
int32_t chosen_itr; int32_t chosen_itr;
void *value; void *value;
......
...@@ -230,7 +230,7 @@ void taosheapadjust(void *base, int32_t size, int32_t start, int32_t end, const ...@@ -230,7 +230,7 @@ void taosheapadjust(void *base, int32_t size, int32_t start, int32_t end, const
{ {
int32_t parent; int32_t parent;
int32_t child; int32_t child;
char *buf; char *buf = NULL;
if (base && size > 0 && compar) { if (base && size > 0 && compar) {
parent = start; parent = start;
......
...@@ -566,7 +566,7 @@ static int32_t taosPushLogBuffer(SLogBuff *tLogBuff, char *msg, int32_t msgLen) ...@@ -566,7 +566,7 @@ static int32_t taosPushLogBuffer(SLogBuff *tLogBuff, char *msg, int32_t msgLen)
int32_t end = 0; int32_t end = 0;
int32_t remainSize = 0; int32_t remainSize = 0;
static int64_t lostLine = 0; static int64_t lostLine = 0;
char tmpBuf[40] = {0}; char tmpBuf[60] = {0};
int32_t tmpBufLen = 0; int32_t tmpBufLen = 0;
if (tLogBuff == NULL || tLogBuff->stop) return -1; if (tLogBuff == NULL || tLogBuff->stop) return -1;
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
...@@ -135,7 +135,7 @@ typedef struct _script_t { ...@@ -135,7 +135,7 @@ typedef struct _script_t {
int32_t numOfLines; // number of lines in the script int32_t numOfLines; // number of lines in the script
int32_t bgScriptLen; int32_t bgScriptLen;
char fileName[MAX_FILE_NAME_LEN]; // script file name char fileName[MAX_FILE_NAME_LEN]; // script file name
char error[MAX_ERROR_LEN]; char error[TSDB_MAX_BINARY_LEN + 100];
char * optionBuffer; char * optionBuffer;
SCmdLine *lines; // command list SCmdLine *lines; // command list
SVariable variables[MAX_VAR_LEN]; SVariable variables[MAX_VAR_LEN];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册