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

1661 Commits

Author SHA1 Message Date
256691652d MCOL-4530: toCppCode() method for ParseTree and TreeNode (#2777)
* toCppCode for ParseTree and TreeNode

* generated tree is compiling

* Put tree constructors into tests

* Minor fixes

* Fixed parse + some constructors

* Fixed includes, removed debug and old data

* Hopefully fix clang errors

* Forgot an override

* More overrides
2023-03-22 23:25:06 +03:00
70124ecc01 Fix trivial spelling errors
- occured -> occurred
- reponse -> response
- seperated -> separated

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services, Inc.
2023-03-11 11:59:47 -08:00
786b9da5b0 MCOL-5438 COUNT() in math causes SEGV 2023-03-09 20:35:38 +00:00
56f2346083 Remove windows ifdefs 2023-03-02 15:59:42 +00: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
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
e4100928d1 MDEV-25080 DISABLE pushdown of SELECT_LEX_UNIT for the prepare
phase of PS/SP statements.
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
8cdcae0d2f MDEV-25080 Disable pushdown of SELECT_LEX_UNIT for CREATE VIEW statements. 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
ff534dba7f MCOL-5384 This commit replaces shared pointer to CSC with CSC ctor that is cleaned up leaving a scope
CSC default ctor was private b/c it must not allow to use CSC outside thread cache.
  However there are some places in the plugin code that need a standalone syscat that
  is cleaned up leaving the scope. The decision is to make the restriction mentioned
  organizational rather than syntactical.
2023-02-08 14:03:41 +00:00
c1168e33aa Merge pull request #2712 from drrtuy/MCOL-5400
MCOL-5400 Disable group by pushdown
2023-01-27 16:17:24 +03:00
d87206c3e4 Fix segfault in getLocalNetIfacesSins (#2713) 2023-01-26 16:21:21 +03:00
1b51d265ed MCOL-5400 Disable group by pushdown 2023-01-26 12:09:00 +00:00
ebe9bd0aa5 Merge pull request #2670 from denis0x0D/MCOL-5195
MCOL-5195 Correlated subquery with equi/non-equi scalar filter and join condition
2023-01-19 13:35:08 +03:00
c7c182ebd2 Merge pull request #2684 from drrtuy/MCOL-5385
MCOL-5385 This patch reduces RAM consumption and adds GROUP_CONCAT RA…
2023-01-18 11:58:47 +03:00
20b5dbb617 Add missing includes
These seem to have all fallen out of a recent Boost update to 1.81 which
dropped some internal includes. All of these uses within columnstore
relied on these transitive includes, so explicitly include what we need
to fix build.

Signed-off-by: Sam James <sam@gentoo.org>
2023-01-17 01:18:41 +00:00
81f0334698 Connection resource cleaning by Karol Roslaniec 2023-01-13 16:35:12 +03:00
d42485656c Fix clang 16 warnings for comfort build 2023-01-12 22:11:28 +03:00
d0eea0ffe8 MCOL-5385 This patch reduces RAM consumption and adds GROUP_CONCAT RAM accounting feature 2023-01-11 09:52:10 +00:00
53af74b027 MCOL-1170 Fix ANALYZE to not error (#2682)
Analyze needs to be completed differently than a normal query. In server, when an ANALYZE is seen, it calls init_scan() immediatly followed by end_scan(). This leaves the sqlfrontendsession (ExeMgr) in a state where it expects to return rows. This patch fixes end_scan to clean this up via reads and writes to get everything back in synch.

ANALYZE should display the number of rows to be displayed if the query were run normally. We have that information available, but no way to return it. A modification to server side to ask for that in the handler is required.

This patch also includes a beautification of sqlfrontsessionthread.cpp since it looked bad. The important change is at line 774
if (!swallowRows)
which short circuits the actual return of data
2023-01-09 13:59:26 -06:00
4313288a85 Merge 22.08.7 (#2678)
* fix C API includes

ColumnStore used to include server's mysql.h
but link all tools with libmariadb.so

There's no guarantee that this would work, even with workarounds
it had in dbcon/mysql/sm.cpp

Fix:
* tools (linked with libmariadb.so) *must* include libmariadb's mysql.h
* as a hack prevent service_thd_timezone.h from being loaded into tools,
  as it conflicts with libmariadb's mysql.h
* server plugin *must* include server's mysql.h
* also don't link every tool with libmariadb.so, link the helper library
  (liblibmysqlclient.so) that actually needs it, tools use this
  helper library, not libmariadb.so directly

* do *not* link ha_columnstore.so with libmariadb.so

this means some libraries have to be compiled twice -
for tools with libmariadb.so and for plugin, without.

* use system boost, if possible

boost 1.71.0 is what ubuntu focal has, so let's start with that version.
boost 1.77.0 is the first that supports c++20

* add dependency for generated header files errorids.h messageids.h

see 3edd51610

* bump the version

* MCOL-5322 This patch replaces boost::mutex with std::mutex b/c IMHO std::unique_lock::lock is
less troublesome comparing with the boost alternative

* MCOL-5310 This patch replaces move-assignment with copy-assignment to avoid memory corruption (#2661)

* Bump VERSION to 22.08.7-1

* MCOL-5306 Re-read the config (Columnstore.xml) file if it was updated.

The existing implementation of Config::makeConfig() factory method
was returning a possibly stale config to the caller, without checking
if the config file was updated since the last read. This bug triggered
a scenario as described in MCOL-5306 where after a failover in an MCS
cluster, the controllernode coordinates changed in the config file
after failover and the existing mariadbd process was still using the
old controllernode coordinates. This lead to failed network connection
between mariadbd and the new controllernode.

The change in this fix, however, is more generic and not just limited
to this above scenario.

* MCOL-5264 This patch replaces boost mutex locks with std analogs
boost::uniqie_lock dtor calls a fancy unlock logic that throws twice.
First if the mutex is 0 and second lock doesn't own the mutex.
The first condition failure causes unhandled exception for one of the clients
in DEC::writeToClient(). I was unable to find out why Linux can have a 0
mutex and replaced boost::mutex with std::mutex b/c stdlibc++ should
be more stable comparing with boost.

* MCOL-5311 Add timezone to jobList in subquerytransformer
TimeZone was uninitialized in this scenario and led to undefined behavior.

* patch_out_of_band
Some changes made to 10.6-enterprise make a build using the out-of-band method of compiling columnstore not work. Out-of band means the source for the engine is not in the storage subdir of server, but rather in a stand alone directory. This is used by developers for easier develop work. In the case of out-of-band, INSTALL_LAYOUT is false in CMakeLists.txt

* MCOL-5346 This patch forces TreeNode::getIntValue to use conversion for dict-based CHAR/VARCHAR and TEXT columns (#2657)

Co-authored-by: Roman Nozdrin <rnozdrin@mariadb.com>

* MCOL-5263 Add support to ROLLBACK when PP were restarted.

DMLProc starts ROLLBACK when SELECT part of UPDATE fails b/c EM facility in PP were restarted.
Unfortunately this ROLLBACK stuck if EM/PP are not yet available.
DMLProc must have a t/o with re-try doing ROLLBACK.

* MCOL-3561 This patch updates Connector code after MDEV-29988

* This commit applies the code style format

Co-authored-by: Sergei Golubchik <serg@mariadb.com>
Co-authored-by: Roman Nozdrin <rnozdrin@mariadb.com>
Co-authored-by: David.Hall <david.hall@mariadb.com>
Co-authored-by: Gagan Goel <gagan.nith@gmail.com>
Co-authored-by: Denis Khalikov <dennis.khalikov@gmail.com>
2022-12-28 21:15:39 +03: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
15f65eff15 Merge pull request #2655 from denis0x0D/MCOL-5263_2
MCOL-5263 Add support to ROLLBACK when PP were restarted.
2022-12-13 21:24:01 +03:00
d43e418a8c MCOL-5346 This patch forces TreeNode::getIntValue to use conversion for dict-based CHAR/VARCHAR and TEXT columns (#2657)
Co-authored-by: Roman Nozdrin <rnozdrin@mariadb.com>
2022-12-13 18:13:22 +03:00
d61780cab1 MCOL-5263 Add support to ROLLBACK when PP were restarted.
DMLProc starts ROLLBACK when SELECT part of UPDATE fails b/c EM facility in PP were restarted.
Unfortunately this ROLLBACK stuck if EM/PP are not yet available.
DMLProc must have a t/o with re-try doing ROLLBACK.
2022-12-13 16:18:53 +03:00
635a9fdb56 Merge pull request #2658 from dhall-MariaDB/patch_out_of_band
patch_out_of_band
2022-12-12 17:14:41 -06:00
10e2834033 patch_out_of_band
Some changes made to 10.6-enterprise make a build using the out-of-band method of compiling columnstore not work. Out-of band means the source for the engine is not in the storage subdir of server, but rather in a stand alone directory. This is used by developers for easier develop work. In the case of out-of-band, INSTALL_LAYOUT is false in CMakeLists.txt
2022-12-12 14:17:09 -06:00
369aea884e MCOL-5311 Add timezone to jobList in subquerytransformer
TimeZone was uninitialized in this scenario and led to undefined behavior.
2022-12-07 09:52:00 -06:00
a1d89d8f31 Merge pull request #2630 from dhall-MariaDB/sergchanges
Sergchanges
2022-12-02 19:08:08 +03:00
7e3ad24437 Serge changes -- Add static joblist lib 2022-11-30 12:46:26 -06:00
bfbe5bf315 MCOL-5264 This patch replaces boost mutex locks with std analogs
boost::uniqie_lock dtor calls a fancy unlock logic that throws twice.
First if the mutex is 0 and second lock doesn't own the mutex.
The first condition failure causes unhandled exception for one of the clients
in DEC::writeToClient(). I was unable to find out why Linux can have a 0
mutex and replaced boost::mutex with std::mutex b/c stdlibc++ should
be more stable comparing with boost.
2022-11-24 17:19:24 +00:00
b936ed8b2e Fix some GCC-12 Build errors 2022-11-22 03:28:17 +03:00
84bb4e56b8 Merge pull request #2624 from mariadb-corporation/columnstore-22.08.4-1
Columnstore 22.08.4 1
2022-11-18 19:01:33 +03:00
246a4db8de fix C API includes
ColumnStore used to include server's mysql.h
but link all tools with libmariadb.so

There's no guarantee that this would work, even with workarounds
it had in dbcon/mysql/sm.cpp

Fix:
* tools (linked with libmariadb.so) *must* include libmariadb's mysql.h
* as a hack prevent service_thd_timezone.h from being loaded into tools,
  as it conflicts with libmariadb's mysql.h
* server plugin *must* include server's mysql.h
* also don't link every tool with libmariadb.so, link the helper library
  (liblibmysqlclient.so) that actually needs it, tools use this
  helper library, not libmariadb.so directly
2022-11-17 12:02:07 -06:00
21c3bbce16 do *not* link ha_columnstore.so with libmariadb.so
this means some libraries have to be compiled twice -
for tools with libmariadb.so and for plugin, without.
2022-11-17 11:53:42 -06:00
9b84bf57c9 From serg: add dependency for generated header files errorids.h messageids.h 2022-11-17 11:46:10 -06:00
4b15a7e8a9 Merge pull request #2628 from denis0x0D/MCOL-5265
[MCOL-5265] Change boost:shared_ptr to std::shared_ptr.
2022-11-15 16:45:19 +03:00
e09d24cb8d [MCOL-5265] Change boost:shared_ptr to std::shared_ptr.
This is attempt to make some part of the code more stable.
For some reason we can get a spurious nullptr for boost::shared_ptr
which cause an assert and abort.
2022-11-14 18:53:53 +03:00
61d5f80aa0 MCOL-5279 This approach executes same node DEC::writeToClient the last taking multiple ExeMgrs into account (#2623)
Co-authored-by: Roman Nozdrin <rnozdrin@mariadb.com>
2022-11-11 13:17:45 -06:00
e71bb49267 Merge pull request #2617 from mariadb-corporation/spetrunia-tmp
Add ability to compile against MariaDB with new cost model
2022-11-10 20:49:08 +03:00
b7fc8e4609 Add ability to compile against MariaDB with new cost model
If MariaDB defines MARIADB_NEW_COST_MODEL, then ha_mcs::scan_time()
has a different signature.
2022-11-10 18:16:44 +03:00
37fd915a08 Serg`s patch for develop-6 revised for develop https://github.com/mariadb-corporation/mariadb-columnstore-engine/pull/2614 2022-11-09 22:41:38 +00:00
f5aeb1c1a7 Merge branch 'develop' into columnstore-22.08.3-1 2022-11-04 16:12:56 -05:00
09d785fc9b MCOL-5279 This commit fixes the corner case of the issue that can rarely happen when flow control is used to backpressure PPs that overflows EM with Primitive messages. It also adds a relevant test that makes sense in a multi-node scenario only. (#2605)
Co-authored-by: Roman Nozdrin <rnozdrin@mariadb.com>
2022-11-03 16:36:54 -05:00
e3ab19e639 Remove unreferenced variable 2022-11-03 11:29:24 -05:00
4ccab75720 Mcol 5279 2 (#2606)
* MCOL-5279 Send ByteStream with Primitive message to remote PPs first
and to the local PP last

MCOL-5166 forces EM to interact with PP over a messaging queue when they are in the same process. When ByteStream is taken from the queue it is drained so it is impossible to re-use the same ByteStream to send to the other nodes.

* MCOL-5279 Fix a corner case when sending PP messages
Multi-node can break when flow control is used to backpressure PPs that overflows EM with Primitive messages.
2022-11-03 09:42:12 -05:00
88404f70f1 MCOL-5013: added terminated_by, enclosed_by, escaped_by for s3dataload 2022-11-03 15:46:08 +03:00
a1c8f519c1 MCOL-5279 Send ByteStream with Primitive message to remote PPs first (#2603)
and to the local PP last

MCOL-5166 forces EM to interact with PP over a messaging queue when they are in the same process. When ByteStream is taken from the queue it is drained so it is impossible to re-use the same ByteStream to send to the other nodes.
2022-11-02 16:09:45 -05:00