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

23 Commits

Author SHA1 Message Date
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
Leonid Fedorov
3919c541ac
New warnfixes (#2254)
* Fix clang warnings

* Remove vim tab guides

* initialize variables

* 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length

* Fix ISO C++17 does not allow 'register' storage class specifier for outdated bison

* chars are unsigned on ARM, having  if (ival < 0) always false

* chars are unsigned by default on ARM and comparison with -1 if always true
2022-02-17 13:08:58 +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
Gagan Goel
6aea838360 MCOL-641 Add support for functions (Part 2). 2020-11-18 13:51:55 +00:00
Gagan Goel
2ba9263df4 Silence -Werror=implicit-fallthrough compiler errors - Patch from Monty.
The patch also fixes some potential bugs due to missing break
statements.
2020-06-26 12:32:57 -04:00
Patrick LeBlanc
d6ef3cad3d Merge pull request #1049 from pleblanc1976/mcol-3776
Mcol 3776 - shared but unsync'd timezone var
2020-02-28 13:58:51 -05:00
jmrojas2332
c29c41e235 MCOL 3474 Fix Timediff results after accounting for new test cases 2019-12-04 22:48:07 +00:00
jmrojas2332
252268ef63 MCOL 3474 Fix TIMEDIFF w/ non-temporal data types 2019-12-03 06:47:36 +00:00
Ubuntu
23b87f449d MCOL 3597 Fix MCOL 3474 causing regression test failure. New impl for MCOL 3474 2019-11-14 16:56:46 +00:00
Jose Rojas
46e2701fed MCOL-3474 TIMEDIFF() returns incorrect result fix 2019-10-17 21:19:10 +00:00
Andrew Hutchings
811909aa72 Merge branch 'develop-1.2' into develop-merge-up-20190729 2019-07-29 12:19:26 +01:00
Andrew Hutchings
1db56546ee TIMESTAMP namespace fixes
Namespace issues in the TIMESTAMP code caused compiling to break. This
patch fixes that.
2019-06-12 15:05:20 +01:00
Andrew Hutchings
0983c1becf MCOL-2230 Fix TIMEDIFF() handling
TIMEDIFF would not compare datetime with string correctly, causing a
NULL saturation.
2019-06-10 16:46:24 +01:00
Gagan Goel
e89d1ac3cf MCOL-265 Add support for TIMESTAMP data type 2019-04-23 00:00:09 -04:00
Andrew Hutchings
a127f84793 MCOL-1433 Fix TIME for MAKEDATE/TIMEDIFF
Fix saturation behaviour for TIME with MAKEDATE() and TIMEDIFF()
2018-10-04 16:53:14 +01:00
Andrew Hutchings
580a3ec123 MCOL-1647 Fix TIME regressions
Fixes the following:

* Read past buffer end in intToDatetime / intToTime
* Allow intToTime to convert datetime
* Allow intToTime to convert shortened time values
* Allow stringToTime to convert datetime and int time values
* Fix saturation / bad values in intToTime and stringToTime
* Fix TIME return in STR_TO_DATE()
* Fix NULL return on type inequality for TIMEDIFF()
* Fix zero day calculation error in ADDTIME()/SUBTIME()
* Fix DATETIME to int calculation error in aggregate bit operations
* Make the new harderning flags optional with -DSECURITY_HARDENED_NEW
2018-08-17 07:55:51 +01:00
Andrew Hutchings
fb8aab959d MCOL-1433 Fix some functions for TIME
Fixes the following:

* CAST() (as DATE/DATETIME)
* DATE()
* DATE_FORMAT()
* MAKEDATE()
* NULLIF()
* TIMEDIFF()
* TO_DAYS() / DATEDIFF()
2018-07-12 15:13:43 +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
28fe2c0b70 MCOL-664 Add function support for TEXT
For the initial BLOB/TEXT pull request we put them in the same bucket as
VARBINARY, forcing many functions to be disabled. This patch enables the
same TEXT function support as VARCHAR.
2017-04-15 07:22:05 +02:00
david hill
f6afc42dd0 the begginning 2016-01-06 14:08:59 -06:00