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

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

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