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

1124 Commits

Author SHA1 Message Date
30fe666a8f A join patch for MCOL-4609, MCOL-4610, MCOL-4619, MCOL-4650, MCOL-4651
This patch is fixing the following bugs:

- MCOL-4609 TreeNode::getIntVal() does not round: implicit DECIMAL->INT cast is not MariaDB compatible
- MCOL-4610 TreeNode::getUintVal() looses precision for narrow decimal
- MCOL-4619 TreeNode::getUintVal() does not round: Implicit DECIMAL->UINT conversion is not like in InnoDB
- MCOL-4650 TreeNode::getIntVal() looses precision for narrow decimal
- MCOL-4651 SEC_TO_TIME(hugePositiveDecimal) returns a negative time
2021-03-30 16:37:05 +04:00
1acc631a04 MCOL-4600 CAST(decimal AS SIGNED/UNSIGNED) returns a wrong result
The "SIGNED" part of the problem was previously fixed by MCOL-4640.
Fixing the "UNSIGNED" part.

- Adding TDecimal64::toUInt64Round() and Decimal::decimal64ToUInt64Round()
- Renaming Decimal::narrowRound() to decimal64ToSInt64Round(),
   for a more self-descriptive name, and for symmetry with decimal64ToUInt64Round()
- Reusing TDecimal64::toSInt64Round() inside decimal64ToSInt64Round().
  This change was forgotten in MCOL-4640 :(
- Removing the old code in Func_cast_unsigned::getUintVal with pow().
  It caused precision loss, hence the bug. Adding a call for
  Decimal::decimal64ToUInt64Round() instead.
- Adding tests for both SIGNED and UNSIGNED casts.

Additional change:
- Moving the wide-decimal-to-uint64_t rounding code from Func_cast_unsigned::getUintVal()
  to TDecimal128::toUInt64Round() (with refactoring). Adding TDecimal::toUInt64Round()
  for symmetry with TDecimal::toSInt64Round(). It will be easier to reuse the code
  with way.
2021-03-30 12:46:07 +04:00
0eee6cfc62 MCOL-4643 reset valOut after UDAF evaluation 2021-03-26 16:09:15 -05:00
c0b8445225 MCOL-4633 Remove duplicate code for DECIMAL to int64_t rounding conversion
Detailed change list:

- Splitting out the narrow part of "class Decimal" into a separate class TDecimal64

- Adding a method TDecimal64::toSInt64Round()

- Reusing the method TDecimal64::toSInt64Round() in:
   * Func_cast_signed::getIntVal()
   * Func_char::getStrVal()
   * Func_elt::getStrVal()
   * makedate()
   * Func_maketime::getStrVal()

   Note, reusing this method in Func_char::getStrVal() also fixed this bug:
     MCOL-4634 CHAR(negativeWideDecimal) is not like InnoDB
   because the old code handled negative wide decimal values
   in a wrong way.

- Adding a new class TDecimal128 for symmetry.
  Moving a few wide decimal methods and constexpr's from Decimal to TDecimal128.
  The new class TDecimal128 does not do much at this point yet.
  Later we should be able to use TDecimal128 vs TDecimal64 in templates.
2021-03-25 17:56:10 +04:00
65e0a69914 Merge pull request #1815 from benthompson15/MCOL-4554
MCOL-4554: use jemalloc provided by repo.
2021-03-23 16:02:06 +03:00
894ebced33 Merge pull request #1817 from mariadb-corporation/bar-develop-MCOL-4629
MCOL-4629 Add a helper method mcsv1_UDAF::toDouble()
2021-03-23 05:46:31 -04:00
ca7a310309 MCOL-4629 Add a helper method mcsv1_UDAF::toDouble() 2021-03-23 13:23:48 +04:00
765858bc5b MCOL-4498 LIKE is not collation aware 2021-03-22 20:42:01 +04:00
13b7a794e4 MCOL-4620 Add charset to various RowGroup initializers
Specifically to operator+=
2021-03-19 16:57:54 -05:00
c74beb6178 MCOL-4554: use jemalloc provided by repo. 2021-03-18 12:35:16 -05:00
af20387985 MCOL-4516 check for var_pop < 0
In some cases, because of rounding error, var_pop will evaluate to some value just less than 0. We check for this and force to round to 0.
2021-03-09 13:36:10 -06:00
a2efa1efeb MCOL-4566: Extend CompressedDBFileHeader struct with new fields.
* This patch extends CompressedDBFileHeader struct with new fields:
  `fColumWidth`, `fColDataType`, which are necessary to rebuild extent map
  from the given file. Note: new fields do not change the memory
  layout of the struct, because the size is calculated as
  max(sizeof(CompressedDBFileHeader), HDR_BUF_LEN)).

