1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-05-10 02:01:04 +03:00

48 Commits

Author SHA1 Message Date
Alexey Antipovsky
ede047f0fa Fix warnings on CentOS7 2020-11-17 15:03:10 +03:00
Alexey Antipovsky
83d3adf466 Fix method declarations to match the base class (-Woverloaded-virtual) 2020-11-17 15:03:10 +03:00
David Hall
78b188ada3 MCOL-4329 dev change gamma to stable 2020-10-29 12:29:10 -05:00
Gagan Goel
50a4fd9f39 MCOL-4285 For Insert...Select, pass the is_cache_insert=true
flag to ha_mcs_impl_start_bulk_insert.

An earlier commit to fix LDI under replication changed the call in
ha_mcs_cache::start_bulk_insert for a non-insert command from
parent::start_bulk_insert_from_cache to parent::start_bulk_insert.
This commit reverts that change for INSERT...SELECT operation.
2020-10-15 13:30:36 -04:00
Gagan Goel
0ee64db3e5 Disable cache_handler for system catalog tables. 2020-10-01 17:00:18 -04:00
Gagan Goel
a1ea633a19 MCOL-4282 Follow up version 2.
Mutate the optimizer flags for prepared statements in:
  1. ha_mcs::open
  2. ha_mcs::discover_check_version

This is done to ensure the optimizer flags are disabled before
JOIN::prepare() is called during "PREPARE stmt FROM ...".
2020-09-25 13:49:52 -04:00
Gagan Goel
234c2eb740 MCOL-4285 In replication, perform LDI on the slave directly
into the columnstore table, and not into the cache.

LDI performed on a master, comes in as a SQLCOM_END sql_command
on the slave, when binlog_format != STATEMENT. If the cache already
had some records, we were earlier flushing the cache for the LDI
on the slave. This patch detects whether we are in the slave
thread or not, if so, then we don't do a cache flush if
sql_command = SQLCOM_END.
2020-09-16 16:34:07 -04:00
Alexander Barkov
7f6ad16728 MCOL-4303 UPDATE..SET using another table is not updating
The change for MCOL-4264 erroneously added the "lock_type" member
to cal_connection_info, which is shared between multiple tables.
So some tables that were opened for write erroneously identified
themselves as read only.

Moving the member to ha_mcs instead.
2020-09-11 12:26:26 +04:00
Gagan Goel
929a15ea01 Use the HAVE_PSI_INTERFACE preprocessor guard to disable code
that does not compile if -DPLUGIN_PERFSCHEMA=NO cmake option is used.
2020-08-25 22:03:28 -04:00
Gagan Goel
b3ae9cf04e Use a session variable, columnstore_cache_flush_threshold,
to allow the user to set the threshold, instead of using a
hard coded value.
2020-08-18 18:01:40 -04:00
Gagan Goel
47f2291f9f Number of cached rows can be > CACHE_FLUSH_THRESHOLD (in case of batch inserts). 2020-08-18 18:01:40 -04:00
Gagan Goel
709290cc3d Port of commit: 1ff23d0cd70d576a0f4e512ce332cff348591d36
from server/columnstore_cache.

Commit message:

Fixed bug in free locks that caused rows in cache to not be properly flushed

Fixed by doing adding external_lock(F_UNLCK) in free_locks.
I also moved unlock of cache_handler to be after changing lock type of
cached tables to ensure that no one can use cached table while this is
happening (as cache table is locked with write lock).
I also fixed a wrong mutex order bug in ha_cache::flush_insert_cache()

Other things:
- Addded share::cached_rows to track inserted rows. This is only used
  for asserts to check the number of rows in the cache.
- Fixed wrong mysql_file_chsize() in case of repair
2020-08-18 18:01:40 -04:00
Gagan Goel
4afcba9520 Do not build the cache as a separate user-visible engine.
We are creating a new read-only system variable, columnstore_cache_inserts,
to enable/disable the cache. When this variable is set at server start up,
any table created with engine=columnstore will also create the corresponding
cache table in Aria engine for performing inserts.

