1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-06-13 16:01:32 +03:00
Commit Graph

68 Commits

Author SHA1 Message Date
5814a80b50 MCOL-4671: MCOL-4622: fix the behavior of both PRs
first was playing different with RIGHT and LEFT functions(using the getUintVal and getIntVal accordingly)
https://github.com/mariadb-corporation/mariadb-columnstore-engine/pull/3234
second introduced round for ints from double, but added it to uint but not to int missing long doubles as well
https://github.com/mariadb-corporation/mariadb-columnstore-engine/pull/3480
2025-05-23 05:12:17 +04:00
a0bee173f6 chore(build): fixes to satisfy clang19 warnings 2025-05-15 19:05:38 +04:00
b8c0b74f2b fix(funexp): MCOL-4622 Implicit FLOAT->INT and DOUBLE->INT conversion is not like in InnoDB (#3480) 2025-04-04 21:28:16 +01:00
0ab03c7258 chore(codestyle): mark virtual methods as override 2025-02-21 20:01:34 +04:00
b53c231ca6 MCOL-271 empty strings should not be NULLs (#2794)
This patch improves handling of NULLs in textual fields in ColumnStore.
Previously empty strings were considered NULLs and it could be a problem
if data scheme allows for empty strings. It was also one of major
reasons of behavior difference between ColumnStore and other engines in
MariaDB family.

Also, this patch fixes some other bugs and incorrect behavior, for
example, incorrect comparison for "column <= ''" which evaluates to
constant True for all purposes before this patch.
2023-03-30 21:18:29 +03:00
256691652d MCOL-4530: toCppCode() method for ParseTree and TreeNode (#2777)
* toCppCode for ParseTree and TreeNode

* generated tree is compiling

* Put tree constructors into tests

* Minor fixes

* Fixed parse + some constructors

* Fixed includes, removed debug and old data

* Hopefully fix clang errors

* Forgot an override

* More overrides
2023-03-22 23:25:06 +03:00
d43e418a8c MCOL-5346 This patch forces TreeNode::getIntValue to use conversion for dict-based CHAR/VARCHAR and TEXT columns (#2657)
Co-authored-by: Roman Nozdrin <rnozdrin@mariadb.com>
2022-12-13 18:13:22 +03:00
65252df4f6 C++20 fixes 2022-03-28 12:32:29 +00:00
53b9a2a0f9 MCOL-4580 extent elimination for dictionary-based text/varchar types
The idea is relatively simple - encode prefixes of collated strings as
integers and use them to compute extents' ranges. Then we can eliminate
extents with strings.

The actual patch does have all the code there but miss one important
step: we do not keep collation index, we keep charset index. Because of
this, some of the tests in the bugfix suite fail and thus main
functionality is turned off.

The reason of this patch to be put into PR at all is that it contains
changes that made CHAR/VARCHAR columns unsigned. This change is needed in
vectorization work.
2022-03-02 23:53:39 +03:00
973e5024d8 MCOL-4957 Fix performance slowdown for processing TIMESTAMP columns.
Part 1:
 As part of MCOL-3776 to address synchronization issue while accessing
 the fTimeZone member of the Func class, mutex locks were added to the
 accessor and mutator methods. However, this slows down processing
 of TIMESTAMP columns in PrimProc significantly as all threads across
 all concurrently running queries would serialize on the mutex. This
 is because PrimProc only has a single global object for the functor
 class (class derived from Func in utils/funcexp/functor.h) for a given
 function name. To fix this problem:

   (1) We remove the fTimeZone as a member of the Func derived classes
   (hence removing the mutexes) and instead use the fOperationType
   member of the FunctionColumn class to propagate the timezone values
   down to the individual functor processing functions such as
   FunctionColumn::getStrVal(), FunctionColumn::getIntVal(), etc.

   (2) To achieve (1), a timezone member is added to the
   execplan::CalpontSystemCatalog::ColType class.

Part 2:
 Several functors in the Funcexp code call dataconvert::gmtSecToMySQLTime()
 and dataconvert::mySQLTimeToGmtSec() functions for conversion between seconds
 since unix epoch and broken-down representation. These functions in turn call
 the C library function localtime_r() which currently has a known bug of holding
 a global lock via a call to __tz_convert. This significantly reduces performance
 in multi-threaded applications where multiple threads concurrently call
 localtime_r(). More details on the bug:
   https://sourceware.org/bugzilla/show_bug.cgi?id=16145

 This bug in localtime_r() caused processing of the Functors in PrimProc to
 slowdown significantly since a query execution causes Functors code to be
 processed in a multi-threaded manner.

 As a fix, we remove the calls to localtime_r() from gmtSecToMySQLTime()
 and mySQLTimeToGmtSec() by performing the timezone-to-offset conversion
 (done in dataconvert::timeZoneToOffset()) during the execution plan
 creation in the plugin. Note that localtime_r() is only called when the
 time_zone system variable is set to "SYSTEM".

 This fix also required changing the timezone type from a std::string to
 a long across the system.
2022-02-14 14:12:27 -05:00
04752ec546 clang format apply 2022-01-21 16:43:49 +00:00
01f3ceb437 replace header guards with #pragma once 2022-01-21 15:24:58 +00:00
362bfcd15e MCOL-4361 Replace pow(10.0, (double)scale) expressions with a static dictionary lookup. 2021-04-09 12:41:04 +04:00
a0b46425dc Merge pull request #1787 from mariadb-corporation/bar-develop-like
MCOL-4498 LIKE is not collation aware
2021-04-02 11:57:06 +03:00
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
765858bc5b MCOL-4498 LIKE is not collation aware 2021-03-22 20:42:01 +04: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
5c3b22ddf7 MCOL-4180 dbcon/execplan review 2021-01-20 16:18:02 +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
4abbe90302 MCOL-4464 Bitwise operations not like in MariaDB 2021-01-11 14:14:34 +04:00
ed7811e161 MCOL-4180 Add some missing support for wide decimals to dbcon/execplan
classes.
2020-12-12 00:14:48 +00:00
a159f8a0b6 MCOL-4188 Regression fixes for MCOL-641.
1. Add wide decimal support to AggregateColumn::evaluate
and TreeNode::getDecimalVal().
2. Use the pm aggregate attributes to determine um aggregate
attributes in TupleAggregateStep::prep2PhasesAggregate.
2020-11-30 13:49:05 -05:00
494bde61e1 MCOL-4409 Moved static Decimal conversion methods into VDecimal class
MCOL-4409 This patch combines VDecimal and Decimal and makes
IDB_Decimal an alias for the result class

MCOL-4409 More boilerplate reduction in Func_mod

Removed couple TSInt128::toType() methods
2020-11-30 12:08:52 +00:00
995cadef2d MCOL-641 Fix alter table add wide decimal column.
This patch also removes CalpontSystemCatalog::BINARY and
ddlpackage::DDL_BINARY that were added during the initial
stages of the work on MCOL-641.
2020-11-20 19:49:54 -05:00
178be69bc4 MCOL-4394 __float128 related code had been moved into a separate file
Trim to double and to long double conversions for Decimal
2020-11-19 12:08:18 +00:00
aa44bca473 A pack of fixes for compilation errors and warnings for all platforms
Add libdatatypes.so into debian packaging
2020-11-19 10:21:45 +00:00
58495d0d2f MCOL-4387 Convert dataconvert::decimalToString() into VDecimal and TSInt128 methods 2020-11-18 13:53:16 +00:00
007b8a5082 MCOL-4188 Fix regressions in CEIL()/CHAR() for narrow decimals.
In addition, a regression in a WHERE clause with a WF field
as the LHS and an addition operation on two WF fields on the RHS
is also fixed. The issue was SimpleColumn::getDecimalVal() was
setting precision = 19, with the value of one of the operands of the
addition operation being set in VDecimal::value instead of
VDecimal::s128Value. addSubtractExecute() in mcs_decimal.cpp makes the
assumption that if precision > 18 and precision <= 38, we need to
fetch the wide s128Value, not the narrow value field. So we are
fixing the precision set in SimpleColumn::getDecimalVal().
2020-11-18 13:53:16 +00:00
3eb26c0d4a MCOL-4313 Introduced TSInt128 that is a storage class for int128
Removed uint128 from joblist/lbidlist.*

Another toString() method for wide-decimal that is EMPTY/NULL aware

Unified decimal processing in WF functions

Fixed a potential issue in EqualCompData::operator() for
    wide-decimal processing

Fixed some signedness warnings
2020-11-18 13:53:15 +00:00
129d5b5a0f MCOL-4174 Review/refactor frontend/connector code 2020-11-18 13:53:15 +00:00
6aea838360 MCOL-641 Add support for functions (Part 2). 2020-11-18 13:51:55 +00:00
cfe35b5c7f MCOL-641 Add support for functions (Part 1). 2020-11-18 13:51:25 +00:00
74b64eb4f1 MCOL-641 1. Add support for int128_t in ParsedColumnFilter.
2. Set Decimal precision in SimpleColumn::evaluate().
3. Add support for int128_t in ConstantColumn.
4. Set IDB_Decimal::s128Value in buildDecimalColumn().
5. Use width 16 as first if predicate for branching based on decimal width.
2020-11-18 13:47:45 +00:00
b09f3088ca MCOL-641 Initial version of Math operations for wide decimal. 2020-11-18 13:47:44 +00:00
2e8e7d52c3 Renamed datatypes/decimal.* into csdecimal to avoid collision with MDB. 2020-11-18 13:47:44 +00:00
238386bf63 MCOL-641 Replaced IDB_Decima.__v union with int128_t attribute.
Moved all tests into ./test

Introduced ./datatypes directory
2020-11-18 13:47:44 +00:00
98213c0094 MCOL-641 Addition now works for DECIMAL columns with precision > 18. 2020-11-18 13:47:01 +00:00
54c152d6c8 MCOL-641 This commit introduces templates for DataConvert and RowGroup methods. 2020-11-18 13:47:01 +00:00
32f6167067 MCOL-641 Work of Ivan Zuniga on basic read and write support for Binary16 2020-11-18 13:47:00 +00:00
06e50e0926 MCOL-3536 collation 2020-05-26 12:42:11 -05:00
1f3d1e6fd6 MCOL-3536 collation 2020-05-14 16:02:49 -05:00
d051482e94 MCOL-3663 revert to using posix regex for LIKE 2020-02-10 13:37:42 -06:00
49994f7bc3 Fix warnings found in DEBUG combined build
Fixes:
* Irrelevant where conditions
* Irrelevant const
* A potential infinite loop in treenode
* Bad implicit case fallthroughs
* Explicit markings for required case fallthroughs
* Unused variables
* Unused function

Also disabled some warnings for now which we should fix later.
2019-12-10 16:33:08 +00:00
70b3aa3159 Merge branch 'develop-1.2' into develop-merge-up-20190924-2 2019-09-24 14:17:57 +01:00
a09a9d5d0f Mass substitution 'Corporaton' -> 'Corporation' 2019-08-07 14:43:25 -05:00
78eb20ef4e MCOL-1559 remove the #define POSIX_REGEX and thus the use of regexec. Fix up the code changing #ifdef _MSC_VER to #ifdef POSIX_REGEX, where it applies to regexec. 2019-07-24 12:59:59 -05:00
5e4f1b9933 Merge branch 'develop' into MCOL-265 2019-06-10 13:58:03 +01:00
020b211bb7 Merge branch 'develop-1.2' into develop-merge-up-20190514 2019-05-14 13:58:33 +01:00
9dc33c4e82 Another try to cope with warnings under gcc 8.2. 2019-04-29 11:05:03 +03:00
4b9d046c6e Fully resolve potentially ambiguous symbols by removing using namespace statements from headers which have a cascading effect. This causes potential behavior changes when switching to c++11 since symbols can be exported from std and boost while both have been imported into the global namespace. 2019-04-29 01:21:15 -05:00