* This patch changes API of some functions, by adding new function
  argument `colDataType` when needed, to be able to call `initHdr`
  function with colDataType value.
2021-03-05 22:15:34 +03:00
afa88866bb MCOL-4483: Fix and consolidate log files and cpimport logging. 2021-02-12 15:40:16 -06:00
229fd5d1bd Merge pull request #1756 from benthompson15/MCOL-4193-dev
MCOL-4193-dev
2021-02-12 22:41:29 +03:00
69da915160 MCOL-4531 New string-to-decimal conversion implementation
This change fixes:

MCOL-4462 CAST(varchar_expr AS DECIMAL(M,N)) returns a wrong result
MCOL-4500 Bit functions processing throws internally trying to cast char into decimal representation
MCOL-4532 CAST(AS DECIMAL) returns a garbage for large values

Also, this change makes string-to-decimal conversion 5-10 times faster,
depending on exact data.
Performance implemenent is achieved by the fact that (unlike in the old
implementation), the new version does not do any "string" object copying.
2021-02-09 13:02:27 +04:00
846f7fb29b MCOL-4193: Delete unused OAM and applications, ProcMon, ProcMgr, and no longer build all tools for packages 2021-02-08 17:51:09 -06:00
6f9cc0a067 MCOL-4486 Removing deadlock implicitly introduced by the deprecated class boost::condition 2021-02-04 15:39:02 +00:00
7277299628 Merge pull request #1742 from mariadb-AlexeyAntipovsky/MCOL-4031-dev
MCOL-4031 More accurate memory usage counting while sorting
2021-02-01 17:05:45 +03:00
0ccf3a28e3 MCOL-4511 __float128 type is not supported on aarch64
long double is 128 bit on aarch64,  even if it is soft supported,
not hardware instrunction supported.
So, here we just use long double on aarch64.
2021-01-30 16:11:03 +08:00
5080e1ae53 MCOL-4031 More accurate memory usage counting while sorting 2021-01-29 18:31:20 +03:00
688ba9b544 Merge pull request #1732 from drrtuy/remove-lquadmath
Removing libquadmath from the list of the libraries to link against
2021-01-22 14:39:35 +03:00
25f54c54f5 Merge pull request #1731 from zhaorenhai/MCOL-4510
MCOL-4510 thrift code need to be upgraded to support aarch64
2021-01-22 11:05:54 +03:00
6af270606e Removing libquadmath from the list of the libraries to link against 2021-01-22 07:52:38 +00:00
a975b69811 MCOL-4510 thrift code need to be upgraded to support aarch64
code is from https://bugzilla.redhat.com/show_bug.cgi?id=1273830
2021-01-22 14:10:48 +08:00
a687df48b9 MCOL-4065 DISTINCT is case sensitive
This patch makes DISTINCT and GROUP BY collation aware.
2021-01-21 15:46:54 +04:00
ef1268b5a2 Merge pull request #1713 from dhall-MariaDB/MCOL-4472-dev
MCOL-4472 Fix up floor() for the new format MariaDB 10.5
2021-01-19 13:32:13 -06:00
5fce19df0a MCOL-4412 Introduce TypeHandler::getEmptyValueForType to return const ptr for an empty value
WE changes for SQL DML and DDL operations

Changes for bulk operations

Changes for scanning operations

Cleanup
2021-01-18 12:30:17 +00:00
b8cfda3bda A cleanup for MCOL-4464 Bitwise operations not like in MariaDB
CI with RelWithDebInfo builds revealed a problem in the main
patch for MCOL-4464, which did not show up with Debug builds.

Methods like:
- getDoubleVal()
- getDateIntVal()
- getDatetimeIntVal()
- getTimestampIntVal()
- getTimeIntVal()
- getUintVal()
- getIntVal()
- getStrVal()
require the caller to initialize the isNull argument to false.
This fact was not taken into account in MCOL-4464.