It is important to note that a ColumnStore table created with this
option unset should not be queried when the server is restarted with
the option set, as this will most likely result in query failures.
2020-08-18 18:01:40 -04:00
Gagan Goel
86fb66365c 1. Set 1M as the threshold on the number of records to flush the cache.
2. Set 100k as the batch size when flushing records into ColumnStore, i.e.,
a flush of 1M records will be performed in 10 batches, each being 100k.

3. For INSERT ... SELECT on the cache, use the default insertion method of cpimport.
2020-08-18 18:01:40 -04:00
Gagan Goel
f5a8d228a0 Port of commit ba731bdc6a80e88d32e7440044b548c3e3edc591
from server/columnstore_cache

Commit message:

Fixed crashed bug on simple insert

Other things:
- Added test from columnstore team
- Fixed two reported bugs from columnstore team
- Call free_locks as part of start_trans() instead of get_status()
  to ensure that we have locks both for cached table and cache table
  before we try to free any.
- Store pointers to lock->get_status and lock->update_status for the
  cached table. Was needed by ha_tina in flush_insert_cache to make
  new insert rows visible for the SELECT that caused the flush
2020-08-18 18:01:40 -04:00
Gagan Goel
4ff4e9eb89 Re-enable the ColumnStore_Cache plugin. 2020-08-18 18:01:40 -04:00
Gagan Goel
cb2ddad308 Port of commit 0463e1f722d4d32526760c923e0092a380a9e634
from server/columnstore_cache.

Commit message:

Fixed bug in cache:

- The THR_LOCK org_lock must be stored in a shared structure so that all
  instances of a table can use it. Fixed by adding a ha_cache_share object
  that keeps track of this one.
- Fixed wrong test in get_status_and_flush_cache to detect in insert command
- Fixed in get_status_and_flush_cache that we always free the insert lock
  if we don't need it.
2020-08-18 18:01:40 -04:00
Roman Nozdrin
6b3c6e33c5 MCOL-4152 Reset cond_stack with ha_mcs::reset() call 2020-07-13 13:18:57 +00:00
Patrick LeBlanc
449a1bd229 Set our maturity level to gamma. 2020-07-07 11:12:34 -04:00
Sergei Golubchik
87055f42f6 make columnstore to load in enterprise
.cnf file overwriting plugin-maturity must be lexicographically
after mariadb-enterprise.cnf

also set the maturity correctly without relying on supermodule doing it
2020-07-07 11:10:54 -04:00
Gagan Goel
d37f4722e1 Disable the ColumnStore cache plugin. 2020-06-16 14:42:35 -04:00
Roman Nozdrin
3cfbda3ad3 Disable the Columnstore_cache engine w/o reverting it. 2020-06-16 12:33:20 +00:00
Gagan Goel
1a5c6910da Make changes based on feedback to PR #1254 for the cache. 2020-06-08 14:11:30 -04:00
Gagan Goel
1216f9fc70 For INSERT ... SELECT, don't use the is_cache_insert flag
when starting bulk insert. This will invoke cpimport for
the query instead of batch inserts mode. This is intentional
as batch inserts currently have an edge case mentioned in
MCOL-4037 that needs to be fixed.
2020-06-04 12:29:37 -04:00
Gagan Goel
dd9372c4e8 Fix INSERT ... SELECT on self.
For queries of the form:
  insert into cache1 select * from cache1;
We had a crash in the second call to get_status_and_flush_cache
due to cache->table being 0. This happened because for one of the
two ha_mcs_cache instances involved in this query, the call to
ha_mcs_cache::open was not setting cache_handler->file->lock.status_param.
The assignment to status_param was earlier protected by an if condition.
Solution is to remove that if condition in ha_mcs_cache::open.
2020-06-03 15:20:03 -04:00
Gagan Goel
c30d105c30 Use batch inserts for the cache flush. 2020-06-03 15:20:03 -04:00
Gagan Goel
e671b1d1e2 1. Some fixes to the cache interface code.
2. Set a Columnstore_cache table as a non-foreign engine table in isMCSTable().
2020-06-03 15:20:03 -04:00
Gagan Goel
43d5d511d7 Initial port of Monty's code of the ColumnStore cache. 2020-06-03 15:20:03 -04:00
Gagan Goel
01ff2652a6 MCOL-4023 Pushdown WHERE conditions for UPDATE/DELETE.
For certain queries, such as:
  update cs1 set i = 41 where i = 42 or (i is null and 42 is null);
