1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-02 17:22:27 +03:00
Commit Graph

57 Commits

Author SHA1 Message Date
7fa5ca3a6d Leverage MDB Field methods to output char or binary-based types when processing batch inserts 2020-12-14 12:23:19 +03:00
a29d9ceb94 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:56:37 +00:00
9ebfae3104 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 16:36:15 -05:00
23fbf4bd33 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:31:20 +00:00
ee3c5c4b90 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 11:52:40 +04:00
fff1a660dd 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-07 15:45:56 +04:00
b44e1e2566 Merge pull request #1372 from dhall-MariaDB/MCOL-4236
Mcol 4236
2020-08-24 19:04:33 -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
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
2880d0871f MCOL-4247 add break to case 2020-08-18 11:47:06 -05:00
7ba40a5544 MCOL-4247 TYpecast causes wrong virtual function 2020-08-17 17:34:58 -05:00
219f67d162 MCOL-4181: Possible setting of ci->stats.fUser to NULL causing crash. 2020-07-20 15:18:58 -05:00
085b06d422 Merge branch 'develop' into MCOL-4126 2020-06-30 11:25:11 -05:00
8179ffffdf MCOL-4126 Don't reset ci->tableOid if not autocommit. 2020-06-30 11:21:30 -05:00
41745490ed Revert "MCOL-4126 reset ci->tableOid after INSERT|DELETE" 2020-06-30 10:37:34 -05:00
0a2fe7d2fb MCOL-4126 reset ci->tableOid after INSERT|DELETE 2020-06-29 16:20:05 -05:00
c30d105c30 Use batch inserts for the cache flush. 2020-06-03 15:20:03 -04:00
57f393feaf Merge pull request #1246 from pleblanc1976/mcol-4023-1.5
Merge MCOL-4023 fix into 1.5
2020-06-02 11:33:10 -04:00
4bddc92092 MCOL-4010 - fixes compilation errors on x64 w/-Werror
Merged in Sergei's patch.
2020-06-01 12:52:43 -04:00
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
8d0338411d Merge pull request #1202 from tntnatbry/develop-mcol4000
MCOL-4000 Allow columnstore_use_import_for_batchinsert to use a new value, ALWAYS.
2020-05-15 12:28:18 -05:00
e4dde6157d MCOL-4002 Reset cal_connection_info members at the end of
ha_mcs_impl_end_bulk_insert() for transactions as well.
2020-05-14 16:21:49 -04:00
816139d06d MCOL-4000 Allow columnstore_use_import_for_batchinsert to use a
new value, ALWAYS, which invokes cpimport for LDI and INSERT..SELECT
from within and outside a transaction.

Default value of the session variable, ON, remains unchanged.
2020-05-12 19:42:15 -04:00
cb4228d982 Merge branch 'columnstore-1.4.3' into merge-hotfix-patches-1.5
Conflicts:
	VERSION
	dbcon/mysql/ha_mcs.cpp
	dbcon/mysql/ha_mcs_execplan.cpp
	dbcon/mysql/ha_mcs_impl.cpp
	dbcon/mysql/ha_mcs_pushdown.cpp
	oam/install_scripts/columnstore-post-install.in
	oam/install_scripts/columnstore-pre-uninstall.in
	oam/install_scripts/columnstore.in
	oam/install_scripts/post-mysql-install
2020-04-27 17:17:55 -04:00
e7caeb8722 Another check for Update/Delete with replication. 2020-04-13 14:02:06 -05:00
2bdb40ed64 add logic for ha_mcs_impl_direct_update_delete_rows to handle delete statements with replication enabled. 2020-04-10 17:43:21 -05:00
ab2003baaa MCOL-3903 Enable Select Handler to run query part of INSERT..SELECT.
Original SH implementation sends the result set back to the client
thus it can't be used in INSERT..SELECT, SELECT INTO OUTFILE,CREATE
TABLE AS SELECT etc.
CLX-77 feature has been backported into MDB to enable SH to run
query part of the mentioned queries.
2020-04-07 09:17:05 +00:00
6d9544a15e Merge pull request #1126 from drrtuy/MCOL-3903_1_4
MCOL-3903 Enable Select Handler to run query part of INSERT..SELECT.
Conflicts:
	dbcon/mysql/ha_mcs_pushdown.cpp