Adding proper initializations.
2021-01-13 16:51:38 +04:00
09f937693f MCOL-4454 "ORDER BY BINARY a" is not like in InnoDB 2021-01-12 12:33:44 +04:00
4abbe90302 MCOL-4464 Bitwise operations not like in MariaDB 2021-01-11 14:14:34 +04:00
6e41b41637 MCOL-4472 Fix up floor() for the new format MariaDB 10.5
In 105, MariaDB expects a new format from floor()
2021-01-08 15:00:31 -06:00
0e6778378d Merge pull request #1705 from drrtuy/MCOL-4478
MCOL-4478 MCS now rounds the last digit of an avg() result
2021-01-06 15:30:34 +03:00
c7190a9856 Merge pull request #1706 from drrtuy/MCOL-4479
MCOL-4479 Imported couple functions from boost::math to remove libqua…
2020-12-30 18:42:27 +03:00
5b9689ce55 MCOL-4478 MCS now rounds the last digits of an avg() result for wide-DECIMAL argument 2020-12-30 15:02:12 +00:00
aa5211f192 MCOL-4479 Imported couple functions from boost::math to remove libquadmath dependency 2020-12-30 10:34:50 +00:00
e4bb7625f1 Merge pull request #1697 from drrtuy/MCOL-4470
MCOL-4470 Fix the crash in collation aware JOIN code
2020-12-29 10:54:23 +03:00
13e160ec2b MCOL-4470 Fix the crash in collation aware JOIN code 2020-12-24 14:28:09 +00:00
b0f97611fc Merge pull request #1691 from drrtuy/MCOL-4465_MCOL-4466_MCOL-4452
Mcol 4465 mcol 4466 mcol 4452
2020-12-23 16:28:40 +03:00
2c36eedb2b MCOL-4466 regr_count() and distinct_count() now use long long for counters and for a type cast to/from boost::any 2020-12-22 15:53:06 +00:00
5815c5c526 MCOL-4452 RowAggregationUMP2::doUDAF() now calls setUserData() using a correct UDAF context 2020-12-22 15:43:51 +00:00
bfe90be3db Merge pull request #1677 from tntnatbry/MCOL-4177-2
MCOL-4177 Add support for bulk insertion for wide decimals.
2020-12-18 12:37:23 +03:00
0a9fc0550f Merge pull request #1688 from dhall-MariaDB/MCOL-4319-dev
MCOL-4319 add logrotate for cpimport logs
2020-12-17 09:51:12 -06:00
eae1d913c0 MCOL-4319 add logrotate for cpimport logs 2020-12-16 16:39:17 -06:00
d35002fb65 MCOL-4263 return int for func_floor on datetime
For TIMESTAMP, it should do similar. However, it didn't work. For some reason, MDB has the function set as DATETIME, which for cs, isn't the same thing. Added a kludge to ha_mcs_execplan.cpp to handle it.
2020-12-16 16:23:21 -06:00
f6b55c1e18 MCOL-4177 Add support for bulk insertion for wide decimals.
1. This patch adds support for wide decimals with/without scale
     to cpimport. In addition, INSERT ... SELECT and LDI are also
     now supported.
  2. Logic to compute the number of bytes to convert a binary
     representation in the buffer to a narrow decimal is also
     simplified.
2020-12-15 22:14:54 +00:00
a433c65575 A cleanup for MCOL-4064 Make JOIN collation aware
After creating and populating tables with CHAR(5) case insensitive columns,
in a set of consequent joins like:

select * from t1, t2 where t1.c1=t2.c1;
select * from t1, t2 where t1.c1=t2.c2;
select * from t1, t2 where t1.c2=t2.c1;
select * from t1, t2 where t1.c2=t2.c2;

only the first join worked reliably case insensitively.

Removing the remaining pieces of the code that used order_swap() to compare
short CHAR columns, and using Charset::strnncollsp() instead.
This fixes the issue.
2020-12-10 19:19:36 +04:00
b08d719593 A cleanup for MCOL-4064 Make JOIN collation aware
A non-JOIN condition like `WHERE c1=c2` (with c1 and c2 being columns of the
same table) was not collation-aware yet after the main patches for MCOL-4064.

Additionally fixing StrFilterCmd::compare*() to address this.
2020-12-08 16:43:07 +04:00
069b74563f Move Functor::timeZone() call that utilizes a lock into a block where
timezone is really used
2020-12-07 14:35:30 +00:00
6b13fbc210 Merge pull request #1650 from mariadb-corporation/develop-bar-strings
Develop bar strings
2020-12-04 12:05:11 +03:00
dd8289d4fd Merge pull request #1619 from tntnatbry/MCOL-4188-bps-wf-fix
MCOL-4188 Regression fixes for MCOL-641.
2020-12-04 08:16:34 +03:00