From 5180384a06196af606bb349cac09e4a4b3a98800 Mon Sep 17 00:00:00 2001 From: kailixu Date: Tue, 29 Nov 2022 00:33:50 +0800 Subject: [PATCH] feat: test case adaption to support row/column up to 64k --- tests/pytest/table/boundary.py | 6 +++--- .../insertBinaryLenLarge16374AllcolLar49151-error-stmt.json | 4 ++-- .../pytest/tools/taosdemoAllTest/taosdemoTestInsertShell.py | 2 +- .../insertBinaryLenLarge16374AllcolLar49151-error-stmt.json | 4 ++-- .../5-taos-tools/taosbenchmark/taosdemoTestInsertShell.py | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/pytest/table/boundary.py b/tests/pytest/table/boundary.py index a1bf096499..a6d88a31ca 100644 --- a/tests/pytest/table/boundary.py +++ b/tests/pytest/table/boundary.py @@ -144,9 +144,9 @@ class TDTestCase: maxRowSize = self.getLimitFromSourceCode('TSDB_MAX_BYTES_PER_ROW') - 8 maxCols = self.getLimitFromSourceCode('TSDB_MAX_COLUMNS') - 1 - # for binary cols, 2 bytes are used for length - colLen = (maxRowSize - maxCols * 2) // maxCols - firstColLen = maxRowSize - 2 * maxCols - colLen * (maxCols - 1) + # for binary cols, 2 bytes are used for length, 4 bytes are used for VarDataOffsetT + colLen = (maxRowSize - maxCols * 6) // maxCols + firstColLen = maxRowSize - 6 * maxCols - colLen * (maxCols - 1) sql = "create table cars (ts timestamp, c0 binary(%d)" % firstColLen for i in range(1, maxCols): diff --git a/tests/pytest/tools/taosdemoAllTest/stmt/insertBinaryLenLarge16374AllcolLar49151-error-stmt.json b/tests/pytest/tools/taosdemoAllTest/stmt/insertBinaryLenLarge16374AllcolLar49151-error-stmt.json index 37714edc74..6e2b66c60e 100644 --- a/tests/pytest/tools/taosdemoAllTest/stmt/insertBinaryLenLarge16374AllcolLar49151-error-stmt.json +++ b/tests/pytest/tools/taosdemoAllTest/stmt/insertBinaryLenLarge16374AllcolLar49151-error-stmt.json @@ -54,7 +54,7 @@ "sample_format": "csv", "sample_file": "./sample.csv", "tags_file": "", - "columns": [{"type": "BINARY", "len": 16375, "count":1},{"type": "INT"}], + "columns": [{"type": "BINARY", "len": 65514, "count":1}], "tags": [{"type": "TINYINT", "count":2}, {"type": "BINARY", "len": 16, "count":5}] }, { @@ -80,7 +80,7 @@ "sample_format": "csv", "sample_file": "./sample.csv", "tags_file": "", - "columns": [{"type": "BINARY", "len": 16371, "count":3},{"type": "INT","count":6},{"type": "TINYINT"}], + "columns": [{"type": "BINARY", "len": 21831, "count":3},{"type": "INT","count":2},{"type": "TINYINT"}], "tags": [{"type": "TINYINT", "count":2}, {"type": "BINARY", "len": 16, "count":5}] }] }] diff --git a/tests/pytest/tools/taosdemoAllTest/taosdemoTestInsertShell.py b/tests/pytest/tools/taosdemoAllTest/taosdemoTestInsertShell.py index 7403ad60a4..9b64a5272d 100644 --- a/tests/pytest/tools/taosdemoAllTest/taosdemoTestInsertShell.py +++ b/tests/pytest/tools/taosdemoAllTest/taosdemoTestInsertShell.py @@ -215,7 +215,7 @@ class TDTestCase: # taosdemo error # too max length - sql = "%s -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(4096\) \ + sql = "%s -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(16379\) \ -w 40 -T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I taosc" % (binPath, cfgPath) tdLog.info("%s" % sql) diff --git a/tests/system-test/5-taos-tools/taosbenchmark/stmt/insertBinaryLenLarge16374AllcolLar49151-error-stmt.json b/tests/system-test/5-taos-tools/taosbenchmark/stmt/insertBinaryLenLarge16374AllcolLar49151-error-stmt.json index 37714edc74..6e2b66c60e 100644 --- a/tests/system-test/5-taos-tools/taosbenchmark/stmt/insertBinaryLenLarge16374AllcolLar49151-error-stmt.json +++ b/tests/system-test/5-taos-tools/taosbenchmark/stmt/insertBinaryLenLarge16374AllcolLar49151-error-stmt.json @@ -54,7 +54,7 @@ "sample_format": "csv", "sample_file": "./sample.csv", "tags_file": "", - "columns": [{"type": "BINARY", "len": 16375, "count":1},{"type": "INT"}], + "columns": [{"type": "BINARY", "len": 65514, "count":1}], "tags": [{"type": "TINYINT", "count":2}, {"type": "BINARY", "len": 16, "count":5}] }, { @@ -80,7 +80,7 @@ "sample_format": "csv", "sample_file": "./sample.csv", "tags_file": "", - "columns": [{"type": "BINARY", "len": 16371, "count":3},{"type": "INT","count":6},{"type": "TINYINT"}], + "columns": [{"type": "BINARY", "len": 21831, "count":3},{"type": "INT","count":2},{"type": "TINYINT"}], "tags": [{"type": "TINYINT", "count":2}, {"type": "BINARY", "len": 16, "count":5}] }] }] diff --git a/tests/system-test/5-taos-tools/taosbenchmark/taosdemoTestInsertShell.py b/tests/system-test/5-taos-tools/taosbenchmark/taosdemoTestInsertShell.py index a872d8566f..25bbc87163 100644 --- a/tests/system-test/5-taos-tools/taosbenchmark/taosdemoTestInsertShell.py +++ b/tests/system-test/5-taos-tools/taosbenchmark/taosdemoTestInsertShell.py @@ -203,7 +203,7 @@ class TDTestCase: # taosdemo error # too max length - sql = "%staosBenchmark -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(4096\) \ + sql = "%staosBenchmark -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(16379\) \ -w 40 -T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I taosc" % (binPath,cfgPath) tdLog.info("%s" % sql ) assert os.system("%s" % sql ) != 0 -- GitLab