提交 8d1c685f 编写于 作者: S Shengliang Guan

Merge remote-tracking branch 'origin/master' into feature/m1

...@@ -102,7 +102,7 @@ extern char configDir[]; ...@@ -102,7 +102,7 @@ extern char configDir[];
#define NOTE_BUFF_LEN (SMALL_BUFF_LEN*16) #define NOTE_BUFF_LEN (SMALL_BUFF_LEN*16)
#define DEFAULT_TIMESTAMP_STEP 1 #define DEFAULT_TIMESTAMP_STEP 1
#define DEFAULT_CHILDTABLES 10000
enum TEST_MODE { enum TEST_MODE {
INSERT_TEST, // 0 INSERT_TEST, // 0
...@@ -625,7 +625,7 @@ SArguments g_args = { ...@@ -625,7 +625,7 @@ SArguments g_args = {
0, // interlace_rows; 0, // interlace_rows;
30000, // num_of_RPR 30000, // num_of_RPR
(1024*1024), // max_sql_len (1024*1024), // max_sql_len
10000, // num_of_tables DEFAULT_CHILDTABLES, // num_of_tables
10000, // num_of_DPT 10000, // num_of_DPT
0, // abort 0, // abort
0, // disorderRatio 0, // disorderRatio
...@@ -639,7 +639,7 @@ SArguments g_args = { ...@@ -639,7 +639,7 @@ SArguments g_args = {
static SDbs g_Dbs; static SDbs g_Dbs;
static int64_t g_totalChildTables = 0; static int64_t g_totalChildTables = DEFAULT_CHILDTABLES;
static int64_t g_actualChildTables = 0; static int64_t g_actualChildTables = 0;
static SQueryMetaInfo g_queryInfo; static SQueryMetaInfo g_queryInfo;
static FILE * g_fpOfInsertResult = NULL; static FILE * g_fpOfInsertResult = NULL;
...@@ -9154,6 +9154,7 @@ int main(int argc, char *argv[]) { ...@@ -9154,6 +9154,7 @@ int main(int argc, char *argv[]) {
debugPrint("meta file: %s\n", g_args.metaFile); debugPrint("meta file: %s\n", g_args.metaFile);
if (g_args.metaFile) { if (g_args.metaFile) {
g_totalChildTables = 0;
initOfInsertMeta(); initOfInsertMeta();
initOfQueryMeta(); initOfQueryMeta();
......
...@@ -67,10 +67,18 @@ static int32_t setBoundingBox(MinMaxEntry* range, int16_t type, double minval, d ...@@ -67,10 +67,18 @@ static int32_t setBoundingBox(MinMaxEntry* range, int16_t type, double minval, d
if (IS_SIGNED_NUMERIC_TYPE(type)) { if (IS_SIGNED_NUMERIC_TYPE(type)) {
range->i64MinVal = (int64_t) minval; range->i64MinVal = (int64_t) minval;
range->i64MaxVal = (int64_t) maxval; if (maxval > INT64_MAX || (int64_t)maxval == INT64_MIN) {
range->i64MaxVal = INT64_MAX;
} else {
range->i64MaxVal = (int64_t) maxval;
}
} else if (IS_UNSIGNED_NUMERIC_TYPE(type)){ } else if (IS_UNSIGNED_NUMERIC_TYPE(type)){
range->u64MinVal = (uint64_t) minval; range->u64MinVal = (uint64_t) minval;
range->u64MaxVal = (uint64_t) maxval; if ((uint64_t)maxval > UINT64_MAX) {
range->u64MaxVal = UINT64_MAX;
} else {
range->u64MaxVal = (uint64_t) maxval;
}
} else { } else {
range->dMinVal = minval; range->dMinVal = minval;
range->dMaxVal = maxval; range->dMaxVal = maxval;
...@@ -127,8 +135,8 @@ int32_t tBucketIntHash(tMemBucket *pBucket, const void *value) { ...@@ -127,8 +135,8 @@ int32_t tBucketIntHash(tMemBucket *pBucket, const void *value) {
index = (delta % pBucket->numOfSlots); index = (delta % pBucket->numOfSlots);
} else { } else {
double slotSpan = (double)span / pBucket->numOfSlots; double slotSpan = (double)span / pBucket->numOfSlots;
index = (int32_t)((v - pBucket->range.i64MinVal) / slotSpan); index = (int32_t)(((double)v - pBucket->range.i64MinVal) / slotSpan);
if (v == pBucket->range.i64MaxVal) { if (index == pBucket->numOfSlots) {
index -= 1; index -= 1;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册