From ed134f3d57ef4e3638d1495ddf3f6c61d707b43b Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Tue, 9 Mar 2021 11:05:09 +0000 Subject: [PATCH] [TD-3215] : fix bus error on arm32. --- src/client/inc/tsclient.h | 5 +++++ src/client/src/tscParseInsert.c | 3 ++- src/inc/taosmsg.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/client/inc/tsclient.h b/src/client/inc/tsclient.h index 0bfbf3f946..29624e4db2 100644 --- a/src/client/inc/tsclient.h +++ b/src/client/inc/tsclient.h @@ -232,6 +232,7 @@ typedef struct SQueryInfo { typedef struct { int command; uint8_t msgType; + char reserve1[3]; // fix bus error on arm32 bool autoCreated; // create table if it is not existed during retrieve table meta in mnode union { @@ -244,8 +245,10 @@ typedef struct { char * curSql; // current sql, resume position of sql after parsing paused int8_t parseFinished; + char reserve2[3]; // fix bus error on arm32 int16_t numOfCols; + char reserve3[2]; // fix bus error on arm32 uint32_t allocSize; char * payload; int32_t payloadLen; @@ -255,7 +258,9 @@ typedef struct { int32_t numOfParams; int8_t dataSourceType; // load data from file or not + char reserve4[3]; // fix bus error on arm32 int8_t submitSchema; // submit block is built with table schema + char reserve5[3]; // fix bus error on arm32 STagData tagData; // NOTE: pTagData->data is used as a variant length array SName **pTableNameList; // all involved tableMeta list of current insert sql statement. diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index a5906f5539..d071520b88 100644 --- a/src/client/src/tscParseInsert.c +++ b/src/client/src/tscParseInsert.c @@ -307,7 +307,8 @@ int32_t tsParseOneColumnData(SSchema *pSchema, SStrToken *pToken, char *payload, return tscInvalidSQLErrMsg(msg, "illegal float data", pToken->z); } - *((float *)payload) = (float)dv; +// *((float *)payload) = (float)dv; + SET_FLOAT_VAL(payload, dv); } break; diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index 721b9ca605..4a3181a23b 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -616,6 +616,7 @@ typedef struct { int32_t maxtablesPerVnode; int32_t maxVgroupsPerDb; char arbitrator[TSDB_EP_LEN]; // tsArbitrator + char reserve[2]; // to solve arm32 bus error char timezone[64]; // tsTimezone int64_t checkTime; // 1970-01-01 00:00:00.000 char locale[TSDB_LOCALE_LEN]; // tsLocale -- GitLab