1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-04-24 18:27:02 +03:00

28 Commits

Author SHA1 Message Date
Leonid Fedorov
0c3d4004bf regexp_replace, regexp_substr and regexp_instr functions 2024-03-11 15:45:34 +00:00
Sergey Zefirov
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
Serguey Zefirov
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
Gagan Goel
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
Leonid Fedorov
04752ec546 clang format apply 2022-01-21 16:43:49 +00:00
Leonid Fedorov
01f3ceb437 replace header guards with #pragma once 2022-01-21 15:24:58 +00:00
benthompson15
870d672efb MCOL-4044: Add oracle mode functions. 2021-04-21 16:07:42 -05:00
benthompson15
3e9b7b3401 Initial commit for Encode/Decode. 2020-12-01 12:39:56 -06:00
benthompson15
eac7dab096 MCOL-4030: first commit of warning removals unneed const and missing virtual dtors. 2020-06-23 13:51:36 -05:00
Patrick LeBlanc
4bddc92092 MCOL-4010 - fixes compilation errors on x64 w/-Werror
Merged in Sergei's patch.
2020-06-01 12:52:43 -04:00
Gagan Goel
feaa9cb659 Implement SPACE() and QUOTE() functions. 2019-12-10 14:18:28 +00:00
Patrick LeBlanc
a09a9d5d0f Mass substitution 'Corporaton' -> 'Corporation' 2019-08-07 14:43:25 -05:00
Andrew Hutchings
5e4f1b9933
Merge branch 'develop' into MCOL-265 2019-06-10 13:58:03 +01:00
David Mott
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
Gagan Goel
e89d1ac3cf MCOL-265 Add support for TIMESTAMP data type 2019-04-23 00:00:09 -04:00
David Hall
c3f8148fff MCOL-2182 Change in MariaDB 10.3 allows for only 2 parameters to lpad and rpad 2019-03-08 15:14:42 -06:00
David Hall
3f2c753947 MCOL-1822-c final checkin 2019-03-05 09:33:39 -06:00
David Hall
a2aa4b8479 MCOL-1822 Intermediate checkin. DISTINCT not working. 2019-02-25 14:54:46 -06:00
David Hall
c5b9ae11e5 MCOL-1822 add LONG DOUBLE support 2019-01-29 09:55:43 -06:00
Andrew Hutchings
85121060fb Merge branch 'develop-1.1' into 1.1-merge-up-2018-11-08 2018-11-08 18:39:44 +00:00
Andrew Hutchings
65287a0613 MCOL-1826 Fix race in FLOAT/DOUBLE to string
In the FLOAT/DOUBLE to string conversions a class global string was used
to store the result. Unfortunately it is possible for an instance of
this class to be used by multiple threads of PrimProc simultaneously.
This would cause a race and data corruption or more likely a crash.

This fix passes a string object from the caller to use instead.
2018-10-22 17:56:49 +01:00
Andrew Hutchings
443a2867c4 MCOL-1385 Initial 10.3 support 2018-08-02 14:55:01 +01:00
Andrew Hutchings
c40903de9b MCOL-392 Apply astyle
Make this branch apply our style guidelines
2018-05-01 09:52:26 +01:00
Andrew Hutchings
3c1ebd8b94 MCOL-392 Add initial TIME datatype support 2018-04-30 09:42:41 +01:00
Andrew Hutchings
01446d1e22 Reformat all code to coding standard 2017-10-26 17:18:17 +01:00
Andrew Hutchings
e090917ca0 MCOL-471 Fix GCC 6.3 support
isnan requires std:: namespace
2016-12-16 10:07:32 +00:00
Andrew Hutchings
0da005ddae MCOL-328 Fix func float -> str conversion
Functions such as reverse() that do float/double to string conversion
use printf's %g to do it. Unfortunately this adds a '+' symbol before
the exponent symbol. MariaDB doesn't do this.

This patch builds the string in a way that does not have that problem,
it resembles the way it is done elsewhere in the codebase.
2016-10-03 21:03:07 +01:00
david hill
f6afc42dd0 the begginning 2016-01-06 14:08:59 -06:00