the SELECT_LEX.where does not contain the required where conditions.
Server sends the where conditions in the call to cond_push(), so
we are storing them in a handler data member, condStack, and later
push them down to getSelectPlan() for UPDATES/DELETEs.
2020-06-01 11:03:42 -04:00
David Hall
225789e171 MCOL-3934 free memory from XML parse at shutdown 2020-04-10 13:33:16 -05:00
Gagan Goel
457ec0d483 Updates to plugin code based on recent changes in the server 10.5 branch. 2020-03-12 00:42:16 +00:00
Gagan Goel
b5373d227a MCOL-3777 Cleanup left-over values from a previously failed insert. 2020-03-05 02:26:58 +00:00
Patrick LeBlanc
03a2283bac Fixed a merge error. 2020-02-28 17:11:13 -05:00
Andrew Hutchings
9e588039d5 Merge pull request #1010 from tntnatbry/MCOL-3680
MCOL-3680 mysqld will abort if Columnstore.xml is missing.
Conflicts:
	dbcon/mysql/ha_mcs.cpp
2020-02-28 13:58:00 -05:00
Andrew Hutchings
a959aad92d MariaDB 10.5 Compatibility
Several changes have happened in MariaDB 10.5, most notably:

* Information Schema table definitions have changed
* More things use LEX_CSTRING

This fixes all the compile issues
2020-01-13 10:47:14 -08:00
Andrew Hutchings
bd592aa714
Merge pull request #984 from LinuxJedi/fix-engineid
MCOL-3673 Fix legacy db type
2019-12-20 07:44:14 +02:00
Patrick LeBlanc
b0248c665c Re-added commit 5eb050f3af30c with a one-char modification that fixes
an odd access denied error when running a select stmt.
2019-12-19 18:40:57 -05:00
Patrick LeBlanc
dbc8cbaca9 Revert "Merge pull request #989 from LinuxJedi/set-maturity"
This reverts commit 5eb050f3af30cb51d1a71f7d8565708f8fa43656, reversing
changes made to 0be00a3a737b226e656b390326606bb30cf77816.
2019-12-19 18:08:49 -05:00
Andrew Hutchings
76f25045d9 Make plugin maturity definable at compile time. 2019-12-19 07:30:22 +02:00
Andrew Hutchings
d0f51f6526 MCOL-3673 Fix legacy db type
We were auto-assigned a DB type which could cause issues during major
upgrades. Setting to autoassign gives us a DB type of 0 which solves
these issues.
2019-12-17 15:32:32 +02:00
benthompson15
451284aeee
Merge pull request #982 from LinuxJedi/MCOL-3669a
MCOL-3669 Add real versioning to plugin
2019-12-13 22:07:37 +01:00
Andrew Hutchings
114c5be935 MCOL-3669 Add real versioning to plugin
Make the version in information_schema.all_plugins reflect the real
version of ColumnStore.
2019-12-13 19:19:16 +00:00
Andrew Hutchings
b7396129c7 MCOL-3672 Fix regression in deletes
Deletes appear to only use the direct delete path. This allows that to
happen.
2019-12-13 07:33:29 +00:00
Roman Nozdrin
19b4702a24 This patch fllows the change introduced in the direct_update/delete API
in 10.4.11 to fix MDEV-18973 in Spider.
2019-12-11 08:05:49 -06:00
Andrew Hutchings
3f5e1fd0c8
Merge pull request #964 from mariadb-corporation/MCOL-3529
MCOL-3529 This patch implements direct_update and direct_delete features
2019-12-09 09:40:33 +00:00
Andrew Hutchings
e072bf9e9b MCOL-3628 Move I_S tables into main handler lib
The I_S tables are all now in ha_columnstore.so
2019-12-03 21:21:28 +00:00
Roman Nozdrin
5cedeb110b MCOL-3529 This patch implements direct_update and direct_delete features
to properly report the number of rows affected by UPDATE|DELETE.
2019-11-27 09:33:21 -06:00
Gagan Goel
c8df46ed26 Replace ha_calpont with ha_mcs in the source code and filenames in the plugin code. 2019-10-11 17:33:43 +00:00