summaryrefslogtreecommitdiff
path: root/sql/partition_info.cc
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Move alter partition flags to alter_info->partition_flagsMonty2018-03-291-1/+1
| | | | | | | | | | | This is done to get more free flag bits for alter_info->flags Renamed all ALTER PARTITION defines to start with ALTER_PARTITION_ Renamed ALTER_PARTITION to ALTER_PARTITION_INFO Renamed ALTER_TABLE_REORG to ALTER_PARTITION_TABLE_REORG Other things: - Shifted some ALTER_xxx defines to get empty bits at end
* fix THD::system_time to follow, well, system timeSergei Golubchik2018-02-251-2/+2
| | | | | | | | | Because NOW() is set to system time, unless overriden. And both should follow big manual system time changes, while still coping with lowres system clocks. Ignoring system time changes is both confusing and breaks with restarts.
* MDEV-15190 Bad error for non-versioned table PARTITION BY SYSTEM_TIMESergei Golubchik2018-02-241-1/+2
|
* PARTITION BY SYSTEM_TIME INTERVAL ...Sergei Golubchik2018-02-231-449/+61
| | | | | | | | | | | | | | | | | | | Lots of changes: * calculate the current history partition in ::external_lock(), not in ::write_row() or ::update_row() * remove dynamically collected per-partition row_end stats * no full table scan in open_table_from_share to calculate these stats, no manual MDL/thr_locks in open_table_from_share * no shared stats in TABLE_SHARE = no mutexes or condition waits when calculating current history partition * always compare timestamps, don't convert them to MYSQL_TIME (avoid DST ambiguity, and it's faster too) * correct interval handling, 1 month = 1 month, not 30 * 24 * 3600 seconds * save/restore first partition start time, and count intervals from there * only allow to drop first partitions if INTERVAL * when adding new history partitions, split the data in the last history parition, if it was overflowed * show partition boundaries in INFORMATION_SCHEMA.PARTITIONS
* cleanup: partition_info::check_constantsSergei Golubchik2018-02-231-400/+3
| | | | | | | | | | | | | | partition_info had a bunch of function pointers to avoid if()'s when invoking part_type specific functionality (like get_part_id, etc). But check_range_constants() and check_list_constants() were still invoked conditionally, with if()'s. Create partition_info::check_constants function pointer, get rid of if()'s Also remove alloc argument of check_range_constants(), added in 26a3ff0a22e. Broken system versioning will be fixed in following commits.
* Merge branch 'bb-10.2-ext' into 10.3Sergei Golubchik2018-02-231-18/+17
|\
| * Merge branch '10.2' into bb-10.2-extSergei Golubchik2018-02-221-17/+16
| |\
| | * Merge branch '10.1' into 10.2Sergei Golubchik2018-02-221-17/+16
| | |\
| | | * fix compilation wih -DPLUGIN_PARTITION=NOSergei Golubchik2018-02-211-17/+16
| | | |
* | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2018-02-191-2/+3
|\ \ \ \ | |/ / /
* | | | MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from ↵Vladislav Vaintroub2018-02-061-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'size_t' to 'type', possible loss of data) Handle string length as size_t, consistently (almost always:)) Change function prototypes to accept size_t, where in the past ulong or uint were used. change local/member variables to size_t when appropriate. This fix excludes rocksdb, spider,spider, sphinx and connect for now.
* | | | Changed database, tablename and alias to be LEX_CSTRINGMonty2018-01-301-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was done in, among other things: - thd->db and thd->db_length - TABLE_LIST tablename, db, alias and schema_name - Audit plugin database name - lex->db - All db and table names in Alter_table_ctx - st_select_lex db Other things: - Changed a lot of functions to take const LEX_CSTRING* as argument for db, table_name and alias. See init_one_table() as an example. - Changed some function arguments from LEX_CSTRING to const LEX_CSTRING - Changed some lists from LEX_STRING to LEX_CSTRING - threads_mysql.result changed because process list_db wasn't always correctly updated - New append_identifier() function that takes LEX_CSTRING* as arguments - Added new element tmp_buff to Alter_table_ctx to separate temp name handling from temporary space - Ensure we store the length after my_casedn_str() of table/db names - Removed not used version of rename_table_in_stat_tables() - Changed Natural_join_column::table_name and db_name() to never return NULL (used for print) - thd->get_db() now returns db as a printable string (thd->db.str or "")
* | | | MDEV-11084 Select statement with partition selection against MyISAM table ↵Alexey Botchkov2018-01-291-11/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | opens all partitions. Now we don't open partitions if it was explicitly cpecified. ha_partition::m_opened_partition bitmap added to track partitions that were actually opened.
* | | | compilation warning on windowsSergei Golubchik2018-01-171-1/+1
| | | |
* | | | MDEV-14923 Assertion upon INSERT into locked versioned partitioned tableAleksey Midenkov2018-01-131-17/+22
| | | |
* | | | System Versioning 1.0 pre8Aleksey Midenkov2018-01-101-53/+21
|\ \ \ \ | | | | | | | | | | | | | | | Merge branch '10.3' into trunk
| * \ \ \ Merge bb-10.2-ext into 10.3Marko Mäkelä2018-01-041-0/+20
| |\ \ \ \ | | |/ / /
| | * | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extMonty2018-01-011-0/+20
| | |\ \ \ | | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: cmake/make_dist.cmake.in mysql-test/r/func_json.result mysql-test/r/ps.result mysql-test/t/func_json.test mysql-test/t/ps.test sql/item_cmpfunc.h
| | | * | Merge remote-tracking branch 'origin/10.1' into 10.2Vicențiu Ciorbaru2017-12-221-0/+20
| | | |\ \ | | | | |/
| | | | * Merge branch '10.0' into 10.1Vicențiu Ciorbaru2017-12-201-0/+20
| | | | |\
| | | | | * Merge remote-tracking branch '5.5' into 10.0Vicențiu Ciorbaru2017-12-201-0/+20
| | | | | |\
| | | | | | * MDEV-13788 Server crash when issuing bad SQL partition syntaxAlexander Barkov2017-11-201-0/+20
| | | | | | |
| | | | * | | Merge branch '10.0' into 10.1Sergei Golubchik2017-10-221-3/+0
| | | | |\ \ \ | | | | | |/ /
| | | | | * | Merge branch '5.5' into 10.0Sergei Golubchik2017-10-181-2/+0
| | | | | |\ \ | | | | | | |/
| | | | | | * MDEV-13459 Warnings, when compiling with gcc-7.xSergei Golubchik2017-10-171-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | mostly caused by -Wimplicit-fallthrough
| * | | | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-11-301-2/+1
| |\ \ \ \ \ \ | | |/ / / / /
| | * | | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-11-291-2/+1
| | |\ \ \ \ \ | | | |/ / / /
| | | * | | | MDEV-13550 Copy ctor instread of memcpy() in partition_info::get_clone() (#436)Aleksey Midenkov2017-11-221-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | List<>::last is wrong after memcpy(). Doing it on constructed objects is bad practice.
* | | | | | | rename system_time columnsSergei Golubchik2018-01-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sys_trx_start -> row_start sys_trx_end -> row_end
* | | | | | | SQL: lower priority of warning in vers_part_rotate() for ALTER [fixes #446]Aleksey Midenkov2018-01-061-3/+5
| | | | | | |
* | | | | | | MDEV-14748 Assertion in ha_myisammrg::attach_children() [fixes #434]Aleksey Midenkov2017-12-291-0/+4
| | | | | | |
* | | | | | | MDEV-14747 ALTER PARTITION BY SYSTEM_TIME after LOCK TABLESAleksey Midenkov2017-12-261-1/+5
| | | | | | |
* | | | | | | MDEV-14741 Assertion '(trx)->start_file == 0' failedAleksey Midenkov2017-12-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | in row_truncate_table_for_mysql()
* | | | | | | MDEV-14740 Locking assertion for system_time partitioningAleksey Midenkov2017-12-221-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assertion `thd->locked_tables_mode <= LTM_LOCK_TABLES || !thd->lex->requires_prelocking()' failed in lock_tables().
* | | | | | | MDEV-14730 Assertion `m_lock_type == 2' failed in handler::ha_closeAleksey Midenkov2017-12-211-20/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | SQL: class Table_locker
* | | | | | | MDEV-14722 Partition: assertion in ha_commit_trans() for sub-statementAleksey Midenkov2017-12-211-2/+4
| | | | | | |
* | | | | | | MDEV-14685 Assertion `!fully || (bool) hist_part' failed in ↵Aleksey Midenkov2017-12-201-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Vers_part_info::initialized
* | | | | | | Timestamp-based versioning for InnoDB [closes #209]Aleksey Midenkov2017-12-181-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Removed integer_fields check * Reworked Vers_parse_info::check_sys_fields() * Misc renames * versioned as vers_sys_type_t * Removed versioned_by_sql(), versioned_by_engine() versioned() works as before; versioned(VERS_TIMESTAMP) is versioned_by_sql(); versioned(VERS_TRX_ID) is versioned_by_engine(). * create_tmp_table() fix * Foreign constraints for timestamp-based * Range auto-specifier fix * SQL: 1-row partition rotation fix [fixes #260] * Fix 'drop system versioning, algorithm=inplace'
* | | | | | | System Versioning 1.0 pre6Aleksey Midenkov2017-12-151-12/+14
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Merge remote-tracking branch 'mariadb/bb-10.3-temporal-serg' into trunk
| * | | | | | | Partitioning syntax for versioningSergei Golubchik2017-12-141-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | partition by system_time ( partition p0 history, partition pn current )
| * | | | | | | yet another error message fixSergei Golubchik2017-12-131-0/+2
| | | | | | | |
* | | | | | | | Paritioning: better error for disabled IB engineAleksey Midenkov2017-12-131-1/+1
|/ / / / / / /
* | | | | | | SQL: destroy Vers_min_max_stats [#346]Aleksey Midenkov2017-11-271-2/+4
| | | | | | |