1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00
Commit Graph

1013 Commits

Author SHA1 Message Date
97ee1609b2 MCOL-641 Replaced NULL binary constants.
DataConvert::decimalToString, toString, writeIntPart, writeFractionalPart are not templates anymore.
2020-11-18 13:47:44 +00:00
de85e21c38 MCOL-641 This commit cleans up Row methods and adds couple UT for Row. 2020-11-18 13:47:02 +00:00
b07db9a8f4 MCOL-641 Basic support for updates. 2020-11-18 13:47:01 +00:00
31d597d87e MCOL-641 This commit enables CS to return a warning on non-supported ZEROFILL
keyword.

The change potentially replaces tabs with spaces in the bison's ddl.y file.
2020-11-18 13:47:01 +00:00
55afcd8890 MCOL-641 Basic extent elimination support for Decimal38. 2020-11-18 13:47:01 +00:00
0ff0472842 MCOL-641 sum() now works with DECIMAL(38) columns.
TupleAggregateStep class method and buildAggregateColumn() now properly set result data type.

doSum() now handles DECIMAL(38) in approprate manner.

Low-level null related methods for new binary-based datatypes now handles magic values for
binary-based DT.
2020-11-18 13:47:01 +00:00
54c152d6c8 MCOL-641 This commit introduces templates for DataConvert and RowGroup methods. 2020-11-18 13:47:01 +00:00
77e1d6abe3 Basic SELECT support for Decimal38 2020-11-18 13:47:00 +00:00
c9f42fb5cc MCOL-641 PoC version for DECIMAL(38) using BINARY as a basis. 2020-11-18 13:47:00 +00:00
32f6167067 MCOL-641 Work of Ivan Zuniga on basic read and write support for Binary16 2020-11-18 13:47:00 +00:00
ede047f0fa Fix warnings on CentOS7 2020-11-17 15:03:10 +03:00
b25fee320a Remove variable-length arrays (-Wvla) 2020-11-17 15:03:10 +03:00
83d3adf466 Fix method declarations to match the base class (-Woverloaded-virtual) 2020-11-17 15:03:10 +03:00
78b188ada3 MCOL-4329 dev change gamma to stable 2020-10-29 12:29:10 -05:00
56e581eb39 Merge pull request #1527 from tntnatbry/MCOL-4285-insertselect-fix
MCOL-4285 For Insert...Select, pass the is_cache_insert=true
2020-10-27 10:23:17 -05:00
39a1dd604d Merge pull request #1480 from dhall-MariaDB/MCOL-4329-dev
MCOL-4329 dev set plugin-maturity to stable
2020-10-27 18:07:22 +03:00
13264feb7d MCOL-4320/4364/4370 Fix multibyte processing for LDI/Insert...Select
For CHAR/VARCHAR/TEXT fields, the buffer size of a field represents
the field size in bytes, which can be bigger than the field size in
number of characters, for multi-byte character sets such as utf8,
utf8mb4 etc. The buffer also contains a byte length prefix which can be
up to 65532 bytes for a VARCHAR field, and much higher for a TEXT
field (we process a maximum byte length for a TEXT field which fits in
4 bytes, which is 2^32 - 1 = 4GB!).

There is also special processing for a TEXT field defined with a default
length like so:
  CREATE TABLE cs1 (a TEXT CHARACTER SET utf8)
Here, the byte length is a fixed 65535, irrespective of the character
set used. This is different from a case such as:
  CREATE TABLE cs1 (a TEXT(65535) CHARACTER SET utf8), where the byte length
for the field will be 65535*3.
2020-10-26 17:51:24 +00:00
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
6ab1b829a0 MCOL-4334 Enable Select Handler for queries run inside Stored Procedures
There is another session variable to enable/disable SH in SP
2020-10-13 13:07:59 +00:00
72118c4618 Merge pull request #1502 from tntnatbry/MCOL-4285-syscat-dev
MCOL-4285 Disable cache_handler for system catalog tables.
2020-10-02 11:56:50 -05:00
951a6abe85 MCOL-4330 dev Refresh shared memory
If the plugin is restarted after the system is running, it's possible to have stale references to shared memory. This patch deletes those references so the next time they're used, just-in-time initialization will get the latest.
2020-10-01 18:19:03 -05:00
0ee64db3e5 Disable cache_handler for system catalog tables. 2020-10-01 17:00:18 -04:00
b5bc38c4ad MCOL-4329 dev set plugin-maturity to stable
Also remove x-columnstore.cnf
2020-09-28 14:35:34 -05:00
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
5646164a46 Merge pull request #1459 from dhall-MariaDB/MCOL-4144-dev
MCOL-4144-dev Enable lower_case_table_names
2020-09-24 19:10:22 -04:00
35c4b66a67 MCOL-4144 Enable lower_case_table_names
Create tables and schemas with lower case name only if the flag is set.
During operations, convert to lowercase in plugin. Byt the time a query gets to ExeMgr, DDLProc etc., everything must be lower case if the flag is set, and undisturbed if not.
2020-09-24 15:21:13 -05:00
f584bab846 Merge pull request #1467 from drrtuy/MCOL-4278-dev
MCOL-4278 MCS quits early from rnd_end() in the presense of sql_selec…
2020-09-24 10:11:08 -05:00
7f744470d7 Merge pull request #1461 from tntnatbry/MCOL-4282-2
MCOL-4282 Follow up on the previous commit.
2020-09-24 11:48:17 +03:00
df0c2b2fbe MCOL-4278 MCS quits early from rnd_end() in the presense of sql_select_limit session variable
Renamed a couple methods to align their names with others
2020-09-24 08:46:00 +00:00
e257570b04 MCOL-4282 Follow up on the previous commit.
Activate statement arena for:
  1. disable_indices_for_CEJ()
  2. in_subselect_rewrite() for prepared statements
