diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 452888ace23186591339d95695045490bbe82d45..2f8b20e791ee73e776b46f317676d66f714c0fec 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -1642,6 +1642,10 @@ static bool validateTableColumnInfo(SArray* pFieldList, SSqlCmd* pCmd) { } nLen += pField->bytes; + + if (IS_VAR_DATA_TYPE(pField->type)) { + nLen += sizeof(VarDataOffsetT); + } } // max row length must be less than TSDB_MAX_BYTES_PER_ROW @@ -1848,6 +1852,9 @@ int32_t validateOneColumn(SSqlCmd* pCmd, TAOS_FIELD* pColField) { for (int32_t i = 0; i < numOfCols; ++i) { nLen += pSchema[i].bytes; + if (IS_VAR_DATA_TYPE(pSchema[i].type)) { + nLen += sizeof(VarDataOffsetT); + } } if (pColField->bytes <= 0) { @@ -1855,7 +1862,8 @@ int32_t validateOneColumn(SSqlCmd* pCmd, TAOS_FIELD* pColField) { } // length less than TSDB_MAX_BYTES_PER_ROW - if (nLen + pColField->bytes > TSDB_MAX_BYTES_PER_ROW) { + if (nLen + pColField->bytes + (IS_VAR_DATA_TYPE(pColField->type) ? sizeof(VarDataOffsetT) : 0) > + TSDB_MAX_BYTES_PER_ROW) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg3); } @@ -7691,8 +7699,11 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { uint32_t nLen = 0; for (i = 0; i < numOfColumns; ++i) { nLen += (i != columnIndex.columnIndex) ? pSchema[i].bytes : pItem->bytes; + if(IS_VAR_DATA_TYPE(pSchema[i].type)) { + nLen += sizeof(VarDataOffsetT); + } } - if (nLen >= TSDB_MAX_BYTES_PER_ROW) { + if (nLen > TSDB_MAX_BYTES_PER_ROW) { return invalidOperationMsg(pMsg, msg24); } diff --git a/src/inc/taosdef.h b/src/inc/taosdef.h index b25626c10f4f830ea12b45d7e8b247f2966952af..261407efff57df99e9383d4728ae054a42114444 100644 --- a/src/inc/taosdef.h +++ b/src/inc/taosdef.h @@ -206,13 +206,7 @@ do { \ // this is the length of its string representation, including the terminator zero #define TSDB_ACCT_ID_LEN 11 -#define TSDB_MODE_RICH_COL_ - -#ifdef TSDB_MODE_RICH_COL -#define TSDB_MAX_COLUMNS 4096 -#else -#define TSDB_MAX_COLUMNS 128 -#endif +#define TSDB_MAX_COLUMNS 4096 #define TSDB_MIN_COLUMNS 2 //PRIMARY COLUMN(timestamp) + other columns @@ -232,165 +226,180 @@ do { \ #define TSDB_APPNAME_LEN TSDB_UNI_LEN +#if 1 /** * In some scenarios uint16_t (0~65535) is used to store the row len. * - Firstly, we use 65531(65535 - 4), as the SDataRow/SKVRow contains 4 bits header. * - Secondly, if all cols are VarDataT type except primary key, we need 4 bits to store the offset, thus * the final value is 65531-(4096-1)*4 = 49151. */ -#ifdef TSDB_MODE_RICH_COL -#define TSDB_MAX_BYTES_PER_ROW 49151 -#else -#define TSDB_MAX_BYTES_PER_ROW 65023 // 65531-(128-1)*4=65023 +#define TSDB_MAX_BYTES_PER_ROW 65527 +// 49151 +// 65527 +#endif + + /** + * In some scenarios uint16_t (0~65535) is used to store the row len. + * - Firstly, we use 65531(65535 - 4), as the SDataRow contains 4 bits header. + * - Secondly, if all cols are VarDataT type except primary key, we need 4 bits to store the offset, thus + * the final value is [65531 - (4096-1)*4 = 49151, 65531 - (2-1)*4 = 65527] + * - + */ + // [49151, min(65527, RPC_MAX_UDP_SIZE)] + +#if 0 +#define TSDB_MAX_BYTES_PER_ROW_BY_COL(c) (65535 - (c) << 2) // 65531 - (col-1)*4 #endif -#define TSDB_MAX_TAGS_LEN 16384 -#define TSDB_MAX_JSON_TAGS_LEN (4096*TSDB_NCHAR_SIZE + 2 + 1) // 2->var_header_len 1->type -#define TSDB_MAX_TAGS 128 -#define TSDB_MAX_TAG_CONDITIONS 1024 -#define TSDB_MAX_JSON_KEY_LEN 256 +#define TSDB_MAX_TAGS_LEN 16384 +#define TSDB_MAX_JSON_TAGS_LEN (4096 * TSDB_NCHAR_SIZE + 2 + 1) // 2->var_header_len 1->type +#define TSDB_MAX_TAGS 128 +#define TSDB_MAX_TAG_CONDITIONS 1024 +#define TSDB_MAX_JSON_KEY_LEN 256 #define TSDB_MAX_JSON_KEY_MD5_LEN 16 -#define TSDB_AUTH_LEN 16 -#define TSDB_KEY_LEN 16 -#define TSDB_VERSION_LEN 12 -#define TSDB_LOCALE_LEN 64 -#define TSDB_TIMEZONE_LEN 96 -#define TSDB_LABEL_LEN 8 - -#define TSDB_CLUSTER_ID_LEN 40 -#define TSDB_FQDN_LEN 128 -#define TSDB_EP_LEN (TSDB_FQDN_LEN+6) -#define TSDB_IPv4ADDR_LEN 16 -#define TSDB_FILENAME_LEN 128 -#define TSDB_SHOW_SQL_LEN 512 -#define TSDB_SHOW_SUBQUERY_LEN 1000 -#define TSDB_SLOW_QUERY_SQL_LEN 512 - -#define TSDB_STEP_NAME_LEN 32 -#define TSDB_STEP_DESC_LEN 128 - -#define TSDB_DB_TYPE_DEFAULT 0 -#define TSDB_DB_TYPE_TOPIC 1 - -#define TSDB_DEFAULT_PKT_SIZE 65480 //same as RPC_MAX_UDP_SIZE - -#define TSDB_PAYLOAD_SIZE TSDB_DEFAULT_PKT_SIZE -#define TSDB_DEFAULT_PAYLOAD_SIZE 5120 // default payload size, greater than PATH_MAX value -#define TSDB_EXTRA_PAYLOAD_SIZE 128 // extra bytes for auth -#define TSDB_CQ_SQL_SIZE 1024 -#define TSDB_MIN_VNODES 64 -#define TSDB_MAX_VNODES 2048 -#define TSDB_MIN_VNODES_PER_DB 2 -#define TSDB_MAX_VNODES_PER_DB 64 - -#define TSDB_DNODE_ROLE_ANY 0 -#define TSDB_DNODE_ROLE_MGMT 1 -#define TSDB_DNODE_ROLE_VNODE 2 - -#define TSDB_MAX_REPLICA 5 - -#define TSDB_TBNAME_COLUMN_INDEX (-1) -#define TSDB_TSWIN_START_COLUMN_INDEX (-2) -#define TSDB_TSWIN_STOP_COLUMN_INDEX (-3) -#define TSDB_TSWIN_DURATION_COLUMN_INDEX (-4) -#define TSDB_QUERY_START_COLUMN_INDEX (-5) -#define TSDB_QUERY_STOP_COLUMN_INDEX (-6) -#define TSDB_QUERY_DURATION_COLUMN_INDEX (-7) -#define TSDB_MIN_VALID_COLUMN_INDEX (-7) - -#define TSDB_COL_IS_TSWIN_COL(_i) ((_i) <= TSDB_TSWIN_START_COLUMN_INDEX && (_i) >= TSDB_QUERY_DURATION_COLUMN_INDEX) - -#define TSDB_UD_COLUMN_INDEX (-1000) -#define TSDB_RES_COL_ID (-5000) - -#define TSDB_MULTI_TABLEMETA_MAX_NUM 100000 // maximum batch size allowed to load table meta - -#define TSDB_MIN_CACHE_BLOCK_SIZE 1 -#define TSDB_MAX_CACHE_BLOCK_SIZE 128 // 128MB for each vnode -#define TSDB_DEFAULT_CACHE_BLOCK_SIZE 16 - -#define TSDB_MIN_TOTAL_BLOCKS 3 -#define TSDB_MAX_TOTAL_BLOCKS 10000 -#define TSDB_DEFAULT_TOTAL_BLOCKS 6 - -#define TSDB_MIN_WAL_FLUSH_SIZE 128 // MB -#define TSDB_MAX_WAL_FLUSH_SIZE 10000000 // MB -#define TSDB_DEFAULT_WAL_FLUSH_SIZE 1024 // MB - -#define TSDB_MIN_TABLES 4 -#define TSDB_MAX_TABLES 10000000 -#define TSDB_DEFAULT_TABLES 1000000 -#define TSDB_TABLES_STEP 1000 -#define TSDB_META_COMPACT_RATIO 0 // disable tsdb meta compact by default - -#define TSDB_MIN_DAYS_PER_FILE 1 -#define TSDB_MAX_DAYS_PER_FILE 3650 -#define TSDB_DEFAULT_DAYS_PER_FILE 10 - -#define TSDB_MIN_KEEP 1 // data in db to be reserved. -#define TSDB_MAX_KEEP 36500 // data in db to be reserved. -#define TSDB_DEFAULT_KEEP 3650 // ten years - -#define TSDB_DEFAULT_MIN_ROW_FBLOCK 100 -#define TSDB_MIN_MIN_ROW_FBLOCK 10 -#define TSDB_MAX_MIN_ROW_FBLOCK 1000 - -#define TSDB_DEFAULT_MAX_ROW_FBLOCK 4096 -#define TSDB_MIN_MAX_ROW_FBLOCK 200 -#define TSDB_MAX_MAX_ROW_FBLOCK 10000 - -#define TSDB_MIN_COMMIT_TIME 30 -#define TSDB_MAX_COMMIT_TIME 40960 -#define TSDB_DEFAULT_COMMIT_TIME 3600 - -#define TSDB_MIN_PRECISION TSDB_TIME_PRECISION_MILLI -#define TSDB_MAX_PRECISION TSDB_TIME_PRECISION_NANO -#define TSDB_DEFAULT_PRECISION TSDB_TIME_PRECISION_MILLI - -#define TSDB_MIN_COMP_LEVEL 0 -#define TSDB_MAX_COMP_LEVEL 2 -#define TSDB_DEFAULT_COMP_LEVEL 2 - -#define TSDB_MIN_WAL_LEVEL 0 -#define TSDB_MAX_WAL_LEVEL 2 -#define TSDB_DEFAULT_WAL_LEVEL 1 - -#define TSDB_MIN_DB_UPDATE 0 -#define TSDB_MAX_DB_UPDATE 2 -#define TSDB_DEFAULT_DB_UPDATE_OPTION 0 - -#define TSDB_MIN_DB_CACHE_LAST_ROW 0 -#define TSDB_MAX_DB_CACHE_LAST_ROW 3 -#define TSDB_DEFAULT_CACHE_LAST_ROW 0 +#define TSDB_AUTH_LEN 16 +#define TSDB_KEY_LEN 16 +#define TSDB_VERSION_LEN 12 +#define TSDB_LOCALE_LEN 64 +#define TSDB_TIMEZONE_LEN 96 +#define TSDB_LABEL_LEN 8 + +#define TSDB_CLUSTER_ID_LEN 40 +#define TSDB_FQDN_LEN 128 +#define TSDB_EP_LEN (TSDB_FQDN_LEN + 6) +#define TSDB_IPv4ADDR_LEN 16 +#define TSDB_FILENAME_LEN 128 +#define TSDB_SHOW_SQL_LEN 512 +#define TSDB_SHOW_SUBQUERY_LEN 1000 +#define TSDB_SLOW_QUERY_SQL_LEN 512 + +#define TSDB_STEP_NAME_LEN 32 +#define TSDB_STEP_DESC_LEN 128 + +#define TSDB_DB_TYPE_DEFAULT 0 +#define TSDB_DB_TYPE_TOPIC 1 + +#define TSDB_DEFAULT_PKT_SIZE 65480 // same as RPC_MAX_UDP_SIZE + +#define TSDB_PAYLOAD_SIZE TSDB_DEFAULT_PKT_SIZE +#define TSDB_DEFAULT_PAYLOAD_SIZE 5120 // default payload size, greater than PATH_MAX value +#define TSDB_EXTRA_PAYLOAD_SIZE 128 // extra bytes for auth +#define TSDB_CQ_SQL_SIZE 1024 +#define TSDB_MIN_VNODES 64 +#define TSDB_MAX_VNODES 2048 +#define TSDB_MIN_VNODES_PER_DB 2 +#define TSDB_MAX_VNODES_PER_DB 64 + +#define TSDB_DNODE_ROLE_ANY 0 +#define TSDB_DNODE_ROLE_MGMT 1 +#define TSDB_DNODE_ROLE_VNODE 2 + +#define TSDB_MAX_REPLICA 5 + +#define TSDB_TBNAME_COLUMN_INDEX (-1) +#define TSDB_TSWIN_START_COLUMN_INDEX (-2) +#define TSDB_TSWIN_STOP_COLUMN_INDEX (-3) +#define TSDB_TSWIN_DURATION_COLUMN_INDEX (-4) +#define TSDB_QUERY_START_COLUMN_INDEX (-5) +#define TSDB_QUERY_STOP_COLUMN_INDEX (-6) +#define TSDB_QUERY_DURATION_COLUMN_INDEX (-7) +#define TSDB_MIN_VALID_COLUMN_INDEX (-7) + +#define TSDB_COL_IS_TSWIN_COL(_i) ((_i) <= TSDB_TSWIN_START_COLUMN_INDEX && (_i) >= TSDB_QUERY_DURATION_COLUMN_INDEX) + +#define TSDB_UD_COLUMN_INDEX (-1000) +#define TSDB_RES_COL_ID (-5000) + +#define TSDB_MULTI_TABLEMETA_MAX_NUM 100000 // maximum batch size allowed to load table meta + +#define TSDB_MIN_CACHE_BLOCK_SIZE 1 +#define TSDB_MAX_CACHE_BLOCK_SIZE 128 // 128MB for each vnode +#define TSDB_DEFAULT_CACHE_BLOCK_SIZE 16 + +#define TSDB_MIN_TOTAL_BLOCKS 3 +#define TSDB_MAX_TOTAL_BLOCKS 10000 +#define TSDB_DEFAULT_TOTAL_BLOCKS 6 + +#define TSDB_MIN_WAL_FLUSH_SIZE 128 // MB +#define TSDB_MAX_WAL_FLUSH_SIZE 10000000 // MB +#define TSDB_DEFAULT_WAL_FLUSH_SIZE 1024 // MB + +#define TSDB_MIN_TABLES 4 +#define TSDB_MAX_TABLES 10000000 +#define TSDB_DEFAULT_TABLES 1000000 +#define TSDB_TABLES_STEP 1000 +#define TSDB_META_COMPACT_RATIO 0 // disable tsdb meta compact by default + +#define TSDB_MIN_DAYS_PER_FILE 1 +#define TSDB_MAX_DAYS_PER_FILE 3650 +#define TSDB_DEFAULT_DAYS_PER_FILE 10 + +#define TSDB_MIN_KEEP 1 // data in db to be reserved. +#define TSDB_MAX_KEEP 36500 // data in db to be reserved. +#define TSDB_DEFAULT_KEEP 3650 // ten years + +#define TSDB_DEFAULT_MIN_ROW_FBLOCK 100 +#define TSDB_MIN_MIN_ROW_FBLOCK 10 +#define TSDB_MAX_MIN_ROW_FBLOCK 1000 + +#define TSDB_DEFAULT_MAX_ROW_FBLOCK 4096 +#define TSDB_MIN_MAX_ROW_FBLOCK 200 +#define TSDB_MAX_MAX_ROW_FBLOCK 10000 + +#define TSDB_MIN_COMMIT_TIME 30 +#define TSDB_MAX_COMMIT_TIME 40960 +#define TSDB_DEFAULT_COMMIT_TIME 3600 + +#define TSDB_MIN_PRECISION TSDB_TIME_PRECISION_MILLI +#define TSDB_MAX_PRECISION TSDB_TIME_PRECISION_NANO +#define TSDB_DEFAULT_PRECISION TSDB_TIME_PRECISION_MILLI + +#define TSDB_MIN_COMP_LEVEL 0 +#define TSDB_MAX_COMP_LEVEL 2 +#define TSDB_DEFAULT_COMP_LEVEL 2 + +#define TSDB_MIN_WAL_LEVEL 0 +#define TSDB_MAX_WAL_LEVEL 2 +#define TSDB_DEFAULT_WAL_LEVEL 1 + +#define TSDB_MIN_DB_UPDATE 0 +#define TSDB_MAX_DB_UPDATE 2 +#define TSDB_DEFAULT_DB_UPDATE_OPTION 0 + +#define TSDB_MIN_DB_CACHE_LAST_ROW 0 +#define TSDB_MAX_DB_CACHE_LAST_ROW 3 +#define TSDB_DEFAULT_CACHE_LAST_ROW 0 -#define TSDB_MIN_FSYNC_PERIOD 0 -#define TSDB_MAX_FSYNC_PERIOD 180000 // millisecond -#define TSDB_DEFAULT_FSYNC_PERIOD 3000 // three second +#define TSDB_MIN_FSYNC_PERIOD 0 +#define TSDB_MAX_FSYNC_PERIOD 180000 // millisecond +#define TSDB_DEFAULT_FSYNC_PERIOD 3000 // three second -#define TSDB_MIN_DB_REPLICA_OPTION 1 -#define TSDB_MAX_DB_REPLICA_OPTION 3 -#define TSDB_DEFAULT_DB_REPLICA_OPTION 1 +#define TSDB_MIN_DB_REPLICA_OPTION 1 +#define TSDB_MAX_DB_REPLICA_OPTION 3 +#define TSDB_DEFAULT_DB_REPLICA_OPTION 1 -#define TSDB_MIN_DB_PARTITON_OPTION 0 -#define TSDB_MAX_DB_PARTITON_OPTION 1000 +#define TSDB_MIN_DB_PARTITON_OPTION 0 +#define TSDB_MAX_DB_PARTITON_OPTION 1000 #define TSDB_DEFAULT_DB_PARTITON_OPTION 4 -#define TSDB_MIN_DB_QUORUM_OPTION 1 -#define TSDB_MAX_DB_QUORUM_OPTION 2 -#define TSDB_DEFAULT_DB_QUORUM_OPTION 1 +#define TSDB_MIN_DB_QUORUM_OPTION 1 +#define TSDB_MAX_DB_QUORUM_OPTION 2 +#define TSDB_DEFAULT_DB_QUORUM_OPTION 1 -#define TSDB_MAX_JOIN_TABLE_NUM 10 -#define TSDB_MAX_UNION_CLAUSE 5 +#define TSDB_MAX_JOIN_TABLE_NUM 10 +#define TSDB_MAX_UNION_CLAUSE 5 -#ifdef TSDB_MODE_RICH_COL -#define TSDB_MAX_FIELD_LEN 16384 -#else -#define TSDB_MAX_FIELD_LEN 64512 -#endif +#define TSDB_MAX_FIELD_LEN 65519 +// 16384 + // 65519 + + // #define TSDB_MAX_BINARY_LEN (TSDB_MAX_FIELD_LEN - TSDB_KEYSIZE) // keep 16384 => 65511 + // #define TSDB_MAX_NCHAR_LEN (TSDB_MAX_FIELD_LEN - TSDB_KEYSIZE) // keep 16384 => 65511 + +#define TSDB_MAX_BINARY_LEN TSDB_MAX_FIELD_LEN // keep 16384 => 65511 +#define TSDB_MAX_NCHAR_LEN TSDB_MAX_FIELD_LEN // keep 16384 => 65511 -#define TSDB_MAX_BINARY_LEN (TSDB_MAX_FIELD_LEN-TSDB_KEYSIZE) // keep 16384 -#define TSDB_MAX_NCHAR_LEN (TSDB_MAX_FIELD_LEN-TSDB_KEYSIZE) // keep 16384 #define PRIMARYKEY_TIMESTAMP_COL_INDEX 0 #define TSDB_MAX_RPC_THREADS 5 diff --git a/src/mnode/src/mnodeFunc.c b/src/mnode/src/mnodeFunc.c index 7f3963fc7e39f75bca5b1090907ff49d7e10a504..85b8f5c5fea1727f4d3d7a43f3c7794095750154 100644 --- a/src/mnode/src/mnodeFunc.c +++ b/src/mnode/src/mnodeFunc.c @@ -449,7 +449,7 @@ static int32_t mnodeProcessRetrieveFuncImplMsg(SMnodeMsg *pMsg) { SRetrieveFuncMsg *pInfo = pMsg->rpcMsg.pCont; pInfo->num = htonl(pInfo->num); - int32_t t = sizeof(SUdfFuncMsg) + (sizeof(SFunctionInfoMsg) + TSDB_FUNC_CODE_LEN) * pInfo->num + 16384; + int32_t t = sizeof(SUdfFuncMsg) + (sizeof(SFunctionInfoMsg) + TSDB_FUNC_CODE_LEN) * pInfo->num + 65519; SUdfFuncMsg *pFuncMsg = rpcMallocCont(t); pFuncMsg->num = htonl(pInfo->num); diff --git a/src/mnode/src/mnodeTable.c b/src/mnode/src/mnodeTable.c index 424e995c04a7714a9328c5097fe76553fe02d13e..b7fc4a239aa7eea8b45206d0788f32fead922981 100644 --- a/src/mnode/src/mnodeTable.c +++ b/src/mnode/src/mnodeTable.c @@ -1596,10 +1596,14 @@ static int32_t mnodeChangeSuperTableColumn(SMnodeMsg *pMsg) { } // check exceed max row bytes - int32_t i; + int32_t i; uint32_t nLen = 0; for (i = 0; i < pStable->numOfColumns; ++i) { - nLen += (pStable->schema[i].colId == col) ? pAlter->schema[0].bytes : pStable->schema[i].bytes; + SSchema *pSchema = pStable->schema + i; + nLen += (pSchema->colId == col) ? pAlter->schema[0].bytes : pSchema->bytes; + if (pSchema->type == TSDB_DATA_TYPE_BINARY || pSchema->type == TSDB_DATA_TYPE_NCHAR) { + nLen += sizeof(VarDataOffsetT); + } } if (nLen > TSDB_MAX_BYTES_PER_ROW) { mError("msg:%p, app:%p stable:%s, change column, name:%s exceed max row bytes", pMsg, pMsg->rpcMsg.ahandle, diff --git a/src/query/src/qAggMain.c b/src/query/src/qAggMain.c index 7aa2bc477c6976d50d9fdf12c1d1e2005f8f1dbc..949e80bc2f25131123f6f0072af1151f7f28665d 100644 --- a/src/query/src/qAggMain.c +++ b/src/query/src/qAggMain.c @@ -189,7 +189,7 @@ typedef struct { bool kPointsMeet; } SMovingAvgInfo; -typedef struct { +typedef struct { int32_t totalPoints; int32_t numSampled; uint16_t colBytes; @@ -448,7 +448,7 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI if (functionId == TSDB_FUNC_BLKINFO) { *type = TSDB_DATA_TYPE_BINARY; - *bytes = 16384; + *bytes = TSDB_MAX_FIELD_LEN; *interBytes = 0; return TSDB_CODE_SUCCESS; } diff --git a/src/util/src/tcompare.c b/src/util/src/tcompare.c index 62c09dbacabd25ff816ab69be1c5212fa5b6d69f..1772534be88e1870a24c016dbb535affc3624ce3 100644 --- a/src/util/src/tcompare.c +++ b/src/util/src/tcompare.c @@ -489,7 +489,9 @@ int WCSPatternMatch(const uint32_t *patterStr, const uint32_t *str, size_t size, int32_t compareStrPatternComp(const void* pLeft, const void* pRight) { SPatternCompareInfo pInfo = {'%', '_'}; - assert(varDataLen(pRight) <= TSDB_MAX_FIELD_LEN); + // assert(varDataLen(pRight) <= TSDB_MAX_FIELD_LEN); + assert(varDataLen(pRight) <= TSDB_MAX_NCHAR_LEN); + char *pattern = calloc(varDataLen(pRight) + 1, sizeof(char)); memcpy(pattern, varDataVal(pRight), varDataLen(pRight)); diff --git a/tests/pytest/insert/flushwhiledrop.py b/tests/pytest/insert/flushwhiledrop.py index 3784657117ad9e5a24851a2e6ac11e11594f0c72..ae2910425a646b836ea352b79a2d72476b915095 100644 --- a/tests/pytest/insert/flushwhiledrop.py +++ b/tests/pytest/insert/flushwhiledrop.py @@ -50,7 +50,7 @@ class TDTestCase: for i in range(finish, self.numberOfRecords): sql += "(%d, 1019774612, 29931, 1442173978, 165092.468750, 1128.643179, 'MOCq1pTu', 18405, 82, 0, 'g0A6S0Fu')" % (currts + i) finish = i + 1 - if (1048576 - len(sql)) < 16384: + if (1048576 - len(sql)) < 65519: break tdSql.execute(sql) diff --git a/tests/pytest/tools/taosdemoAllTest/TD-5213/insert4096columns_not_use_taosdemo.py b/tests/pytest/tools/taosdemoAllTest/TD-5213/insert4096columns_not_use_taosdemo.py index ec55acb848352def34e3090e66c4ef392b737ce0..3ae7d5784e9e0649f3c3c12c01837a9a81a1d4a8 100644 --- a/tests/pytest/tools/taosdemoAllTest/TD-5213/insert4096columns_not_use_taosdemo.py +++ b/tests/pytest/tools/taosdemoAllTest/TD-5213/insert4096columns_not_use_taosdemo.py @@ -24,7 +24,7 @@ class TDTestCase: updatecfgDict={'maxSQLLength':1048576} def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor(), logSql) + tdSql.init(conn.cursor(), True) os.system("rm -rf tools/taosdemoAllTest/TD-5213/insert4096columns_not_use_taosdemo.py.sql") @@ -288,9 +288,9 @@ class TDTestCase: tdSql.checkRows(4*self.num) tdSql.checkCols(4096) - #define TSDB_MAX_BYTES_PER_ROW 49151[old:1024 && 16384] + #define TSDB_MAX_BYTES_PER_ROW 65527[old:1024 && 16384 && 65519] #ts:8\int:4\smallint:2\bigint:8\bool:1\float:4\tinyint:1\nchar:4*()+2[offset]\binary:1*()+2[offset] - tdLog.info('test regular_table max bytes per row 49151') + tdLog.info('test regular_table max bytes per row 65527') sql = "create table regular_table_5(ts timestamp, " for i in range(500): sql += "int_%d int, " % (i + 1) @@ -312,12 +312,12 @@ class TDTestCase: sql += "binary_%d binary(34), " % (i + 1) for i in range(4090,4094): sql += "timestamp_%d timestamp, " % (i + 1) - sql += "col4095 binary(69))" + sql += "col4095 binary(14081))" tdSql.execute(sql) tdSql.query("select * from regular_table_5") tdSql.checkCols(4096) # TD-5324 - sql = "alter table regular_table_5 modify column col4095 binary(70); " + sql = "alter table regular_table_5 modify column col4095 binary(14082); " tdSql.error(sql) # drop and add @@ -326,16 +326,16 @@ class TDTestCase: sql = "select * from regular_table_5; " tdSql.query(sql) tdSql.checkCols(4095) - sql = "alter table regular_table_5 add column col4095 binary(70); " + sql = "alter table regular_table_5 add column col4095 binary(14082); " tdSql.error(sql) - sql = "alter table regular_table_5 add column col4095 binary(69); " + sql = "alter table regular_table_5 add column col4095 binary(14081); " tdSql.execute(sql) sql = "select * from regular_table_5; " tdSql.query(sql) tdSql.checkCols(4096) - #out TSDB_MAX_BYTES_PER_ROW 49151 - tdLog.info('test regular_table max bytes per row out 49151') + #out TSDB_MAX_BYTES_PER_ROW 65527 + tdLog.info('test regular_table max bytes per row out 65527') sql = "create table regular_table_6(ts timestamp, " for i in range(500): sql += "int_%d int, " % (i + 1) @@ -357,7 +357,7 @@ class TDTestCase: sql += "binary_%d binary(34), " % (i + 1) for i in range(4090,4094): sql += "timestamp_%d timestamp, " % (i + 1) - sql += "col4095 binary(70))" + sql += "col4095 binary(14082))" tdLog.info(len(sql)) tdSql.error(sql) @@ -575,9 +575,9 @@ class TDTestCase: tdSql.checkRows(3*self.num) tdSql.checkCols(4092) - #define TSDB_MAX_BYTES_PER_ROW 49151 TSDB_MAX_TAGS_LEN 16384 + #define TSDB_MAX_BYTES_PER_ROW 65527 TSDB_MAX_TAGS_LEN 65519 #ts:8\int:4\smallint:2\bigint:8\bool:1\float:4\tinyint:1\nchar:4*()+2[offset]\binary:1*()+2[offset] - tdLog.info('test super table max bytes per row 49151') + tdLog.info('test super table max bytes per row 65527') sql = "create table stable_4(ts timestamp, " for i in range(500): sql += "int_%d int, " % (i + 1) @@ -597,7 +597,7 @@ class TDTestCase: sql += "nchar_%d nchar(20), " % (i + 1) for i in range(3800,4090): sql += "binary_%d binary(34), " % (i + 1) - sql += "col4091 binary(101))" + sql += "col4091 binary(14113))" sql += " tags (loc nchar(10),tag_1 int,tag_2 int,tag_3 int) " tdSql.execute(sql) sql = '''create table table_40 using stable_4 @@ -614,9 +614,9 @@ class TDTestCase: sql = "select * from stable_4; " tdSql.query(sql) tdSql.checkCols(4095) - sql = "alter table stable_4 add column col4091 binary(102); " + sql = "alter table stable_4 add column col4091 binary(14114); " tdSql.error(sql) - sql = "alter table stable_4 add column col4091 binary(101); " + sql = "alter table stable_4 add column col4091 binary(14113); " tdSql.execute(sql) sql = "select * from stable_4; " tdSql.query(sql) @@ -635,7 +635,7 @@ class TDTestCase: sql = "alter table stable_4 add tag loc1 nchar(10); " tdSql.error(sql) - tdLog.info('test super table max bytes per row 49151') + tdLog.info('test super table max bytes per row 65527') sql = "create table stable_5(ts timestamp, " for i in range(500): sql += "int_%d int, " % (i + 1) @@ -655,7 +655,7 @@ class TDTestCase: sql += "nchar_%d nchar(20), " % (i + 1) for i in range(3800,4090): sql += "binary_%d binary(34), " % (i + 1) - sql += "col4091 binary(102))" + sql += "col4091 binary(14114))" sql += " tags (loc nchar(10),tag_1 int,tag_2 int,tag_3 int) " tdSql.error(sql) @@ -686,7 +686,7 @@ class TDTestCase: sql = "alter table stable_1 add tag max int; " tdSql.error(sql) # TD-5324 - sql = "alter table stable_4 modify column col4091 binary(102); " + sql = "alter table stable_4 modify column col4091 binary(14114); " tdSql.error(sql) sql = "alter table stable_4 modify tag loc nchar(20); " tdSql.query("select * from table_40") diff --git a/tests/pytest/tools/taosdumpTest2.py b/tests/pytest/tools/taosdumpTest2.py index 94c5adf30908174aaf1537d2ae314cf929fcab04..439e402c61d49778f235a3105b07a34e50e2d0a5 100644 --- a/tests/pytest/tools/taosdumpTest2.py +++ b/tests/pytest/tools/taosdumpTest2.py @@ -76,7 +76,7 @@ class TDTestCase: for i in range(finish, self.numberOfRecords): sql += "(%d, 1019774612, 29931, 1442173978, 165092.468750, 1128.643179, 'MOCq1pTu', 18405, 82, 0, 'g0A6S0Fu')" % (currts + i) finish = i + 1 - if (1048576 - len(sql)) < 16384: + if (1048576 - len(sql)) < 65519: break tdSql.execute(sql) diff --git a/tests/robust/robust.c b/tests/robust/robust.c index 3488ca1b9be8b6cca4d04fe5ba5841f00527b25d..0e3d01971df23d7d9c355b2561f6975e04dc0110 100644 --- a/tests/robust/robust.c +++ b/tests/robust/robust.c @@ -195,7 +195,7 @@ void insertImp(void *param) { for (int j = 0; j < arguments.table; j++) { sqlLen += sprintf(sql + sqlLen, " s%d_%d values (%ld, %d, %d, %d)", i, j, time, rand(), rand(), rand()); count++; - if ( (1048576 - sqlLen) < 49151 || i == (pThread->threadId * arguments.stable / arguments.client - 1)) { + if ( (1048576 - sqlLen) < 65527 || i == (pThread->threadId * arguments.stable / arguments.client - 1)) { result = taos_query(pThread->taos, sql); printf("Thread %d already insert %d rows\n", pThread->threadId, count); if (result == NULL || taos_errno(result) != 0) { diff --git a/tests/system-test/5-taos-tools/taosbenchmark/subscribeNoResult.py b/tests/system-test/5-taos-tools/taosbenchmark/subscribeNoResult.py index e1a9f647fa2b5d1f561e50a06b9755d78bebfa79..0266ae2daf0ea8cb3c374cde82ffdfd851fdecf3 100644 --- a/tests/system-test/5-taos-tools/taosbenchmark/subscribeNoResult.py +++ b/tests/system-test/5-taos-tools/taosbenchmark/subscribeNoResult.py @@ -62,7 +62,7 @@ class TDTestCase: for i in range(finish, self.numberOfRecords): sql += "(%d, 1019774612, 29931, 1442173978, 165092.468750, 1128.643179, 'MOCq1pTu', 18405, 82, 0, 'g0A6S0Fu')" % (currts + i) finish = i + 1 - if (1048576 - len(sql)) < 16384: + if (1048576 - len(sql)) < 65519: break tdSql.execute(sql)