summaryrefslogtreecommitdiff
path: root/sql/partition_info.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'bb-10.4-release' into bb-10.5-releaseSergei Golubchik2021-02-151-2/+2
|\
| * MDEV-17556 Assertion `bitmap_is_set_all(&table->s->all_set)' failedNikita Malyavin2021-01-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The assertion failed in handler::ha_reset upon SELECT under READ UNCOMMITTED from table with index on virtual column. This was the debug-only failure, though the problem is mush wider: * MY_BITMAP is a structure containing my_bitmap_map, the latter is a raw bitmap. * read_set, write_set and vcol_set of TABLE are the pointers to MY_BITMAP * The rest of MY_BITMAPs are stored in TABLE and TABLE_SHARE * The pointers to the stored MY_BITMAPs, like orig_read_set etc, and sometimes all_set and tmp_set, are assigned to the pointers. * Sometimes tmp_use_all_columns is used to substitute the raw bitmap directly with all_set.bitmap * Sometimes even bitmaps are directly modified, like in TABLE::update_virtual_field(): bitmap_clear_all(&tmp_set) is called. The last three bullets in the list, when used together (which is mostly always) make the program flow cumbersome and impossible to follow, notwithstanding the errors they cause, like this MDEV-17556, where tmp_set pointer was assigned to read_set, write_set and vcol_set, then its bitmap was substituted with all_set.bitmap by dbug_tmp_use_all_columns() call, and then bitmap_clear_all(&tmp_set) was applied to all this. To untangle this knot, the rule should be applied: * Never substitute bitmaps! This patch is about this. orig_*, all_set bitmaps are never substituted already. This patch changes the following function prototypes: * tmp_use_all_columns, dbug_tmp_use_all_columns to accept MY_BITMAP** and to return MY_BITMAP * instead of my_bitmap_map* * tmp_restore_column_map, dbug_tmp_restore_column_maps to accept MY_BITMAP* instead of my_bitmap_map* These functions now will substitute read_set/write_set/vcol_set directly, and won't touch underlying bitmaps.
* | Merge 10.4 into 10.5Marko Mäkelä2020-08-011-4/+1
|\ \ | |/
| * MDEV-16023 Unfortunate error message WARN_VERS_PART_FULL (partition <name> ↵Nikita Malyavin2020-07-291-1/+0
| | | | | | | | | | | | is full) when rotation time for the last interval passed * remove one case of WARN_VERS_PART_FULL
* | Merge 10.4 into 10.5Marko Mäkelä2020-06-051-0/+2
|\ \ | |/
| * MDEV-22112 Assertion `tab_part_info->part_type == RANGE_PARTITION || ↵Aleksey Midenkov2020-06-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | tab_part_info->part_type == LIST_PARTITION' failed in prep_alter_part_table Incorrect syntax for SYSTEM_TIME partition. work_part_info is detected as HASH partition. We cannot add partition of different type neither we cannot reorganize SYSTEM_TIME into/from different type partitioning. The sidefix for version until 10.5 corrects the message: "For LIST partitions each partition must be defined"
* | MDEV-22155 ALTER add default history partitions name clash on non-default ↵Aleksey Midenkov2020-04-271-9/+4
| | | | | | | | | | | | | | partitions If any of default names clashes with existing names find next large enough name gap for the requested number of partitions.
* | MDEV-22153 ALTER add default history partitions makes table inaccessibleAleksey Midenkov2020-04-061-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ADD default history partitions generates wrong partition name, f.ex. p2 instead of p1. Gap in sequence of partition names leads to ha_partition::open_read_partitions() fail on inexistent name. Manual fixing such broken table requires: 1. create empty table by any name (t_empty) with correct number of partitions; 2. stop the server; 3. rename data files (.myd, .myi or .ibd) of broken table to t_empty fixing the partition sequence (#p2 to #p1, #p3 to #p2); 4. start the server; 5. drop the broken table; 6. rename t_empty to correct table name.
* | MDEV-21743 Split up SUPER privilege to smaller privilegesAlexander Barkov2020-03-101-1/+0
| |
* | cleanup: PSI key is *always* the first argumentSergei Golubchik2020-03-101-3/+2
| |
* | perfschema memory related instrumentation changesSergei Golubchik2020-03-101-1/+2
| |
* | Revert "MDEV-17554 Auto-create new partition for system versioned tables ↵Sergei Golubchik2020-02-271-261/+17
| | | | | | | | | | | | | | with history partitioned by INTERVAL/LIMIT" This reverts commit 9894751a2a61ef952ac6ac556fd683e53fc150e2. This reverts commit f707c83fff4fa3f5291684e6226542fdb75bbdeb.
* | Compilation fixAleksey Midenkov2020-02-251-0/+1
| |
* | MDEV-17554 Auto-create new partition for system versioned tables with ↵Aleksey Midenkov2020-02-251-17/+260
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | history partitioned by INTERVAL/LIMIT When there are E empty partitions left, auto-create N new empty partitions for SYSTEM_TIME partitioning rotated by INTERVAL/LIMIT and marked by AUTO_INCREMENT keyword. Syntax change: AUTO_INCREMENT keyword (or shorter AUTO may be used instead) after LIMIT/INTERVAL clause. CREATE OR REPLACE TABLE t (x INT) WITH SYSTEM VERSIONING PARTITION BY SYSTEM_TIME LIMIT 100000 AUTO_INCREMENT; CREATE OR REPLACE TABLE t (x INT) WITH SYSTEM VERSIONING PARTITION BY SYSTEM_TIME INTERVAL 1 WEEK AUTO_INCREMENT; The current revision implements hard-coded values of 1 for E and N. As well as auto-creation threshold MinInterval = 1 hour, MinLimit = 1000. The name for newly added partition will be first chosen as "pX", where X is partition number and "p" is hard-coded name prefix. If this name is already occupied, the X will be incremented until the resulting name will be free to use. ALTER TABLE ADD PARTITION is now always fast. If there some history partition overflow occurs manual ALTER TABLE REBUILD PARTITION is needed.
* | MDEV-17554 history partitioning cleanupsAleksey Midenkov2019-12-031-92/+15
| | | | | | | | | | | | | | * Fixed missed warning on condition boundary * REORGANIZE cases * vers_utils.h removed * test cases cleanup
* | MDEV-19903 Setup default partitions for system versioningAleksey Midenkov2019-11-221-5/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement syntax like: create table t1 (x int) with system versioning partition by system_time; which will create 1 history partition and 1 current partition. Also it is possible to specify the number of history partitions: create table t1 (x int) with system versioning partition by system_time partitions 5; which will create 4 history partitions (and 1 current partition). Tests: partition.test cases are duplicated where it is appropriate for default partitions. partition_rotation.test cases are replaced by default partitions where possible.
* | Compilation fix with partitioning off (MDEV-17553)Aleksey Midenkov2019-11-071-95/+96
| |
* | MDEV-17553 Enable setting start datetime for interval partitioned history of ↵Aleksey Midenkov2019-11-071-8/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | system versioned tables * Explicit STARTS syntax * SHOW CREATE * Default STARTS rounding depending on INTERVAL type * Warn when STARTS timestamp is later than query time * Fix uninitialized Lex->create_last_non_select_table under mysql_unpack_partition() Default STARTS rounding depending on INTERVAL type If STARTS clause is omitted, default one is assigned with value derived from query timestamp. The rounding is done on STARTS value depending on INTERVAL type: SECOND: no rounding is done; MINUTE: timestamp seconds is set to 0; HOUR: timestamp seconds and minutes are set to 0; DAY, WEEK, MONTH and YEAR: timestamp seconds, minutes and hours are set to 0 (the date of rotation is kept as current date).
* | Merge 10.4 into 10.5Marko Mäkelä2019-09-061-23/+13
|\ \ | |/
| * Compilation fixAleksey Midenkov2019-09-011-4/+1
| | | | | | | | | | Caused by: MDEV-18501 Partition pruning doesn't work for historical queries (cleanup)
| * MDEV-18501 Partition pruning doesn't work for historical queries (refactoring)Aleksey Midenkov2019-09-011-11/+11
| | | | | | | | | | | | | | | | | | SYSTEM_TYPE partitioning: COLUMN properties removed. Partitioning is now pure RANGE based on UNIX_TIMESTAMP(row_end). DECIMAL type is now allowed as RANGE partitioning, we can partition by UNIX_TIMESTAMP() (but not for DATETIME which depends on local timezone of course).
| * MDEV-18501 Partition pruning doesn't work for historical queries (cleanup)Aleksey Midenkov2019-09-011-8/+1
| | | | | | | | Cleanup removes useless allocation.
* | Revert "MDEV-20342 Turn Field::flags from a member to a method"Alexander Barkov2019-08-141-1/+1
| | | | | | | | | | | | | | This reverts commit e86010f909fb6b8c4ffd9d6df92991ac079e67e7. Reverting on Monty's request, as this change makes merging things from 10.5 to 10.2 much harder.
* | MDEV-20342 Turn Field::flags from a member to a methodAlexander Barkov2019-08-141-1/+1
| |
* | Using more of Sql_mode_save. Adding a similar class for THD::abort_on_warnings.Alexander Barkov2019-05-281-5/+1
|/
* Merge 10.2 into 10.3Marko Mäkelä2019-05-141-1/+1
|\
| * Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
| |\
| | * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| | |\
| | | * Update FSF AddressVicențiu Ciorbaru2019-05-111-1/+1
| | | | | | | | | | | | | | | | * Update wrong zip-code
* | | | Merge branch '10.2' into 10.3Sergei Golubchik2019-03-171-5/+4
|\ \ \ \ | |/ / /
| * | | Merge branch '10.1' into 10.2Sergei Golubchik2019-03-151-5/+4
| |\ \ \ | | |/ /
| | * | fix gcc 8 compiler warningsSergei Golubchik2019-03-141-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two newly enabled warnings: 1. cast for a function pointers. Affected sql_analyse.h, mi_write.c and ma_write.cc, mf_iocache-t.cc, mysqlbinlog.cc, encryption.cc, etc 2. memcpy/memset of nontrivial structures. Fixed as: * the warning disabled for InnoDB * TABLE, TABLE_SHARE, and TABLE_LIST got a new method reset() which does the bzero(), which is safe for these classes, but any other bzero() will still cause a warning * Table_scope_and_contents_source_st uses `TABLE_LIST *` (trivial) instead of `SQL_I_List<TABLE_LIST>` (not trivial) so it's safe to bzero now. * added casts in debug_sync.cc and sql_select.cc (for JOIN) * move assignment method for MDL_request instead of memcpy() * PARTIAL_INDEX_INTERSECT_INFO::init() instead of bzero() * remove constructor from READ_RECORD() to make it trivial * replace some memcpy() with c++ copy assignments
* | | | merge fixes: sql_table.cc and partition_info.cc (caused by ef4ccb6ce2fd3) doneAndrei Elkin2019-02-071-1/+1
| | | |
* | | | Merge branch '10.2' into 10.3Sergei Golubchik2019-01-031-2/+2
|\ \ \ \ | |/ / /
| * | | Merge branch '10.1' into 10.2mariadb-10.2.21Sergei Golubchik2018-12-301-2/+2
| |\ \ \ | | |/ /
| | * | Merge branch '10.0' into 10.1Sergei Golubchik2018-12-291-2/+2
| | |\ \
| | | * | MDEV-17589: Stack-buffer-overflow with indexed varchar (utf8) fieldbb-10.0-varunVarun Gupta2018-12-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a new constant MAX_DATA_LENGTH_FOR_KEY. Replace the value of MAX_KEY_LENGTH to also include the LENGTH and NULL BYTES of a field.
| | | * | Fix cmake -DWITH_PARTITION_STORAGE_ENGINE:BOOL=OFFMarko Mäkelä2018-12-131-17/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a backport of a part of commit 18455ec3f1a9c22977f0ed87233852813b53eb49 from 10.1.
* | | | | Merge 10.2 into 10.3Marko Mäkelä2018-12-121-0/+17
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.1 into 10.2Marko Mäkelä2018-12-121-0/+17
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.0 into 10.1Marko Mäkelä2018-12-121-0/+17
| | |\ \ \ | | | |/ /
| | | * | MDEV-17032: Estimates are higher for partitions of a table with ↵Varun Gupta2018-12-071-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | @@use_stat_tables= PREFERABLY The problem here is EITS statistics does not calculate statistics for the partitions of the table. So a temporary solution would be to not read EITS statistics for partitioned tables. Also disabling reading of EITS for columns that participate in the partition list of a table.
| * | | | MDEV-16101: ADD PARTITION on table partitioned by list does not work with ↵Jacob Mathew2018-05-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | more than 32 list values. This problem occured because the reorganization of the list of values when the number of elements exceeds 32 was not handled correctly. I have fixed the problem by fixing the way that the list values are reorganized when the number of list values exceeds 32. Author: Jacob Mathew. Reviewer: Alexey Botchkov. Merged From: Commit 8e01598 on branch bb-10.3-MDEV-16101
* | | | | MDEV-16101: ADD PARTITION on table partitioned by list does not work with ↵Jacob Mathew2018-05-141-1/+3
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | more than 32 list values. This problem occured because the reorganization of the list of values when the number of elements exceeds 32 was not handled correctly. I have fixed the problem by fixing the way that the list values are reorganized when the number of list values exceeds 32. Author: Jacob Mathew. Reviewer: Alexey Botchkov. Merged From: Branch bb-10.3-MDEV-16101
| * | | | | MDEV-16101: ADD PARTITION on table partitioned by list does not work with ↵bb-10.3-MDEV-16101Jacob Mathew2018-05-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | more than 32 list values. This problem occured because the reorganization of the list of values when the number of elements exceeds 32 was not handled correctly. I have fixed the problem by fixing the way that the list values are reorganized when the number of list values exceeds 32. Author: Jacob Mathew. Reviewer: Alexey Botchkov.
* | | | | | versioning: use @@timestampSergei Golubchik2018-05-121-2/+2
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use hidden system time in versioning, but keep the system time logic in THD to workaround low-res system clock and replication not versioned to versioned. This reverts MDEV-14788 (System versioning cannot be based on local timestamps, as it is now). Versioning is based on local timestamps again, but timestamps are protected by MDEV-15923 (option to control who can set session @@timestamp).
* | | | | Remove mem_alloc_error()Michael Widenius2018-05-071-49/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As thd->alloc() and new automatically calls my_error(ER_OUTOFMEORY) there is no reason to call mem_alloc_error() Other things: - Fixed bug in mysql_unpack_partition() where lex.part_info was changed even if it would be a null pointer
* | | | | Add likely/unlikely to speed up executionMonty2018-05-071-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added to: - if (error) - Lex - sql_yacc.yy and sql_yacc_ora.yy - In header files to alloc() calls - Added thd argument to thd_net_is_killed()
* | | | | dead code - related to vtmdSergei Golubchik2018-04-101-24/+0
| | | | | | | | | | | | | | | | | | | | (will be added back when it'll be used)
* | | | | compilation w/o partitioningSergei Golubchik2018-03-301-15/+16
| | | | |