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

151 Commits

Author SHA1 Message Date
77ee28d3b9 Update mcs117_create_utf8.test 2022-11-04 03:17:31 +06:00
fd614c01d8 Update mcol_2000.test 2022-11-04 03:17:31 +06:00
c3b1ad9be2 Update mcs78_aliases.result 2022-08-19 22:45:25 +03:00
4873fd5fd3 Update mcs171_null_functions.result 2022-08-19 22:44:12 +03:00
2f4108be00 Changes to some MTR cases so that they would match in VMs and Docker image runs (#2447)
* Need to add order by clause since different test run would return rows in different order

* Avoid warning regarding undeterministic functions when binlog is enabled

* Added missing drop database statement

* Added reference result files

* Added order by clause to more queries
2022-07-12 09:14:38 -05:00
de1d1d4891 [MCOL-4778] Return if we have an error in push_down_init. (#2420) 2022-06-20 17:20:52 -04:00
b5d3663936 Renamed variables + removed server tests 2022-06-06 21:32:53 +03:00
bb0f345d3e Welford's algorithm STD and VAR on window functions 2022-06-06 21:32:33 +03:00
eec85f1118 Welford algorithm for STD and VAR
Naive algorithm for calculating STD and VAR is subject to catastrophic
cancellation. A well-known Welford's algorithms is used instead.
2022-06-06 21:32:20 +03:00
73697f1190 Danielmtrupdate2 (#2360)
* Removing extra line in test result

* Default charset has been set to utf8mb3
2022-05-05 10:22:29 -05:00
51dc96e9c9 Set server defaults to keep test results consistent since some test cases check for that (#2359) 2022-05-02 17:23:34 -05:00
ec2e490737 Danielsmtrupdate (#2357)
* Old precision issue.  New results matching server results now

* Value overflow issue.  New result matching server result now

* Showing correct column name now

* Added --disable_warning to subpress warnings that cause result mismatched

* Need to add one more result file
2022-05-02 11:49:42 -05:00
bcdf677c48 MCOL-4940 Add an ORDER BY clause to the test query to make the result set deterministic (#2341) 2022-04-22 11:24:49 -05:00
41d2b3e9e0 MCOL-4940: test case for ROUND fix (#2270) 2022-02-21 16:09:25 -06:00
1fc399451a 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-11 19:03:32 -05:00
f7417c0b10 MCOL-4809 This patch adds support for float data types filtering and scanning vectorization 2022-02-03 16:02:37 +00:00
501225ea8f Merge pull request #2208 from drrtuy/MCOL-4899-dev6
MCOL-4899 MCS now applies a correct collation running IN for characte…
2022-01-06 21:07:57 +03:00
fa31214eb1 MCOL-4899 MCS now applies a correct collation running IN for character data types 2022-01-05 11:59:11 +00:00
1352fbecf7 The goal is to migrate the last offending regr test001 test case into MTR to make test001 green 2021-12-29 17:21:12 +00:00
1f638544f6 MCOL-4868 Move test cases for MCOL-4264 to MTR. 2021-12-20 13:25:27 -05:00
26e89027de MCOL-4871 This patch adds relevant tests 2021-12-17 12:51:42 +00:00
1284b982f3 MCOL-4868 UPDATE on a ColumnStore table containing an IN-subquery
on a non-ColumnStore table does not work.

As part of MCOL-4617, we moved the in-to-exists predicate creation
and injection from the server into the engine. However, when query
with an IN Subquery contains a non-ColumnStore table, the server
still performs the in-to-exists predicate transformation for the
foreign engine table. This caused ColumnStore's execution plan to
contain incorrect WHERE predicates. As a fix, we call
mutate_optimizer_flags() for the WRITE lock, in addition to the READ
table lock. And in mutate_optimizer_flags(), we change the optimizer
flag from OPTIMIZER_SWITCH_IN_TO_EXISTS to OPTIMIZER_SWITCH_MATERIALIZATION.
2021-12-16 12:53:19 -05:00
ecc6c16c63 MCOL-4874 Crossengine JOIN involving a ColumnStore table and a
wide decimal column in a non-ColumnStore table throws an exception.

ROW::getSignedNullValue() method does not support wide decimal fields
yet. To fix this exception, we remove the call to this method from
CrossEngineStep::setField().
2021-12-08 16:46:53 -05:00
7019db6341 MCOL-4728 Query with unusual use of aggregate functions on ColumnStore table crashes MariaDB Server
After an AggreateColumn corresponding to SUM(1+1) is created,
it is pushed to the list:

    gwi.count_asterisk_list.push_back(ac)

Later, in getSelectPlan(), the expression SUM(1+1) was erroneously
treated as a constant:

  if (!hasNonSupportItem && !nonConstFunc(ifp) && !(parseInfo & AF_BIT) && tmpVec.size() == 0)
  {
     srcp.reset(buildReturnedColumn(item, gwi, gwi.fatalParseError));

This code freed the original AggregateColumn and replaced to a ConstantColumn.

But gwi.count_asterisk_list still pointer to the freed AggregateColumn().

The expression SUM(1+1) was treated as a constant because tmpVec
was empty due to a bug in this code:

                    // special handling for count(*). This should not be treated as constant.
                    if (isp->argument_count() == 1 &&
                            ( sfitempp[0]->type() == Item::CONST_ITEM &&
                                (sfitempp[0]->cmp_type() == INT_RESULT ||
                                 sfitempp[0]->cmp_type() == STRING_RESULT ||
                                 sfitempp[0]->cmp_type() == REAL_RESULT ||
                                 sfitempp[0]->cmp_type() == DECIMAL_RESULT)
                            )
                        )
                    {
                        field_vec.push_back((Item_field*)item); //dummy

Notice, it handles only aggregate functions with explicit literals
passed as an argument, while it does not handle constant expressions
such as 1+1.

Fix:

- Adding new classes ConstantColumnNull, ConstantColumnString,
  ConstantColumnNum, ConstantColumnUInt, ConstantColumnSInt,
  ConstantColumnReal, ValStrStdString, to reuse the code easier.

- Moving a part of the code from the case branch handling CONST_ITEM
  in buildReturnedColumn() into a new function
  newConstantColumnNotNullUsingValNativeNoTz(). This
  makes the code easier to read and to reuse in the future.

- Adding a new function newConstantColumnMaybeNullFromValStrNoTz().
  Removing dulplicate code from !!!four!!! places, using the new
  function instead.

- Adding a function isSupportedAggregateWithOneConstArg() to
  properly catch all constant expressions. Using the new function parse_item()
  in the code commented as "special handling for count(*)".
  Now it pushes all constant expressions to field_vec, not only
  explicit literals.

- Moving a part of the code from buildAggregateColumn()
  to a helper function processAggregateColumnConstArg().
  Using processAggregateColumnConstArg() in the CONST_ITEM
  and NULL_ITEM branches.

- Adding a new branch in buildReturnedColumn() handling FUNC_ITEM.
  If a function has constant arguments, a ConstantColumn() is
  immediately created, without going to
  buildArithmeticColumn()/buildFunctionColumn().

- Reusing isSupportedAggregateWithOneConstArg()
  and processAggregateColumnConstArg() in buildAggregateColumn().
  A new branch catches aggregate function has only one constant argument
  and immediately creates a single ConstantColumn without
  traversing to the argument sub-components.
2021-09-21 14:01:24 +04:00
18325638a4 This patch adds MTR's --sorted_result option to make the tests outputs deterministic (#2106) 2021-09-01 23:42:40 +03:00
ea92671929 MCOL-3741 dev6 Change mtr IDB-xxx error codes to MCS-xxxx 2021-08-10 12:06:20 -05:00
ef89ef4155 Merge pull request #2061 from mariadb-corporation/bar-develop-6-MCOL-4823
MCOL-4823 WHERE char_col<varchar_col returns a wrong result of a larg…
2021-08-03 11:53:32 +03:00
d569eec27c MCOL-4823 WHERE char_col<varchar_col returns a wrong result of a large table
SCommand StrFilterCmd::duplicate() missed these two lines:

    filterCmd->leftColType = leftColType;
    filterCmd->rightColType = rightColType;

which exist in the parent's FilterCommand::duplicate().

Rewriting the code to avoid duplication by using more inherited
methods/constructors. This reduces the probability of similar bugs
in the future.
2021-07-30 06:43:32 +04:00
a202bda485 MCOL-4719 iterate into subquery looking for windowfunctions
When an outer query filter accesses an subquery column that contains an aggregate or a window function, certain optimizations can't be performed. We had been looking at the surface of the returned column. We now iterate into any functions or operations looking for aggregates and window functions.
2021-07-22 13:56:21 -05:00
6e45c125c7 Merge pull request #2047 from dhall-MariaDB/develop
Disable the non-deterministic mcs211 test
2021-07-12 17:53:33 -05:00
10cc1159a2 Merge pull request #2040 from tntnatbry/MCOL-641-move-mtr-tests
MCOL-641 Move MTR tests from future/ to basic/
2021-07-12 15:47:45 -05:00
2b37c2c7bc Merge pull request #2046 from denis0x0D/MCOL-4786_fix_regression
[MCOL-4786] Fix filter comparison.
2021-07-12 13:51:42 -05:00
497d12e08f Remove the non-deterministic mcs211 test 2021-07-12 12:26:41 -05:00
dc51dbf6cf [MCOL-4786] Fix filter comparison.
Compare ParseTree by dereferencing pointers.
2021-07-12 19:18:02 +03:00
78dbf3a7e1 MCOL-641 Move MTR tests from future/ to basic/ 2021-07-12 13:01:45 +00:00
3d557a2f1e Merge pull request #2044 from dhall-MariaDB/MCOL-3738
MCOL-3738 COUNT(DISTINCT) with multiple parms
2021-07-12 07:34:56 -04:00
69eec2cc0f MCOL-2044 Test sources made more resilient 2021-07-09 18:21:08 +03:00
76607be63a MCOL-3738 COUNT(DISTINCT) with multiple parms
Fixed regression
Added a few more mtr tests
2021-07-09 09:07:03 -05:00
4d265472ee Merge pull request #2036 from mariadb-SergeyZefirov/MCOL-4766-UPDATE-INSERT-in-a-transaction-does-not-revert-back-extent-ranges-on-a-rollback
MCOL-4766 ROLLBACK kept ranges changed inside rolled back transaction
2021-07-09 16:33:06 +03:00
adace6e0c7 MCOL-4786 Fix wrong comparison for the filters.
Fix wrong comparison for the filters while creating case function.
2021-07-09 12:18:26 +03:00
9e0851e4cf MCOL-4766 ROLLBACK kept ranges changed inside rolled back transaction
Now ROLLBACK drops ranges to INVALID state which makes engine to rescan
blocks and discover correct ranges.
2021-07-07 18:16:56 +03:00
74bdf522d1 Merge pull request #1999 from mariadb-SergeyZefirov/MCOL-4741-in-like-equal-returns-different-result
MCOL-4741 Fix extentmap handling of string prefixes encoded as 64-bit integers
2021-07-05 04:33:32 -04:00
237cad347f MCOL-4758 Limit LONGTEXT and LONGBLOB to 16MB (#1995)
MCOL-4758 Limit LONGTEXT and LONGBLOB to 16MB

Also add the original test case from MCOL-3879.
2021-07-05 02:09:41 -04:00
a576981db0 MCOL-1205 Remove old tests.
This patch removes some tests which check `circular join` error.
2021-07-03 15:29:35 +03:00
0553093986 Merge pull request #2023 from dhall-MariaDB/MCOL-4789
MCOL-4789 mcs51_cpimport_select_from is not deterministic
2021-07-02 13:31:54 -05:00
c58136a32d MCOL-4741 in/like/equal(=) operations differ in results
This is due to signedness in the string range comparison in extentmap
and unsignedness everywhere else.
2021-07-02 19:22:46 +03:00
1d5f309b8f MCOL-1205 Support queries with circular joins
This patch adds support for queries with circular joins.
Currently support added for inner joins only.
2021-07-02 18:37:07 +03:00
20d90c6293 MCOL-4789 mcs51_cpimport_select_from is not deterministic
Testing script was left in.
2021-07-02 09:21:31 -05:00
6dc356ed60 Merge pull request #1989 from denis0x0D/MCOL-4713
MCOL-4713 Analyze table implementation.
2021-07-02 16:17:07 +03:00
c20015a7b2 MCOL-4713 Analyze table implementation. 2021-07-02 12:37:12 +03:00