2020-09-23 15:45:20 -04:00
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
1c94e310ff Merge pull request #1449 from tntnatbry/MCOL-4282
MCOL-4282 Enable Select Handler for Prepared Statements
2020-09-14 11:07:42 +03:00
a117786027 MCOL-4282 Enable Select Handler for Prepared Statements
This patch enables select handler for executing prepared
statements. Most importantly, we are now activating a
persistent arena which will allocate any new items in a
permanent MEMROOT for prepared statements and stored procedures.
Refer to JOIN::optimize_inner() for details.

In processWhere(), we now use SELECT_LEX::prep_where in case
we are executing a prepared statement, as this is where the saved
WHERE clause is stored for prepared statement processing.

In addition, we also disable derived handler for prepared
statements.
2020-09-11 16:35:51 -04:00
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
a35be51cc6 Merge pull request #1433 from dhall-MariaDB/MCOL-3464
MCOL-3464 don't dereference a NULL String.
2020-09-09 12:25:20 -04:00
9052a88fc9 Merge pull request #1439 from mariadb-corporation/develop-mcol-4264
MCOL-4264 [Cross-Engine] UPDATE to INNODB table with WHERE clause usi…
2020-09-08 14:12:28 -05:00
f00cc571b5 MCOL-4264 [Cross-Engine] UPDATE to INNODB table with WHERE clause using Columnstore as sub query failing
Problem:

When processing cross-engine queries like:

update cstab1 set a=100 where a not in (select a from innotab1 where a=11);
delete from innotab1  where a not in (select a from cstab1 where a=1);

the ColumnStore plugin erroneously executed the whole query inside
ColumnStore.

Fix:

- Adding a new member cal_connection_info::lock_type and setting it
  inside ha_mcs_impl_external_lock() to the value passed in the parameter
  "lock_type".

- Adding a method cal_connection_info::isReadOnly() to test
  if the last table lock made in ha_mcs_impl_external_lock()
  for done for reading.

- Adding a new condition checking cal_connection_info::isReadOnly() inside
  ha_mcs_impl_rnd_init(). If the current table was locked last time for reading,
  then doUpdateDelete() should not be executed.
2020-09-08 07:06:52 +04:00
890846fa8a MCOL-3464 don't dereference a NULL String. 2020-09-04 16:31:20 -05:00
a7fef967c4 MCOL-4108 For functions not found, send not supported error 2020-09-04 15:27:47 -05:00
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
b44e1e2566 Merge pull request #1372 from dhall-MariaDB/MCOL-4236
Mcol 4236
2020-08-24 19:04:33 -04:00
e8d01779cf Merge pull request #1371 from mariadb-corporation/columnstore_cache
ColumnStore Cache fixes
2020-08-24 15:48:56 -05:00
39557da2f5 Merge pull request #1376 from benthompson15/MCOL-4155
Fix for using correct cnf file when building as submodule.
2020-08-19 18:45:51 -05:00
be60b49646 Fix for using correct cnf file when building as submodule. 2020-08-19 18:43:46 -05:00
03c50eabee Revert "MCOL-3827 Optimize out sort on SubQuery in Select" 2020-08-19 19:23:55 -04:00
7bd878de0a MCOL-4236 remove type casting *f to something it's not
During data retrieval, we were type casting a field type to what we thought was the correct type. Often it was not. Since we're calling virtual functions on *f, there's no need to type cast in most cases. This was a relic from days gone by.
2020-08-19 14:37:38 -05:00
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
47f2291f9f Number of cached rows can be > CACHE_FLUSH_THRESHOLD (in case of batch inserts). 2020-08-18 18:01:40 -04:00
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
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