提交 943cdd55 编写于 作者: B Bomin Zhang

TD-459: TSDB_KEY_LEN

other changes:
max row length from 65536 to 65535
fix byte order issue in get super table meta
上级 18bbbb31
...@@ -69,8 +69,8 @@ typedef struct { ...@@ -69,8 +69,8 @@ typedef struct {
int version; // version int version; // version
int numOfCols; // Number of columns appended int numOfCols; // Number of columns appended
int tlen; // maximum length of a SDataRow without the header part int tlen; // maximum length of a SDataRow without the header part
int16_t flen; // First part length in a SDataRow after the header part uint16_t flen; // First part length in a SDataRow after the header part
int16_t vlen; // pure value part length, excluded the overhead uint16_t vlen; // pure value part length, excluded the overhead
STColumn columns[]; STColumn columns[];
} STSchema; } STSchema;
...@@ -107,8 +107,8 @@ typedef struct { ...@@ -107,8 +107,8 @@ typedef struct {
int tCols; int tCols;
int nCols; int nCols;
int tlen; int tlen;
int16_t flen; uint16_t flen;
int16_t vlen; uint16_t vlen;
int version; int version;
STColumn *columns; STColumn *columns;
} STSchemaBuilder; } STSchemaBuilder;
...@@ -125,16 +125,16 @@ STSchema *tdGetSchemaFromBuilder(STSchemaBuilder *pBuilder); ...@@ -125,16 +125,16 @@ STSchema *tdGetSchemaFromBuilder(STSchemaBuilder *pBuilder);
* |<--------------------+--------------------------- len ---------------------------------->| * |<--------------------+--------------------------- len ---------------------------------->|
* |<-- Head -->|<--------- flen -------------->| | * |<-- Head -->|<--------- flen -------------->| |
* +---------------------+---------------------------------+---------------------------------+ * +---------------------+---------------------------------+---------------------------------+
* | int16_t | int16_t | | | * | uint16_t | int16_t | | |
* +----------+----------+---------------------------------+---------------------------------+ * +----------+----------+---------------------------------+---------------------------------+
* | len | sversion | First part | Second part | * | len | sversion | First part | Second part |
* +----------+----------+---------------------------------+---------------------------------+ * +----------+----------+---------------------------------+---------------------------------+
*/ */
typedef void *SDataRow; typedef void *SDataRow;
#define TD_DATA_ROW_HEAD_SIZE sizeof(int16_t)*2 #define TD_DATA_ROW_HEAD_SIZE (sizeof(uint16_t) + sizeof(int16_t))
#define dataRowLen(r) (*(int16_t *)(r)) #define dataRowLen(r) (*(uint16_t *)(r))
#define dataRowVersion(r) *(int16_t *)POINTER_SHIFT(r, sizeof(int16_t)) #define dataRowVersion(r) *(int16_t *)POINTER_SHIFT(r, sizeof(int16_t))
#define dataRowTuple(r) POINTER_SHIFT(r, TD_DATA_ROW_HEAD_SIZE) #define dataRowTuple(r) POINTER_SHIFT(r, TD_DATA_ROW_HEAD_SIZE)
#define dataRowKey(r) (*(TSKEY *)(dataRowTuple(r))) #define dataRowKey(r) (*(TSKEY *)(dataRowTuple(r)))
......
...@@ -209,8 +209,8 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size); ...@@ -209,8 +209,8 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size);
#define TSDB_MAX_SQL_SHOW_LEN 256 #define TSDB_MAX_SQL_SHOW_LEN 256
#define TSDB_MAX_ALLOWED_SQL_LEN (8*1024*1024U) // sql length should be less than 8mb #define TSDB_MAX_ALLOWED_SQL_LEN (8*1024*1024U) // sql length should be less than 8mb
#define TSDB_MAX_BYTES_PER_ROW (TSDB_MAX_COLUMNS * 64) #define TSDB_MAX_BYTES_PER_ROW 65535
#define TSDB_MAX_TAGS_LEN 65536 #define TSDB_MAX_TAGS_LEN 65535
#define TSDB_MAX_TAGS 128 #define TSDB_MAX_TAGS 128
#define TSDB_AUTH_LEN 16 #define TSDB_AUTH_LEN 16
......
...@@ -753,8 +753,8 @@ typedef struct { ...@@ -753,8 +753,8 @@ typedef struct {
char user[TSDB_USER_LEN]; char user[TSDB_USER_LEN];
char spi; char spi;
char encrypt; char encrypt;
char secret[TSDB_KEY_LEN + 1]; char secret[TSDB_KEY_LEN];
char ckey[TSDB_KEY_LEN + 1]; char ckey[TSDB_KEY_LEN];
} SDMAuthMsg, SDMAuthRsp; } SDMAuthMsg, SDMAuthRsp;
#pragma pack(pop) #pragma pack(pop)
......
...@@ -204,7 +204,7 @@ typedef struct { ...@@ -204,7 +204,7 @@ typedef struct {
typedef struct SAcctObj { typedef struct SAcctObj {
char user[TSDB_USER_LEN]; char user[TSDB_USER_LEN];
char pass[TSDB_KEY_LEN + 1]; char pass[TSDB_KEY_LEN];
SAcctCfg cfg; SAcctCfg cfg;
int32_t acctId; int32_t acctId;
int64_t createdTime; int64_t createdTime;
......
...@@ -1251,10 +1251,10 @@ static int32_t mnodeGetSuperTableMeta(SMnodeMsg *pMsg) { ...@@ -1251,10 +1251,10 @@ static int32_t mnodeGetSuperTableMeta(SMnodeMsg *pMsg) {
pMeta->contLen = sizeof(STableMetaMsg) + mnodeSetSchemaFromSuperTable(pMeta->schema, pTable); pMeta->contLen = sizeof(STableMetaMsg) + mnodeSetSchemaFromSuperTable(pMeta->schema, pTable);
tstrncpy(pMeta->tableId, pTable->info.tableId, sizeof(pMeta->tableId)); tstrncpy(pMeta->tableId, pTable->info.tableId, sizeof(pMeta->tableId));
pMsg->rpcRsp.len = pMeta->contLen;
pMeta->contLen = htons(pMeta->contLen); pMeta->contLen = htons(pMeta->contLen);
pMsg->rpcRsp.rsp = pMeta; pMsg->rpcRsp.rsp = pMeta;
pMsg->rpcRsp.len = pMeta->contLen;
mTrace("stable:%s, uid:%" PRIu64 " table meta is retrieved", pTable->info.tableId, pTable->uid); mTrace("stable:%s, uid:%" PRIu64 " table meta is retrieved", pTable->info.tableId, pTable->uid);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
......
...@@ -141,7 +141,7 @@ class TDTestCase: ...@@ -141,7 +141,7 @@ class TDTestCase:
tdSql.prepare() tdSql.prepare()
# 8 bytes for timestamp # 8 bytes for timestamp
maxRowSize = 65536 - 8 maxRowSize = 65535 - 8
maxCols = self.getLimitFromSourceCode('TSDB_MAX_COLUMNS') - 1 maxCols = self.getLimitFromSourceCode('TSDB_MAX_COLUMNS') - 1
# for binary cols, 2 bytes are used for length # for binary cols, 2 bytes are used for length
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册