summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | Remove an unused variableMarko Mäkelä2019-03-211-2/+1
| | | | |
* | | | | MDEV-18859 Server crashes in bitmap_bits_set / pack_row / ↵Nikita Malyavin2019-04-021-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | THD::binlog_write_row upon DELETE .. FOR PORTION with binary logging rpl_write_set is initialized in TABLE::mark_columns_per_binlog_row_image. Since we just call use_all_columns for PORTION OF case, no need in column marking logic here. Instead, initialize table->rpl_write_set in place.
* | | | | MDEV-18852 MDEV-18853 fix `period.delete`, `period.update` tests crashes ↵Nikita Malyavin2019-04-021-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with ``--ps-protocol` The main problem was lack of proper QueryArena handling in `period_setup_conds`. Since mysql_prepare_update/mysql_prepare_delete are called during `PREPARE` statement, period conditions, should be allocated on statement query arena. Another problem is incorrect statement state handling in period_setup_conds, which led to unexpected mysql_update termination. * mysql_update: move period_setup_conds() to mysql_prepare_update to store conditions in statement's mem_root * mtr: add period suite to default list, since --ps-protocol is now fixed Fixes bugs: MDEV-18853 Assertion `0' failed in Protocol::end_statement upon DELETE .. FOR PORTION via prepared statement MDEV-18852 Server crashes in reinit_stmt_before_use upon UPDATE .. FOR PORTION via prepared statement
* | | | | Merge 10.3 into 10.4Marko Mäkelä2019-03-061-4/+4
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.2 into 10.3Marko Mäkelä2019-03-051-4/+4
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | | | | | | FIXME: Properly resolve conflicts between MDEV-18883 and MDEV-7742/MDEV-8305, and record the correct result for main.log_slow
| | * | | Merge 10.1 into 10.2Marko Mäkelä2019-03-041-4/+4
| | |\ \ \ | | | |/ /
| | | * | Merge branch '10.0' into 10.1Oleksandr Byelkin2019-03-011-3/+3
| | | |\ \
| | | | * \ Merge branch '5.5' into 10.0Oleksandr Byelkin2019-02-281-3/+3
| | | | |\ \ | | | | | |/
| | | | | * A cleanup in derived table handling: removing duplicate code from ↵Alexander Barkov2019-02-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | st_select_lex::handle_derived() st_select_lex::handle_derived() and mysql_handle_list_of_derived() had exactly the same implementations. - Adding a new method LEX::handle_list_of_derived() instead - Removing public function mysql_handle_list_of_derived() - Reusing LEX::handle_list_of_derived() in st_select_lex::handle_derived()
* | | | | | MDEV-16974 Application-time periods: UPDATENikita Malyavin2019-02-211-1/+3
| | | | | |
* | | | | | MDEV-16973 Application-time periods: DELETENikita Malyavin2019-02-211-9/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * inject portion of time updates into mysql_delete main loop * triggered case emits delete+insert, no updates * PORTION OF `SYSTEM_TIME` is forbidden * `DELETE HISTORY .. FOR PORTION OF ...` is forbidden as well
* | | | | | Fixed compiler warnings from optimized buildsMichael Widenius2019-01-151-3/+1
| | | | | |
* | | | | | Merge 10.3 into 10.4mariadb-10.4.0Marko Mäkelä2018-11-081-1/+1
|\ \ \ \ \ \ | |/ / / / /
| * | | | | MDEV-16697: Fix difference between 32bit/windows and 64bit systems in ↵Oleksandr Byelkin2018-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | allowed select nest level
* | | | | | Merge 10.3 into 10.4Marko Mäkelä2018-10-051-0/+1
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge branch '10.2' into 10.3Sergei Golubchik2018-09-281-0/+1
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge branch '10.1' into 10.2Sergei Golubchik2018-09-241-0/+1
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge branch '10.0' into 10.1Sergei Golubchik2018-09-231-0/+1
| | | |\ \ \ | | | | |/ /
| | | | * | Merge remote-tracking branch 'origin/5.5' into 10.0Alexander Barkov2018-09-211-0/+1
| | | | |\ \ | | | | | |/
| | | | | * MDEV-16741 Assertion `m_extra_cache' failed in ha_partition::late_extra_cacheEugene Kosov2018-09-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | multi_delete sets TABLE::no_cache=1 and should set it to 0 when DELETE is done.
* | | | | | Merge 10.3 into 10.4Marko Mäkelä2018-09-111-5/+9
|\ \ \ \ \ \ | |/ / / / /
| * | | | | MDEV-16783 Assertion `!conds' failed in mysql_delete upon 2nd execution of ↵Nikita Malyavin2018-08-241-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SP with DELETE HISTORY * remove assertion * do not setup `conds` if it's already cached Fixes #823
* | | | | | MDEV-11953: support of brackets in UNION/EXCEPT/INTERSECT operationsOleksandr Byelkin2018-07-041-14/+18
| | | | | |
* | | | | | mysys: rename ME_xxx flags to match plugin apiSergei Golubchik2018-06-041-1/+1
|/ / / / /
* | | | | MDEV-15380 Index for versioned table gets corrupt after partitioning and DELETEEugene Kosov2018-05-221-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a test case Update occurs between Search and Delete/Update. This corrupts rowid which Search saves for Delete/Update. Patch prevents this by using of HA_EXTRA_REMEMBER_POS and HA_EXTRA_RESTORE_POS in a partition code. This situation possibly occurs only with system versioning table and partition. MyISAM and Aria engines are affected. fix by midenok Closes #705
* | | | | Merge branch 'github/10.2' into 10.3Sergei Golubchik2018-05-221-1/+1
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.1' into 10.2Sergei Golubchik2018-05-201-1/+1
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.0' into 10.1Sergei Golubchik2018-05-191-1/+1
| | |\ \ \ | | | |/ /
| | | * | MDEV-11129 CREATE OR REPLACE TABLE t1 AS SELECT spfunc() crashes if spfunc() ↵Monty2018-05-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | references t1 Fixed by extending unique_table() with a flag to not allow usage of the replaced table. I also cleaned up find_dup_table() to not use goto next. I also added more comments to the code in find_dup_table()
* | | | | Merge 10.2 into 10.3Marko Mäkelä2018-05-171-8/+2
|\ \ \ \ \ | |/ / / /
| * | | | MDEV-14695: Assertion `n < m_size' failed in ↵Varun Gupta2018-05-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bounds_checked_array<Element_type>::operator In this issue we hit the assert because we are adding addition fields to the field JOIN::all_fields list. This is done because HEAP tables can't index BIT fields so we need to use an additional hidden field for grouping because later it will be converted to a LONG field. Original field will remain of the BIT type and will be returned. This happens when we convert DISTINCT to GROUP BY. The solution is to take into account the number of such hidden fields that would be added to the field JOIN::all_fields list while calculating the size of the ref_pointer_array.
* | | | | cleanup: versioning style fixesSergei Golubchik2018-05-121-2/+2
| | | | | | | | | | | | | | | | | | | | rename LString/XString classes, remove unused ones
* | | | | cleanup: hide HA_ERR_RECORD_DELETED in ha_rnd_next()Sergei Golubchik2018-05-121-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | it's internal storage engine error, don't let it leak into the upper layer.
* | | | | Add likely/unlikely to speed up executionMonty2018-05-071-42/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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()
* | | | | MDEV-15391 Server crashes in JOIN::fix_all_splittings_in_plan or Assertion ↵Sergei Golubchik2018-04-101-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `join->best_read < double(1.79...e+308L)' failed vers_setup_conds() used to AND all conditions on row_start/row_end columns and store it either in the WHERE clause or in the ON clause for some table. In some cases this caused ON clause to have conditions for tables that aren't part of that ON's join. Fixed to put a table's condition always in the ON clause of the corresponding table. Removed unnecessary ... `OR row_end IS NULL` clause, it's not needed in the ON clause. Simplified handling on PS and SP.
* | | | | create a reusable function that tells what FK actions can writeSergei Golubchik2018-02-241-4/+4
| | | | | | | | | | | | | | | | | | | | and few indentation changes
* | | | | unify error messages a bitSergei Golubchik2018-02-241-2/+2
| | | | |
* | | | | SQL: Truncate history of partitioned table [fixes #399, closes #403]Sergei Golubchik2018-02-231-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | also, don't rotate versioning partitions for DELETE HISTORY originally by: Aleksey Midenkov
* | | | | Changed database, tablename and alias to be LEX_CSTRINGMonty2018-01-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-14788 System versioning cannot be based on local timestamps, as it is nowSergei Golubchik2018-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | followup to be81b00c843 Fix updates and deletes too
* | | | | rename system_time columnsSergei Golubchik2018-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | sys_trx_start -> row_start sys_trx_end -> row_end
* | | | | SQL: DELETE HISTORY error message in prepared statements [#387]Eugene Kosov2017-12-221-3/+8
| | | | |
* | | | | MDEV-14687 DELETE HISTORY in prepared stmt crash [fixes #421]Aleksey Midenkov2017-12-201-14/+16
| | | | | | | | | | | | | | | | | | | | Also fixes broken truncate after 617e108fb6e2bc24e5c9badb94e7d8eaa65d8851
* | | | | MDEV-14684 Assertion `table' failed in mysql_deleteEugene Kosov2017-12-191-1/+8
| | | | | | | | | | | | | | | SQL: disable TRUNCATE table_name TO statement for VIEWs
* | | | | Timestamp-based versioning for InnoDB [closes #209]Aleksey Midenkov2017-12-181-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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'
* | | | | SQL: disable truncate history on partitioned [fixes #399]Aleksey Midenkov2017-12-141-0/+8
| | | | |
* | | | | System Versioning 1.0 pre3Aleksey Midenkov2017-12-111-12/+63
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | Merge branch '10.3' into trunk
| * | | | | Adding direct update/delete to the server and to the partition engine.Kentoku SHIBA2017-12-031-12/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for direct update and direct delete requests for spider. A direct update/delete request handles all qualified rows in a single operation rather than one row at a time. Contains Spiral patches: 006_mariadb-10.2.0.direct_update_rows.diff MDEV-7704 008_mariadb-10.2.0.partition_direct_update.diff MDEV-7706 010_mariadb-10.2.0.direct_update_rows2.diff MDEV-7708 011_mariadb-10.2.0.aggregate.diff MDEV-7709 027_mariadb-10.2.0.force_bulk_update.diff MDEV-7724 061_mariadb-10.2.0.mariadb-10.1.8.diff MDEV-12870 - The differences compared to the original patches: - Most of the parameters of the new functions are unnecessary. The unnecessary parameters have been removed. - Changed bit positions for new handler flags upon consideration of handler flags not needed by other Spiral patches and handler flags merged from MySQL. - Added info_push() (Was originally part of bulk access patch) - Didn't include code related to handler socket - Added HA_CAN_DIRECT_UPDATE_AND_DELETE Original author: Kentoku SHIBA First reviewer: Jacob Mathew Second reviewer: Michael Widenius
* | | | | | SQL: vers_setup_select() misc refactoringAleksey Midenkov2017-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Renamed to SELECT_LEX::vers_setup_conds(). Moved optimized fields check to JOIN::vers_check_items().
* | | | | | System Versioning 1.0pre2Aleksey Midenkov2017-11-231-12/+24
|\ \ \ \ \ \ | |/ / / / / | | | | | | | | | | | | Merge branch '10.3' into trunk