2020-04-01 13:45:00 -04:00
3d5d113a84 Merge pull request #1117 from drrtuy/MCOL-3828_1_4
MCOL-3828 This commit replaces the method that calls JOIN::optimise()
2020-04-01 13:43:10 -04:00
ce0311aa79 MCOL-3828 This commit replaces the method that calls JOIN::optimise()
internally(thus can remove equi-JOIN predicates) with a recursive f()
to inject equi-JOIN conditions for IN + correlated subquery Item.
This change both solves MCOL-3747 issue and remove issues I first
faced in union.sql test.

This commit also fixes a clean up for conditions pushed for table API
execution path and replaces NULL with nullptr in ha_mcs_impl.cpp.
2020-03-24 14:00:42 +00:00
b5373d227a MCOL-3777 Cleanup left-over values from a previously failed insert. 2020-03-05 02:26:58 +00:00
9cc1e1c4f8 Merge pull request #1006 from LinuxJedi/change-engine
MCOL-128 Support ALTER TABLE...ENGINE=Columnstore
2020-02-28 13:54:54 -05:00
a91f7b7d6e MCOL-3812 remove call to thd_set_ha_data()
MariaDB 10.5 doesn't want us to call this.
2020-02-20 10:19:45 -06:00
6d98de3922 Use const_cast to assign to field_length due to
change in server 10.4 commit 1394216e3db67152a1356fddd8ddcd563b4f38c3
2020-02-14 01:00:50 +00:00
f9f7b79a2b MCOL-3749 Assertion on error
Correct error code return stops assertion
2020-02-05 11:10:54 -06:00
fc4f0e4f97 MCOL-3749 Return error when update truncates 2020-01-29 16:26:41 -06:00
092994d00d Merge pull request #1006 from LinuxJedi/change-engine
MCOL-128 Support ALTER TABLE...ENGINE=Columnstore
2020-01-24 09:26:13 -06:00
4b86890cf7 MCOL-128 Support ALTER TABLE...ENGINE=Columnstore
Also implements:

* ALTER TABLE from Columnstore to another engine
* MCOL-3349 CREATE TABLE ... AS SELECT.
2020-01-23 21:12:33 +00:00
c6aaa3f227 This commit fixes MDB crash that happens when table lock timeout fires
with multiply DML run in separate transactions.

This commit also fixes GCC unused variable warning.
2020-01-21 16:48:15 -05:00
b6dfdd6e99 Merge pull request #1000 from drrtuy/MCOL-1734_2
MCOL-1734 CS now behaves similar to MDB in case of NOT IN + correlated subquery if the subquery returns empty set.
2020-01-21 16:45:24 -05:00
cd80b0ace5 Merge pull request #1003 from mariadb-corporation/fix-doUpdateDelete
This commit fixes MDB crash that happens when table lock timeout fires
2020-01-17 08:25:44 -08:00
f21998eff3 Merge pull request #1002 from LinuxJedi/10.5-compatible
MariaDB 10.5 Compatibility
2020-01-15 19:10:49 -08:00
f178f2c22f This commit fixes MDB crash that happens when table lock timeout fires
with multiply DML run in separate transactions.

This commit also fixes GCC unused variable warning.
2020-01-14 22:44:35 +00:00
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
8595fa0226 MCOL-1734 CS now behaves similar to MDB in case of
NOT IN + correlated subquery if the subquery returns empty set.
CS now returns full outer record set.

gcc 8.2 complains about unused variable in ha_mcs_impl.cc
2020-01-07 17:23:17 +03:00
96adf535ae don't create a ResourceManager to initialize a global variable
this is executed when ha_columnstore is loaded, at dlopen time
before any initialization code is run and crashes any dlopen
attemps.

Crashes - because a missing config file is a crashing offence,
but it's an issue for another day
2019-12-19 19:42:38 +01:00
d8e763655c MCOL-3654: Fix row-based repl detection
if 0'd the row-based repl checks for now to prevent ruling out
stmts we should be able to process.
2019-12-17 13:26:18 -05:00
e02302908b MCOL-3674: Fix row-based replication detection
Changed the row-based repl detection mechanism so stmt-based repl works
again, however, the detection mechanism is still wrong somehow.  What it
should be is currently unknown.
2019-12-17 13:15:58 -05:00
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
9734a25a35 MCOL-3672 Fix double-DML execution
Direct update/delete executed doUpdateDelete as well as the regular
execution route for doUpdateDelete.

This patch only executes doUpdateDelete the first time and direct
update/delete collects the counts.
2019-12-12 22:58:20 +00:00