1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-04-21 19:45:56 +03:00

225 Commits

Author SHA1 Message Date
mariadb-DanielLee
8166e0284f Disabled warnings and add drop table commands 2022-08-17 11:29:04 -05:00
mariadb-DanielLee
10a8d274cd Updated reference results to match that of innodb tables 2022-08-17 11:28:05 -05:00
Roman Nozdrin
0f2f0fc0ba
Merge pull request #2507 from denis0x0D/MCOL-4715
MCOL-4715 Mixed inner and outer joins with "null" filter for the table which is not involved into the outer join produces wrong results.
2022-08-17 18:50:43 +03:00
david.hall
5c62d96b71 MCOL-5092 Use sorted_result to get consistent results in mtr 2022-08-17 09:07:47 -05:00
david.hall
5099133642 MCOL-5092 correct mtr result 2022-08-16 09:14:16 -05:00
Denis Khalikov
59166608b1 MCOL-4715 Mixed inner and outer joins with "null" filter for the table which is not involved into the outer join produces wrong results. 2022-08-16 17:13:03 +03:00
david.hall
05bdddf3a9 MCOL-5092 addendum modify moda() mtr tests with order by
fix an issue in moda() evaluate for string types
2022-08-15 15:50:15 -05:00
Roman Nozdrin
56bbef62e6
Merge pull request #2406 from tntnatbry/MCOL-5021-dev
MCOL-5021 AUX column implementation to improve DELETE performance.
2022-08-15 19:03:42 +03:00
David.Hall
2020f35e88
Mcol 5092 MODA uses wrong column width for some types (#2450)
* MCOL-5092 Ensure column width is correct for datatype
                       Change MODA return type to STRING
                       Modify MODA to handle every numeric type
* MCOL-5162 MODA to support char and varchar with collation support

Fixes to the aggregate bit functions
When we fixed the storage sign issue for MCOL-5092, it uncovered a problem in the bit aggregates (bit_and, bit_or and bit_xor). These aggregates should always return UBIGINT, but they relied on the type of the argument column, which gave bad results.
2022-08-11 15:16:11 -05:00
Denis Khalikov
61cf18b92d [MCOL-5167] Add support for on clause filter for a table which is not involved in join.
This patch adds support for on clause filter for a table which is not involved in particular join
by disabling an `merge optimization` for those particular cases.
The `merge optimization` is optimization when CS
tries to create a one BPP join with one `large side` table and multiple `small sides` tables, in this
case we cannot apply a FE filter if this filter requires a columns from `small side` table which is not
involved in particular join.
2022-08-10 10:46:43 +00:00
Daniel Lee
4c9d6e39ac
Dlee mtr restructure (#2494)
* Restructured test suites and added autopilot and extended suites

* Updated autopilot with correct branch - develop

* Moved setup test case to a 'setup' directory, for consistency

* Fixed a path issue

* Updated some tests cases to keep up with development

Co-authored-by: root <root@rocky8.localdomain>
2022-08-09 21:20:56 +03:00
Gagan Goel
0818b95caa MCOL-5021 Update MTR tests to reflect changes introduced by this feature. 2022-08-05 14:40:50 -04:00
mariadb-KirillPerov
d3bc6bf654
Update mcs78_aliases.test 2022-07-31 04:27:13 +03:00
mariadb-KirillPerov
22638de153
Update mcs78_aliases.test 2022-07-31 03:12:29 +03:00
mariadb-KirillPerov
e1199ea622
Update mcs78_aliases.result 2022-07-31 03:11:57 +03:00
mariadb-KirillPerov
5437ab0941
Update mcs171_null_functions.result 2022-07-31 01:13:10 +03:00
mariadb-KirillPerov
a7cf88f2a5
Update mcs171_null_functions.test 2022-07-31 01:12:09 +03:00
Roman Nozdrin
115c9db5e2
Merge pull request #2478 from drrtuy/temp-test-disable
This patch temporary disables the tests to get CI green.
2022-07-27 16:46:50 +03:00
Roman Nozdrin
23bb51c486 This patch temporary disables the tests to get CI green. 2022-07-27 09:32:44 +00:00
Denis Khalikov
e519cd7486
[MCOL-5061] Fix wrong join id assignment for the views. (#2474)
This patch fixes a wrong `join id` assignment for `TupleHashJoinStep` in a view.
After MCOL-334 CS assigns a '-1' as `join id` for `TupleHashJoinStep` in a view, and
in this case we cannot apply a filter for specific `Join step`, which is associated with `join id`
for 2 reasons:
1. Filters for all `TupleHashJoinSteps` associated with the same `join id`, which is '-1'.
2. When CS creates a `joinIdIndexMap` it eliminates all `join ids` which a less or equal 0.

This patch also fixes some tests for the view, which were generated wrong results.
2022-07-25 20:02:02 +03:00
Roman Nozdrin
627a4b5819
Revert "Debug mtr 20220720 (#2470)" (#2473)
This reverts commit 8b8ee98fd2b299bbc149545d368ed29de1c85b7e.

Co-authored-by: Roman Nozdrin <rnozdrin@mariadb.com>
2022-07-23 13:50:14 +03:00
mariadb-KirillPerov
8b8ee98fd2
Debug mtr 20220720 (#2470)
* Update udf_calshowpartitions.test

* Update mcs_named_udfs.test

* Update udf_calshowpartitions.result

* Update mcs_named_udfs.result
2022-07-22 20:42:22 +03:00
Denis Khalikov
636e60b5f9 [MCOL-4699] Add support for circular outer joins. 2022-07-19 21:47:36 +03:00
Daniel Lee
7481f27343 Added order by clause to more queries 2022-07-12 09:49:24 -05:00
Daniel Lee
7ecf183af9 Added reference result files 2022-07-12 09:49:23 -05:00
Daniel Lee
ff20612a87 Added missing drop database statement 2022-07-12 09:49:23 -05:00
Daniel Lee
08ee2af4fa Avoid warning regarding undeterministic functions when binlog is enabled 2022-07-12 09:49:23 -05:00
Daniel Lee
7ebeee06e9 Need to add order by clause since different test run would return rows in different order 2022-07-12 09:49:23 -05:00
David.Hall
08bef648b3
Mcol 5074 Case with In and aggregates asserts (#2435)
* MCOL-5074 CASE with IN and aggregate asserts
gwip-scsp wasn't set and buildPredicateItem() was called which assumes it is set. Added code to set properly in this case
2022-07-11 16:20:15 -05:00
mariadb-RomanNavrotskiy
194f0e9d64
ci: new builds grid, parallel steps 2022-07-08 22:30:02 +02:00
Roman Nozdrin
38c4b973dd
Merge pull request #2421 from denis0x0D/MCOL-4778
[MCOL-4778] Return if we have an error in push_down_init.
2022-07-04 21:16:13 +03:00
Roman Nozdrin
7d955a0f85 This patch fixes changed errno brought by the recent 10.8 changes 2022-07-02 17:12:50 +03:00
Denis Khalikov
e8f83121d2 [MCOL-4778] Return if we have an error in push_down_init. 2022-06-21 00:06:25 +03:00
Andrey Piskunov
c7e67aedd9 Renamed variables + removed server tests 2022-06-03 15:30:25 +03:00
Andrey Piskunov
66c69c7609 Welford's algorithm STD and VAR on window functions 2022-06-03 15:29:30 +03:00
Andrey Piskunov
c5fa27475d 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-03 15:29:30 +03:00
Commander thrashdin
f28e00c206 No repeating code in client_udfs + better test 2022-03-28 21:48:47 +03:00
Commander thrashdin
876a66cbc3 Added crude tests for cal/mcs client UDFs 2022-03-28 21:48:47 +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
benthompson15
4b412d4e09
MCOL-4940: test case for ROUND fix (#2271) 2022-02-21 16:09:31 -06: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
Roman Nozdrin
7cfcdf365d
Merge pull request #2211 from drrtuy/MCOL-4899-dev
MCOL-4899 MCS now applies a correct collation running IN for characte…
2022-01-06 21:08:11 +03:00
Roman Nozdrin
05897948e4 MCOL-4899 MCS now applies a correct collation running IN for character data types 2022-01-05 12:00:01 +00:00
Roman Nozdrin
695b437730 The goal is to migrate the last offending regr test001 test case into MTR to make test001 green 2021-12-30 19:12:58 +00:00
Gagan Goel
8cab54fe31 MCOL-4868 Move test cases for MCOL-4264 to MTR. 2021-12-20 18:34:08 +00:00
Roman Nozdrin
a31066ff0e MCOL-4871 This patch adds relevant tests 2021-12-17 17:41:07 +00:00
Gagan Goel
7f456e58cc 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 23:11:26 +00:00
Gagan Goel
340a90fc8d 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 22:26:52 +00:00
Alexander Barkov
fa9f18553a 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:00:56 +04:00
Roman Nozdrin
83c0c84aea
This patch adds MTR's --sorted_result option to make the tests outputs deterministic (#2107) 2021-09-01 23:43:29 +03:00