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

1671 Commits

Author SHA1 Message Date
Serguey Zefirov
ef592038cb fix(MCOL-5396): Fix possible infinite loop in plugin--PrimProc communication
If you manage to shut down PrimProc just before plugin is trying to send
Calpont Select Execution Plan to PrimProc, you now get a nice error
message about PrimProc being down instead of endless logs of failed
reconnection attempts.
2025-03-11 17:11:01 +04:00
Sergey Zefirov
e99db9c212
fix(plugin): MCOL-4942 No-table-SELECT now can return empty set (#3415)
The query like "SELECT 1 WHERE 1=0" was returning a row despite
unsatisfiable condition in WHERE. Now it returns an empty set.
2025-03-05 07:36:05 +00:00
Aleksei Antipovskii
0885ccc6e8 more overrides 2025-02-21 20:02:38 +04:00
Aleksei Antipovskii
b5bc649923 add missing override 2025-02-21 20:02:38 +04:00
Aleksei Antipovskii
5556d818f8 chore(codestyle): mark virtual methods as override 2025-02-21 20:02:38 +04:00
drrtuy
6001db44ab
fix(BRM): MCOL-5879 DBRM::clearShm runs crit sections w/o sync mechanism (#3390) 2025-02-20 16:33:28 +00:00
Serguey Zefiov
8b9db66ddd fix(MCOL-5889): Improper handle of DOUBLE result type with DECIMAL arguments
Sometimes server assigns DOUBLE type for arithmetic operations over
DECIMAL arguments. In this rare case width of result was incorrectly
adjusted and it triggered an assertion.

Now width of result gets adjusted only if result type is also DECIMAL.
2025-02-12 12:26:09 +03:00
mariadb-AlanMologorsky
50a9f82f76 fix(client): MCOL-5587: Add quick-max-column-width for maridb clients. 2024-12-22 16:59:39 +04:00
Sergey Zefirov
3bc8bd8cc6
fix(group by, having): MCOL-5776: GROUP BY/HAVING closer to server's (#3257)
This patch introduces an internal aggregate operator SELECT_SOME that
is automatically added to columns that are not in GROUP BY. It
"computes" some plausible value of the column (actually, last one
passed).

Along the way it fixes incorrect handling of HAVING being transferred
into WHERE, window function handling and a bit of other inconsistencies.
2024-12-20 19:12:32 +00:00
Alexey Antipovsky
61200f532f
fix(aggregation): remove double returnMemory() (#3366) 2024-12-06 15:10:24 +00:00
Serguey Zefirov
38fd96a663 fix(memory leaks): MCOL-5791 - get rid of memory leaks in plugin code
There were numerous memory leaks in plugin's code and associated code.
During typical run of MTR tests it leaked around 65 megabytes of
objects. As a result they may severely affect long-lived connections.

This patch fixes (almost) all leaks found in the plugin. The exceptions
are two leaks associated with SHOW CREATE TABLE columnstore_table and
getting information of columns of columnstore-handled table. These
should be fixed on the server side and work is on the way.
2024-12-04 10:59:12 +03:00
drrtuy
6445f4dff3
feat(joblist,runtime): this is the first part of the execution model that produces a workload that can be predicted for a given query.
* feat(joblist,runtime): this is the first part of the execution model that produces a workload that can be predicted for a given query.
  - forces to UM join converter to use a value from a configuration
  - replaces a constant used to control a number of outstanding requests with a value depends on column width
  - modifies related Columnstore.xml values
2024-12-03 22:17:49 +00:00
Serguey Zefirov
0bc384d5f0 fix(ubsan): MCOL-5844 - iron out UBSAN reports
The most important fix here is the fix of possible buffer overrun in
DATEFORMAT() function. A "%W" format, repeated enough times, would
overflow the 256-bytes buffer for result. Now we use ostringstream to
construct result and we are safe.

Changes in date/time projection functions made me fix difference between
us and server behavior. The new, better behavior is reflected in changes
in tests' results.

Also, there was incorrect logic in TRUNCATE() and ROUND() functions in
computing the decimal "shift."
2024-12-02 20:18:13 +03:00
drrtuy
c6b747b7c0
fix(DEC):MCOL-5805,5808 to resolve UM-only node crash inside DEC when there is no local PP to send the local requests to. (#3349) 2024-11-11 18:29:53 +00:00
Alexey Antipovsky
6f4274760e
fix(plugin): MCOL-5703 fix server crash on 'UNION ALL VALUES' queries (#3335)
* fix(plugin): MCOL-5703 fix server crash on 'UNION ALL VALUES' queries
2024-11-10 18:31:38 +00:00
drrtuy
8ae5a3da40
Fix/mcol 5787 rgdata buffer max size dev (#3325)
* fix(rowgroup): RGData now uses uint64_t counter for the fixed sizes columns data buf.
	The buffer can utilize > 4GB RAM that is necessary for PM side join.
	RGData ctor uses uint32_t allocating data buffer.
 	This fact causes implicit heap overflow.

* feat(bytestream,serdes): BS buffer size type is uint64_t
	This necessary to handle 64bit RGData, that comes as
	a separate patch. The pair of patches would allow to
	have PM joins when SmallSide size > 4GB.

* feat(bytestream,serdes): Distribute BS buf size data type change to avoid implicit data type narrowing

* feat(rowgroup): this returns bits lost during cherry-pick. The bits lost caused the first RGData::serialize to crash a process
2024-11-09 19:44:02 +00:00
Alexey Antipovsky
842a3c8a40
fix(PrimProc): MCOL-5651 Add a workaround to avoid choosing an incorr… (#3320)
* fix(PrimProc): MCOL-5651 Add a workaround to avoid choosing an incorrect TupleHashJoinStep as a joiner
2024-11-08 17:44:20 +00:00
Aleksei Antipovskii
42be2cb7e0 fix(dbcon) MCOL-5812 server crash related to stored functions
Using the stored function's return value as an argument
for another function was handled incorrectly, leading
to a server crash.
2024-11-05 20:32:26 +04:00
Denis Khalikov
3489b2c542
fix(logging): Add setddldebuglevel command (#3312) 2024-09-10 19:10:42 +03:00
drrtuy
47d01b2d2f fix(join, UM, perf): UM join is multi-threaded now (#3286)
* chore: UM join is multi-threaded now

* fix(UMjoin):  replace TR1 maps with stdlib versions
2024-09-04 18:56:24 +04:00
drrtuy
148063e07a feat(ddl,partitions): better partition-related commands logging 2024-09-02 12:05:02 +04:00
Denis Khalikov
7979c8b0ca
fix(aggregation, RAM): MCOL-5715 Changes the second phase aggregation. (#3171)
This patch changes the second phase aggregation pipeline - takes into
account current memory consumption.

Co-authored-by: Leonid Fedorov <79837786+mariadb-LeonidFedorov@users.noreply.github.com>
Co-authored-by: drrtuy <roman.nozdrin@mariadb.com>
2024-08-29 14:24:47 +03:00
Leonid Fedorov
a46232f830 MCOL-5779: use encoding to check alter table alter column statement correctly 2024-08-28 16:27:02 +04:00
Leonid Fedorov
25c20bae9b MCOL-4696: get rid of boost::iequals 2024-08-21 20:45:16 +04:00
Sergei Golubchik
fa8631c6cb match the rename in the handler rows_changed->rows_stats.updated 2024-08-06 18:18:37 +04:00
Leonid Fedorov
f62ef0041c
fix(joblist,sorting): columnstore_orderby_threads for subquery (#3079) 2024-07-31 14:50:18 +01:00
Aleksei Antipovskii
70a7a01941 fix(dbcon): MCOL-4756: having not() provokes an ERROR 2013
The `NOT()` function in the HAVING clause was handled
    incorrectly, which caused the server to crash.
2024-07-31 16:33:34 +04:00
Leonid Fedorov
1d25cf3afd chore(codestyle): MCOL-5405: repace windows CRLF with virtious linux one 2024-07-26 18:01:35 +04:00
mariadb-AlanMologorsky
323c8822d5 MCOL-5587: Fix columnstore.cnf.
fix(client): Fix columnstore.cnf file

This fix changes option file to apply '--quick' option only for 'mariadb' and 'mysql' clients instead of all MariaDB clients.
Otherwise 'mysqladmin' uses this option, but it doesn't exist. As a result broken CI multinode MTR stage.
2024-07-26 17:16:31 +04:00
Serguey Zefirov
6e995e2e80 fix: MCOL-5755: incorrect handling of BLOB (and TEXT) in GROUP BY
BLOB fields did not work as grouping keys at all, they were assigned
value NULL for any value, be it NULL or not. The fix is in the
rowaggregation.cpp in the initMapping(), a switch/case branch was added
to handle BLOB field copying there.

Also, TEXT columns did not distinguish between NULL and empty string in
the grouping algorithm, now they do. The fix is in the equals()
function, now we specifically check for isNull() equality between
values.
2024-07-11 11:03:05 +03:00
Sergey Zefirov
f5089c7d80
fix(client): MCOL-5587: enable quick mode for predictable performance (#3240)
This changeset enables quick (mariadb -q) mode when columnstore is
installed. Quick mode precludes client CLI program from storing too
much data in memory, preventing out of memory conditions.
2024-07-07 13:52:21 +01:00
Leonid Fedorov
a1e64d4cb0 bug(priproc) make last_day type a bit more accurate
This fixes discrepance with the server, which assigns DATE type to
last_day()'s result.

Now we also assigns DATE result type and, also, use proper
dataconvert::Day data structure to return date.

Tests agree with InnoDB.

Also, this patch includes test for MCOL-5669, to show we fixed it.
2024-07-01 16:25:44 +03:00
Sergey Zefirov
7ec8f3df9a
MCOL-5772: incorrect ORDER BY ordering for a columns not in GROUP BY (#3214)
When ORDER BY column is not in GROUP BY, is not an aggregate and there
is a SELECT column that is also not an aggregate, there was a problem:
ordering happened on the SELECTed column, not ORDERed one.

This patch fixes that particular problem and also performs some tidying
around newly added aggregate.
2024-06-25 16:10:27 +04:00
Sergey Zefirov
1122b64cb1
MCOL-4234: improve GROUP BY and ORDER BY interaction (#3194)
This patch fixes the problem in MCOL-4234 and also generally improves
behavior of GROUP BY.

It does so by introducing a "dummy" aggregate and by wrapping columns
into it. This allows for columns that are not in GROUP BY to be used
more freely, for example, in SELECT * FROM tbl GROUP BY col - all
columns that are not "col" will be wrapped into an aggregate and query
will proceed to execution.

The dummy aggregate itself does nothing more than remember last value
passed into it.

There also an additional error message that tries to explain what types
of expressions can be wrapped into an aggregate.
2024-06-17 20:00:54 +03:00
Denis Khalikov
c17f24b90f MCOL-5352 Properly handle PP restart for DML/DDL operations. 2024-05-23 00:01:34 +04:00
Sergey Zefirov
49541993f4
fix(join): Fixes MCOL-5056, an error of joining TEXT column from InnoDB (#3160)
We incorrectly identified TEXT columns from external tables as BLOB.
Alexander Barkov suggested a way to discriminate them which I
implemented here.
2024-05-15 16:04:10 +01:00
Sergey Zefirov
5b9ddd902e
feat(ddl): MCOL-5744: better handling of utf8 charset aliases (#3174)
Server expands ut8_XXX aliases to utf8mb3_XXX or utf8mb4_XXX depending
on the UTF8_IS_UTF8MB3 setting in the OLD_MODE environment variable.

Server already has the necessary code implemented in the get_utf8_flag()
method of class THD. There are several uses of this flag and all we have
to do to be in line with server is to use it.

This patch does that for DDL as work on MCOL-5705 uncovered some
problems in that area.
2024-05-10 17:17:57 +01:00
Leonid Fedorov
71185efe54 Fixed review notices, added the loop over selects, to collect error on more tnan two selects 2024-04-18 18:31:30 +03:00
Leonid Fedorov
8efdee6eca apply clang-format 2024-04-18 18:31:30 +03:00
Leonid Fedorov
904ac415e4 fix(plugin) MCOL-5699: throw error for unimplemented INTERSECT and EXCEPT 2024-04-18 18:31:30 +03:00
Leonid Fedorov
a8d3fff79e chore(build) Rocky8 gcc vanilla build fix 2024-04-16 17:08:06 +03:00
Serguey Zefirov
3b7e69135d Fixes MCOL-5700, Oracle mode test results
This changeset contains fixes in Oracle mode tests and for the
implementation of the CONCAT_ORACLE. Also, we harmonise our
translation process with the recent changes in the server.

Due to changed behavior of the server, some CREATE VIEW/EXPLAIN
statements' results begun to output unexpected results and need to be
fixed.

Also, concatenation operation's name also changed. This lead to
disabled func_concat_oracle test to be enabled to test it and it
turned out that our implementation of this function was broken
and need to be fixed too.
2024-04-15 19:35:21 +03:00
Denis Khalikov
77cd733a6d
fix(plugin): MCOL-5236 Take Item from Ref_Item for group by list. (#3162) 2024-04-01 14:13:39 +03:00
Leonid Fedorov
af5ae35413
Revert "Fixes MCOL-5700, Oracle mode test results" 2024-03-27 18:52:30 +04:00
mariadb-KirillPerov
56b35d5cf6
Merge pull request #3156 from mariadb-corporation/sz-fix-oracle-mode
Fixes MCOL-5700, Oracle mode test results
2024-03-27 14:45:52 +06:00
Serguey Zefirov
34acd3559b Fixes MCOL-5700, Oracle mode test results
This changeset contains fixes in Oracle mode tests and for the
implementation of the CONCAT_ORACLE. Also, we harmonise our
translation process with the recent changes in the server.

Due to changed behavior of the server, some CREATE VIEW/EXPLAIN
statements' results begun to output unexpected results and need to be
fixed.

Also, concatenation operation's name also changed. This lead to
disabled func_concat_oracle test to be enabled to test it and it
turned out that our implementation of this function was broken
and need to be fixed too.
2024-03-27 10:00:39 +03:00
drrtuy
444cf4c65e fix(aggregation, disk-based) MCOL-5691 distinct aggregate disk based (#3145)
* fix(aggregation, disk-based): MCOL-5689 this fixes disk-based distinct aggregation functions
Previously disk-based distinct aggregation functions produced incorrect results b/c there was no finalization applied for previous generations stored on disk.

*  fix(aggregation, disk-based): Fix disk-based COUNT(DISTINCT ...) queries. (Case 2). (Distinct & Multi-Distinct, Single- & Multi-Threaded).

* fix(aggregation, disk-based): Fix disk-based DISTINCT & GROUP BY queries. (Case 1). (Distinct & Multi-Distinct, Single- & Multi-Threaded).

---------

Co-authored-by: Theresa Hradilak <theresa.hradilak@gmail.com>
Co-authored-by: Roman Nozdrin <rnozdrin@mariadb.com>
2024-03-26 00:39:53 +03:00
Sergey Zefirov
49757ba8d5
Merge pull request #3132 from mariadb-SergeyZefirov/MCOL-5035-update-inserts-null-for-all-zeroes-date
Fix MCOL-5035, a difference in INSERT and UPDATE behavior
2024-03-21 10:12:18 +03:00
Leonid Fedorov
7a2ca9d6bc
MCOL-4480: TEXT type added (#3142)
* TEXT type added
* tests
2024-03-21 00:26:35 +04:00
Serguey Zefirov
5780bfa15f Fix MCOL-5035, a difference in INSERT and UPDATE behavior
The UPDATE statement wrote NULL when the column set is DATETIME and
value is '0000-00-00 00:00:00'. The problem was inside WriteEngine's
handling of UPDATE statements and this is where heart of change is.

Other changes are related to some obsolete data structures in DML/DDL
handling that just hanging around there, doing nothing.
2024-03-19 12:44:22 +03:00