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

105 Commits

Author SHA1 Message Date
c46a0ab5f0 bug(funcexp): Fixes MCOL-5599 where LIKE operator never finishes (#3116)
This is a fix of logging subsystem, nothing else.

The old code expanded an argument into string and advanced too little
and, if expansion contained argument's index, it expanded it again. And
again.

Co-authored-by: Serguey Zefirov <serguey.zefirov@mariadb.com>
2024-02-05 18:31:57 +03:00
2eca3ee656 fix(funcexp): MCOL-5607: JSON function use crashes query execution (#3028)
JSON functions were implemented violating an assumption of their
pureness, as they should not have any state. This concrete patch
fixes implementation of JSON_VALUE function.
2024-01-10 14:51:28 +00:00
1935c9c1da MCOL-5625: Fixes json_query implementation
Also extends func_json_value.test.
2024-01-10 18:22:16 +04:00
4d4e4ad30d Merge pull request #2741 from mariadb-corporation/MDEV-25080-CS-dev
MDEV-25080 Allow pushdown of queries involving UNIONs in outer select to ColumnStore
2023-02-28 11:23:50 +00:00
b6808c97f1 MCOL-4530: common conjuction top rewrite (#2673)
Added logical transformation of the execplan::ParseTrees with the taking out the common factor in expression of the form "(A and B) or (A and C)" for the purposes of passing a TPCH 19 query.

Co-authored-by: Leonid Fedorov <leonid.fedorov@mariadb.com>
2023-02-27 19:23:19 +03:00
157d0f9b8c MDEV-25080 Add --sorted_result MTR qualifier to some UNION tests. 2023-02-27 06:38:31 -05:00
2f1f9c0ef0 MDEV-25080 Some fixes:
1. In TupleUnion::writeNull(), add the missing switch case for
   wide decimal with 16bytes column width.
2. MCOL-5432 Disable complete/partial pushdown of UNION operation
   if the query involves an ORDER BY or a LIMIT clause, until
   MCOL-5222 is fixed. Also add MTR test cases for this.
2023-02-27 06:38:31 -05:00
e987a766e0 MDEV-25080 Some updates to the MDEV-25080 MTR test cases. 2023-02-27 06:38:31 -05:00
86dcf92d56 MCOL-5215 Fix overflow of UNION operation involving DECIMAL datatypes.
When a UNION operation involving DECIMAL datatypes with scale and digits
before the decimal exceeds the currently supported maximum precision
of 38, we throw an error to the user:
"MCS-2060: Union operation exceeds maximum DECIMAL precision of 38".

This is until MCOL-5417 is implemented where ColumnStore will have
full parity with MariaDB server in terms of maximum supported DECIMAL
precision and scale of 65 and 38 digits respectively.
2023-02-27 06:38:31 -05:00
45a779f743 MDEV-25080 Implement ColumnStore-side changes for pushdown of SELECT_LEX_UNITs. 2023-02-27 06:38:31 -05:00
242bc75166 MCOL-5195 Correlated subquery with equi/non-equi scalar filter and join condition
Disable check for correlated subqueries, basically those types of queries transforms
to join (aggr(table2), table1), table2) and post join scalar filter.
2022-12-23 18:33:01 +03:00
f090e65298 More changes 2022-12-08 21:00:01 +00:00
fad0fd08f0 Disable warnings for 'drop if exists' and 'create if not exist' commands 2022-12-08 11:37:44 -06:00
c0d772559e Moved one more test case to 1pmonly folder 2022-12-02 14:30:43 +00:00
814fc37081 Moved some MTR cases to a new 1pmonly directory. Also added order by clause to few cases 2022-11-30 23:40:41 +00:00
8b4be1b7f9 func json_arrayagg test adjustments 2022-11-02 16:07:45 +02:00
33b09f5499 Add truncate for result consistency 2022-10-31 20:38:08 +03:00
d7f4ec73c5 Small fixes + test sorting 2022-10-31 14:56:32 +02:00
315e4be2d8 First working attempt for json_arrayagg 2022-10-31 14:56:32 +02:00
85a6121f76 Mtrfix kp 220926 (#2580)
* Update mcol_2000.test

* Update mcs117_create_utf8.test

* Update mcs12_alter_table.test

* Update mcs13_alter_table_negative.test

* Update mcs169_bin_functions.test

* Update mcs171_null_functions.test

* Update mcs173_coalesce_function.test

* Update mcs174_case_function.test

* Update mcs175_convert_functions.test

* Update mcs176_if_function.test

* Update mcs178_adddate_function.test

* Update mcs179_addtime_function.test

* Update mcs180_ascii_function.test

* Update mcs181_between_and.test

* Update mcs182_char_length_function.test

* Update mcs183_date_function.test

* Update mcs184_day_function.test

* Update mcs185_dayname_function.test

* Update mcs186_dayofyear_function.test

* Update mcs187_dayofmonth_function.test

* Update mcs1_create_table_data_types.test

* Update mcs19_grant_revoke.test

* Update mcs229_data_compression_type.test

* Update mcs28_load_data_local_infile.test

* Update mcs2_create_table_valid_names.test

* Update mcs5_create_table_from_other_tables.test

* Update mcs74_check_constraint.test

* Update mcs7_create_table_with_metadata.test

* Update mcs87_alter_column.test

* Update mcs8_create_table_with_constraints.test

* Update disabled.def

* Update mcs19_grant_revoke.test

* Update mcs19_grant_revoke.test

* Update mcs19_grant_revoke.test
2022-10-07 11:36:29 +03:00
2606c91afd Dlee 22.08.2 updates (#2578)
* Sort test result so the test case would pass

* Server message has been changes

* Added schema name in query for rows in test case only.  Also use lower case schema name

* Changed database to lower case

* Run test case in its own database to avoid table already exists error

Co-authored-by: root <root@rocky8.localdomain>
2022-10-05 16:56:57 -05:00
80a2d8e9f5 Add tests for window functions 2022-09-30 18:26:37 +03:00
6c4af1461f [MCOL-5205] Fix bug from union type in UNION processing.
This patch fixs the reported JIRA issue MCOL 5205, which consists of a wrong union type from two input Int types. The bug results in wrong unioned answers in CS. The fix includes more INT case discussions. Additionaly, this patch provides detailed unit tests for correctness in UNION processing with Int.

Signed-off-by: Jigao Luo <luojigao@outlook.com>
2022-09-09 22:54:35 +02:00
cdd41f05f3 MCOL-785 Implement DISTRIBUTED JSON functions
The following functions are created:
Create function JSON_VALID and test cases
Create function JSON_DEPTH and test cases
Create function JSON_LENGTH and test cases
Create function JSON_EQUALS and test cases
Create function JSON_NORMALIZE and test cases
Create function JSON_TYPE and test cases
Create function JSON_OBJECT and test cases
Create function JSON_ARRAY and test cases
Create function JSON_KEYS and test cases
Create function JSON_EXISTS and test cases
Create function JSON_QUOTE/JSON_UNQUOTE and test cases
Create function JSON_COMPACT/DETAILED/LOOSE and test cases
Create function JSON_MERGE and test cases
Create function JSON_MERGE_PATCH and test cases
Create function JSON_VALUE and test cases
Create function JSON_QUERY and test cases
Create function JSON_CONTAINS and test cases
Create function JSON_ARRAY_APPEND and test cases
Create function JSON_ARRAY_INSERT and test cases
Create function JSON_INSERT/REPLACE/SET and test cases
Create function JSON_REMOVE and test cases
Create function JSON_CONTAINS_PATH and test cases
Create function JSON_OVERLAPS and test cases
Create function JSON_EXTRACT and test cases
Create function JSON_SEARCH and test cases

Note:
Some functions output differs from MDB because session variables that affects functions output,e.g JSON_QUOTE/JSON_UNQUOTE
This depends on MCOL-5212
2022-08-30 22:22:23 +08:00
50d95bf60a MCOL-5196 REPLACE function may trigger invalid capacity assertion (#2522)
When length of string to replace minus length of string to replace to is
bigger than input string and processing mode allows for binary (memcmp
or std::string::find()) comparison, REPLACE may trigger invalid capacity
assertion and query processing will stop.

The fix is to properly count the number of occurences of the string to
replace, basically.
2022-08-22 21:34:38 +03:00
5c62d96b71 MCOL-5092 Use sorted_result to get consistent results in mtr 2022-08-17 09:07:47 -05:00
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
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
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
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
0818b95caa MCOL-5021 Update MTR tests to reflect changes introduced by this feature. 2022-08-05 14:40:50 -04:00
d3bc6bf654 Update mcs78_aliases.test 2022-07-31 04:27:13 +03:00
22638de153 Update mcs78_aliases.test 2022-07-31 03:12:29 +03:00
a7cf88f2a5 Update mcs171_null_functions.test 2022-07-31 01:12:09 +03:00
23bb51c486 This patch temporary disables the tests to get CI green. 2022-07-27 09:32:44 +00:00
636e60b5f9 [MCOL-4699] Add support for circular outer joins. 2022-07-19 21:47:36 +03:00
7481f27343 Added order by clause to more queries 2022-07-12 09:49:24 -05:00
ff20612a87 Added missing drop database statement 2022-07-12 09:49:23 -05:00
08ee2af4fa Avoid warning regarding undeterministic functions when binlog is enabled 2022-07-12 09:49:23 -05:00
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
194f0e9d64 ci: new builds grid, parallel steps 2022-07-08 22:30:02 +02:00
7d955a0f85 This patch fixes changed errno brought by the recent 10.8 changes 2022-07-02 17:12:50 +03:00
c7e67aedd9 Renamed variables + removed server tests 2022-06-03 15:30:25 +03:00
66c69c7609 Welford's algorithm STD and VAR on window functions 2022-06-03 15:29:30 +03:00
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
f28e00c206 No repeating code in client_udfs + better test 2022-03-28 21:48:47 +03:00
876a66cbc3 Added crude tests for cal/mcs client UDFs 2022-03-28 21:48:47 +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
a31066ff0e MCOL-4871 This patch adds relevant tests 2021-12-17 17:41:07 +00:00
83c0c84aea This patch adds MTR's --sorted_result option to make the tests outputs deterministic (#2107) 2021-09-01 23:43:29 +03:00