summaryrefslogtreecommitdiff
path: root/sql/partition_info.h
Commit message (Collapse)AuthorAgeFilesLines
* dead code - related to vtmdSergei Golubchik2018-04-101-1/+0
| | | | (will be added back when it'll be used)
* PARTITION BY SYSTEM_TIME INTERVAL ...Sergei Golubchik2018-02-231-155/+32
| | | | | | | | | | | | | | | | | | | 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-9/+6
| | | | | | | | | | | | | | 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.
* Vers SQL: partition rotation by INTERVAL fixAleksey Midenkov2018-02-231-2/+3
| | | | Update partition stats on ha_partition::write_row()
* MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from ↵Vladislav Vaintroub2018-02-061-2/+2
| | | | | | | | | | | '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.
* MDEV-11084 Select statement with partition selection against MyISAM table ↵Alexey Botchkov2018-01-291-2/+3
| | | | | | | | 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-3/+3
|
* MDEV-14923 Assertion upon INSERT into locked versioned partitioned tableAleksey Midenkov2018-01-131-1/+1
|
* System Versioning 1.0 pre8Aleksey Midenkov2018-01-101-22/+1
|\ | | | | | | Merge branch '10.3' into trunk
| * Merge remote-tracking branch 'origin/10.2' into bb-10.2-extMonty2018-01-011-0/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+1
| | |\
| | | * Merge branch '10.0' into 10.1Vicențiu Ciorbaru2017-12-201-0/+1
| | | |\
| | | | * Merge remote-tracking branch '5.5' into 10.0Vicențiu Ciorbaru2017-12-201-0/+1
| | | | |\
| | | | | * MDEV-13788 Server crash when issuing bad SQL partition syntaxAlexander Barkov2017-11-201-0/+1
| | | | | |
* | | | | | MDEV-14821 Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())` ↵Eugene Kosov2018-01-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | failed in Diagnostics_area::set_ok_status
* | | | | | Partition: uninitialized vers_info fixAleksey Midenkov2017-12-221-1/+1
| | | | | |
* | | | | | Timestamp-based versioning for InnoDB [closes #209]Aleksey Midenkov2017-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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'
* | | | | | Partitioning syntax for versioningSergei Golubchik2017-12-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | partition by system_time ( partition p0 history, partition pn current )
* | | | | | fix win32 warningsEugene Kosov2017-11-131-1/+1
| | | | | |
* | | | | | System Versioning pre0.12Aleksey Midenkov2017-11-071-1/+222
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | Merge remote-tracking branch 'origin/archive/2017-10-17' into 10.3
| * | | | | SQL: partitioning misc fixes [closes #242]Aleksey Midenkov2017-09-071-15/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cleanup: *never* use assert(A && B) * vers_setup_1() revisited * vers_setup_2() renamed * partition_element::type removed * Copy ctor instead of memcpy() * Handle return value from check_range_constants() * Malloc error fix * error, style, misc fixes
| * | | | | Style: partitioning, sysvars, handler fixesAleksey Midenkov2017-09-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Sys_var_vers_asof formatting * Vers_field_stats renamed to Vers_min_max_stats * Item_temporal_literal::set_lower()/set_higher() replaced by operator>()/operator<() * handler API comments
| * | | | | Style: API renamesAleksey Midenkov2017-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | part_recs_slow() -> part_records(); HTON_SUPPORTS_SYS_VERSIONING -> HTON_NATIVE_SYS_VERSIONING.
| * | | | | IB, SQL: InnoDB partitioning [closes #118]Aleksey Midenkov2017-05-051-4/+45
| | | | | | | | | | | | | | | | | | | | | | | | * native InnoDB partitioning for BY SYSTEM_TIME partitions.
| * | | | | SQL: (0.6) Pruning for VERSIONING partitions [closes #97]Aleksey Midenkov2017-05-051-10/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * based on RANGE pruning by COLUMNS (sys_trx_end) condition * removed DEFAULT; AS OF NOW is always last; current VERSIONING as last non-empty (or first empty) * Min/Max stats in TABLE_SHARE * ALTER TABLE ADD PARTITION adds before AS OF NOW partition
| * | | | | SQL: (0.5) Versioned partitions [closes #77]Aleksey Midenkov2017-05-051-0/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * one `AS OF NOW`, multiple `VERSIONING` partitions; * rotation of `VERSIONING` partitions by record count, time period; * rotation is multi-threaded; * conventional subpartitions as bottom level for versioned partitions; * `DEFAULT` keyword selects first `VERSIONING` partition; * ALTER TABLE ADD/DROP partition; * REBUILD PARTITION basic operation.
* | | | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-07-121-3/+2
|\ \ \ \ \ \ | | |/ / / / | |/| | | |
| * | | | | Merge branch '10.1' into 10.2Sergei Golubchik2017-07-081-3/+2
| |\ \ \ \ \ | | | |/ / / | | |/| | |
| | * | | | Merge branch '10.0' into 10.1Sergei Golubchik2017-07-071-3/+2
| | |\ \ \ \ | | | | |/ / | | | |/| |
| | | * | | Merge branch '5.5' into 10.0Sergei Golubchik2017-07-061-3/+2
| | | |\ \ \ | | | | | |/ | | | | |/|
* | | | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-07-071-7/+0
|\ \ \ \ \ \ | |/ / / / /
| * | | | | cleanup: part_func_string and subpart_func_stringSergei Golubchik2017-07-051-7/+0
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | Remove now-unused part_func_string and subpart_func_string from partition_info.
* | | | | Changing field::field_name and Item::name to LEX_CSTRINGMonty2017-04-231-3/+3
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Benefits of this patch: - Removed a lot of calls to strlen(), especially for field_string - Strings generated by parser are now const strings, less chance of accidently changing a string - Removed a lot of calls with LEX_STRING as parameter (changed to pointer) - More uniform code - Item::name_length was not kept up to date. Now fixed - Several bugs found and fixed (Access to null pointers, access of freed memory, wrong arguments to printf like functions) - Removed a lot of casts from (const char*) to (char*) Changes: - This caused some ABI changes - lex_string_set now uses LEX_CSTRING - Some fucntions are now taking const char* instead of char* - Create_field::change and after changed to LEX_CSTRING - handler::connect_string, comment and engine_name() changed to LEX_CSTRING - Checked printf() related calls to find bugs. Found and fixed several errors in old code. - A lot of changes from LEX_STRING to LEX_CSTRING, especially related to parsing and events. - Some changes from LEX_STRING and LEX_STRING & to LEX_CSTRING* - Some changes for char* to const char* - Added printf argument checking for my_snprintf() - Introduced null_clex_str, star_clex_string, temp_lex_str to simplify code - Added item_empty_name and item_used_name to be able to distingush between items that was given an empty name and items that was not given a name This is used in sql_yacc.yy to know when to give an item a name. - select table_name."*' is not anymore same as table_name.* - removed not used function Item::rename() - Added comparision of item->name_length before some calls to my_strcasecmp() to speed up comparison - Moved Item_sp_variable::make_field() from item.h to item.cc - Some minimal code changes to avoid copying to const char * - Fixed wrong error message in wsrep_mysql_parse() - Fixed wrong code in find_field_in_natural_join() where real_item() was set when it shouldn't - ER_ERROR_ON_RENAME was used with extra arguments. - Removed some (wrong) ER_OUTOFMEMORY, as alloc_root will already give the error. TODO: - Check possible unsafe casts in plugin/auth_examples/qa_auth_interface.c - Change code to not modify LEX_CSTRING for database name (as part of lower_case_table_names)
* | | | cleanup: remove dead (half-merged) code from partition_info.*Sergei Golubchik2016-12-121-50/+1
| | | |
* | | | cleanup: remove Item::intro_versionSergei Golubchik2016-12-121-1/+0
| | | | | | | | | | | | | | | | | | | | and partition_info::set_show_version_string - they were already broken and impossible to maintain
* | | | MDEV-6112 multiple triggers per tableMonty2016-10-051-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is similar to MysQL Worklog 3253, but with a different implementation. The disk format and SQL syntax is identical with MySQL 5.7. Fetures supported: - "Any" ammount of any trigger - Supports FOLLOWS and PRECEDES to be able to put triggers in a certain execution order. Implementation details: - Class Trigger added to hold information about a trigger. Before this trigger information was stored in a set of lists in Table_triggers_list and in Table_triggers_list::bodies - Each Trigger has a next field that poinst to the next Trigger with the same action and time. - When accessing a trigger, we now always access all linked triggers - The list are now only used to load and save trigger files. - MySQL trigger test case (trigger_wl3253) added and we execute these identically. - Even more gracefully handling of wrong trigger files than before. This is useful if a trigger file uses functions or syntax not provided by the server. - Each trigger now has a "Created" field that shows when the trigger was created, with 2 decimals. Other comments: - Many of the changes in test files was done because of the new "Created" field in the trigger file. This shows up in SHOW ... TRIGGER and when using information_schema.trigger. - Don't check if all memory is released if on uses --gdb; This is needed to be able to get a list from safemalloc of not freed memory while debugging. - Added option to trim_whitespace() to know how many prefix characters was skipped. - Changed a few ulonglong sql_mode to sql_mode_t, to find some wrong usage of sql_mode.
* | | | MDEV-8348: Add catchall to all table partitioning for list partitionsOleksandr Byelkin2016-09-071-2/+8
| | | | | | | | | | | | | | | | | | | | DEFAULT partition support added to LIST and LIST COLUMN partitioning. Partitions Prunning added for DEFAULT partititon.
* | | | MDEV-8716 - Obsolete sql_calloc() in favor of THD::calloc() and thd_calloc()Sergey Vojtovich2015-11-261-5/+7
| | | |
* | | | MDEV-8719 - Obsolete sql_memdup() in favor of THD::memdup() and thd_memdup()Sergey Vojtovich2015-11-261-1/+1
|/ / /
* | | MDEV-6152: Remove calls to current_thd while creating ItemMonty2015-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Part 4: Removing calls to sql_alloc() and sql_calloc() Other things: - Added current_thd in some places to make it clear that it's called (easier to remove later) - Move memory allocation from Item_func_case::fix_length_and_dec() to Item_func_case::fix_fields() - Added mem_root to some new calls - Fixed some wrong UNINIT_VAR() calls - Fixed a bug in generate_partition_syntax() in case of errors - Added mem_root to argument to new thread_info - Simplified my_parse_error() call in sql_yacc.yy
* | | MDEV-6152: Remove calls to current_thd while creating ItemMonty2015-08-271-5/+5
|/ / | | | | | | | | | | | | | | - Part 3: Adding mem_root to push_back() and push_front() Other things: - Added THD as an argument to some partition functions. - Added memory overflow checking for XML tag's in read_xml()
* | 10.0-base mergeSergei Golubchik2014-02-261-1/+1
|\ \
| * \ 5.5 mergeSergei Golubchik2014-02-251-1/+1
| |\ \ | | |/
| | * MySQL-5.5.36 mergeSergei Golubchik2014-02-171-1/+1
| | |\ | | | | | | | | | | | | (without few incorrect bugfixes and with 1250 files where only a copyright year was changed)
| | | * Updated/added copyright headersMurthy Narkedimilli2014-01-061-1/+1
| | | |
* | | | 10.0-base mergeSergei Golubchik2014-02-031-1/+1
|\ \ \ \ | |/ / /
| * | | 5.5 mergeSergei Golubchik2014-02-011-1/+1
| |\ \ \ | | |/ /
| | * | MDEV-5421 Assertion `! is_set()' fails on INSERT IGNORE when a table has no ↵Sergei Golubchik2014-01-231-1/+1
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | partition for a value make print_no_partition_found() to respect MYF(errflag) mysql-test/suite/parts/t/insert_ignore-5421.test: mdev:5421
* | | MDEV-5281 Partitioning issue after upgrade from 10.0.3-1 to 10.0.5-1Sergei Golubchik2013-11-281-15/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | merged from 5.6: Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING Bug#16589511: MYSQL_UPGRADE FAILS TO WRITE OUT ENTIRE ALTER TABLE ... ALGORITHM= ... STATEMENT Bug#16274455: CAN NOT ACESS PARTITIONED TABLES WHEN DOWNGRADED FROM 5.6.11 TO 5.6.10 plus minor changes from 5.6, mainly comments
* | | MDEV-4786 merge 10.0-monty -> 10.0Sergei Golubchik2013-08-121-14/+0
| | | | | | | | | | | | remove half-applied "Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING"