1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Merge pull request #13 from mariadb-corporation/MCOL-290

Mcol 290
This commit is contained in:
Andrew Hutchings
2016-09-23 09:24:13 -05:00
committed by GitHub
5 changed files with 563 additions and 471 deletions

View File

@ -24,6 +24,8 @@
#include <cstdlib>
#include <string>
#include <sstream>
#define __STDC_LIMIT_MACROS
#include <stdint.h>
using namespace std;
#include "functor_real.h"
@ -56,6 +58,12 @@ int64_t Func_div::getIntVal(rowgroup::Row& row,
return 0;
}
int64_t int_val1 = (int64_t)(val1 > 0 ? val1 + 0.5 : val1 - 0.5);
// MCOL-176 If abs(int_val2) is small enough (like -1), then, this may cause overflow.
// This kludge stops the crash.
if (int_val1 == INT64_MIN)
{
--int_val1;
}
return int_val1 / int_val2;
}