summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.3 into 10.4Marko Mäkelä2020-07-211-0/+4
|\
| * MDEV-20661 Virtual fields are not recalculated on system fields value assignmentAleksey Midenkov2020-07-201-0/+4
| | | | | | | | | | | | | | Fix stale virtual field value in 4 cases: when virtual field depends on row_start/row_end in timestamp/trx_id versioned table. row_start dep is recalculated in vers_update_fields() (SQL and InnoDB layer). row_end dep is recalculated on history row insert.
* | Merge 10.3 into 10.4Marko Mäkelä2019-12-271-30/+11
|\ \ | |/
| * Merge 10.2 into 10.3Marko Mäkelä2019-12-271-30/+11
| |\
| | * MDE-21369 rpl.rpl_timezone fails with valgrind: Use of uninitialised value.Alexey Botchkov2019-12-211-30/+11
| | | | | | | | | | | | | | | It's not safe to chenge the THD::thread_id. So send the thread_id as an argument to the mysql_audit_external_lock.
* | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-12-091-4/+77
|\ \ \ | |/ /
| * | Merge remote-tracking branch 10.2 into 10.3Jan Lindström2019-12-021-4/+77
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | Conflicts: mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt mysql-test/suite/innodb/r/innodb-mdev-7513.result mysql-test/suite/innodb/t/innodb-mdev-7513.test mysql-test/suite/wsrep/disabled.def storage/innobase/ibuf/ibuf0ibuf.cc
| | * MENT-510 Failing test(s): perfschema.threads_insert_delayed.HF2019-11-291-0/+1
| | | | | | | | | | | | | | | orig_test_id should be set properly. Also fixed sporadic test failure.
| | * MENT-510 Failing test(s): perfschema.threads_insert_delayed.Alexey Botchkov2019-11-271-1/+2
| | | | | | | | | | | | The thread_id of the INSERT DELAYED thread should not be set to 0.
| | * MENT-237 Audit to show INSERT DELAYED for the executing user.Alexey Botchkov2019-11-271-4/+75
| | | | | | | | | | | | | | | Add notifications about the user and connection that actually did the DELAYED insert.
* | | Merge 10.3 into 10.4Aleksey Midenkov2019-12-021-0/+2
|\ \ \ | |/ /
| * | MDEV-20441 ER_CRASHED_ON_USAGE upon update on versioned Aria tableAleksey Midenkov2019-12-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turn read cache off for update and multi-update for versioned table. no_cache is reinited on each TABLE open because it is applicable for specific algorithms. As a side fix vers_insert_history_row() honors vers_write setting. Aria with row_format=fixed uses IO_CACHE of type READ_CACHE for sequential read in update loop. When history row is inserted inside this loop the cache misses it and fails with error. TODO: Currently maria_extra() does not support SEQ_READ_APPEND. Probably it might be possible to use this type of cache.
* | | MDEV-18973 CLIENT_FOUND_ROWS wrong in spiderbb-10.4-MDEV-18973_2Kentoku2019-11-291-6/+24
| | | | | | | | | | | | | | | Get count from last_used_con->info Contributed by willhan at Tencent Games
* | | Merge 10.3 into 10.4Marko Mäkelä2019-11-011-16/+40
|\ \ \ | |/ /
| * | Simplify TABLE::decide_logging_format()Monty2019-10-201-1/+4
| | | | | | | | | | | | | | | | | | | | | - Use local variables table and share to simplify code - Use sql_command_flags to detect what kind of command was used - Added CF_DELETES_DATA to simplify detecton of delete commands - Removed duplicate error in create_table_from_items().
| * | Fixes for binary logging --read-only modeMonty2019-10-201-15/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Any temporary tables created under read-only mode will never be logged to binary log. Any usage of these tables to update normal tables, even after read-only has been disabled, will use row base logging (as the temporary table will not be on the slave). - Analyze, check and repair table will not be logged in read-only mode. Other things: - Removed not used varaibles in MYSQL_BIN_LOG::flush_and_set_pending_rows_event. - Set table_share->table_creation_was_logged for all normal tables. - THD::binlog_query() now returns -1 if statement was not logged., This is used to update table_share->table_creation_was_logged. - Don't log admin statements in opt_readonly is set. - Table's that doesn't have table_creation_was_logged will set binlog format to row logging. - Removed not needed/wrong setting of table->s->table_creation_was_logged in create_table_from_items()
* | | Merge 10.3 into 10.4Marko Mäkelä2019-10-101-4/+5
|\ \ \ | |/ /
| * | MDEV-17333 Assertion in update_auto_increment() upon exotic LOADAleksey Midenkov2019-10-101-4/+4
| | | | | | | | | | | | | | | | | | While `handler::next_insert_id` is restored on duplicate key errors `part_share->next_auto_inc_val` is not restored which causes discrepancy.
| * | MDEV-19406 Assertion on updating view of join with versioned tableAleksey Midenkov2019-10-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | TABLE::mark_columns_needed_for_update(): use_all_columns() assigns pointer of all_set into read_set and write_set, but this is not good since all_set is changed later by TABLE::mark_columns_used_by_index_no_reset(). Do column_bitmaps_signal() whenever we change read_set/write_set.
* | | Merge 10.3 into 10.4Marko Mäkelä2019-09-121-2/+5
|\ \ \ | |/ /
| * | MDEV-16490: It's possible to make a system versioned table without any ↵Nikita Malyavin2019-09-091-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | versioning field * do not allow versioned table to be without versioned (non-system) fields * prohibit changing field versioning, when removing table versioning * handle CREATE...SELECT as well
* | | Merge branch '10.3' into 10.4Sergei Golubchik2019-09-061-6/+4
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2019-09-041-5/+2
| |\ \ | | |/
| | * cleanup: on update default nowSergei Golubchik2019-09-031-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * remove one level of virtual functions * remove redundant checks * remove an if() as the value is always known at compilation time don't pretend that "DEFAULT expr" and "ON UPDATE DEFAULT NOW" are "basically the same thing"
| * | Merge 10.2 (up to commit ef00ac4c86daf3294c46a45358da636763fb0049) into 10.3Alexander Barkov2019-09-041-1/+2
| |\ \ | | |/
| | * Part2: MDEV-18156 Assertion `0' failed or `btr_validate_index(index, 0, ↵Alexander Barkov2019-09-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | false)' in row_upd_sec_index_entry or error code 126: Index is corrupted upon DELETE with PAD_CHAR_TO_FULL_LENGTH This patch allows the server to open old tables that have "bad" generated columns (i.e. indexed virtual generated columns, persistent generated columns) that depend on sql_mode, for general things like SELECT, INSERT, DROP, etc. Warning are issued in such cases. Only these commands are now disallowed and return an error: - CREATE TABLE introducing a "bad" generated column - ALTER TABLE introducing a "bad" generated column - CREATE INDEX introdicing a "bad" generated column (i.e. adding an index on a virtual generated column that depends on sql_mode). Note, these commands are allowed: - ALTER TABLE removing a "bad" generate column - ALTER TABLE removing an index from a "bad" virtual generated column - DROP INDEX removing an index from a "bad" virtual generated column but only if the table does not have any "bad" columns as a result.
* | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-09-021-1/+1
|\ \ \ | |/ /
| * | Merge branch '10.2' into 10.3Oleksandr Byelkin2019-09-021-1/+1
| |\ \ | | |/
| | * Merge remote-tracking branch 'connect/10.2' into 10.2Oleksandr Byelkin2019-08-301-1/+1
| | |\
* | | \ Merge 10.3 into 10.4Marko Mäkelä2019-08-141-0/+1
|\ \ \ \ | |/ / /
| * | | Merge 10.2 to 10.3Marko Mäkelä2019-08-131-0/+1
| |\ \ \ | | |/ /
| | * | Merge 10.1 into 10.2Marko Mäkelä2019-08-121-0/+1
| | |\ \
| | | * | MDEV-17614 INSERT on dup key update is replication unsafeSachin2019-08-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem:- When mysql executes INSERT ON DUPLICATE KEY INSERT, the storage engine checks if the inserted row would generate a duplicate key error. If yes, it returns the existing row to mysql, mysql updates it and sends it back to the storage engine.When the table has more than one unique or primary key, this statement is sensitive to the order in which the storage engines checks the keys. Depending on this order, the storage engine may determine different rows to mysql, and hence mysql can update different rows.The order that the storage engine checks keys is not deterministic. For example, InnoDB checks keys in an order that depends on the order in which indexes were added to the table. The first added index is checked first. So if master and slave have added indexes in different orders, then slave may go out of sync. Solution:- Make INSERT...ON DUPLICATE KEY UPDATE unsafe while using stmt or mixed format When there is more then one unique key. Although there is two exception. 1. Auto Increment key is not counted because Innodb will get gap lock for failed Insert and concurrent insert will get a next increment value. But if user supplies auto inc value it can be unsafe. 2. Count only unique keys for which insertion is performed. So this patch also addresses the bug id #72921
* | | | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-07-281-1/+5
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.2' into 10.3Oleksandr Byelkin2019-07-261-1/+5
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.1' into 10.2Oleksandr Byelkin2019-07-261-1/+5
| | |\ \ \ | | | |/ /
| | | * | Merge branch '5.5' into 10.1Oleksandr Byelkin2019-07-251-1/+5
| | | |\ \
| | | | * | MDEV-15572: view.test, server crash with --big-tables=1Oleksandr Byelkin2019-07-181-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | Check that table is really opened before cleanup using handler.
| | | * | | imporve clang buildEugene Kosov2019-06-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug Maintainer mode makes all warnings errors. This patch fix warnings. Mostly about deprecated `register` keyword. Too much warnings came from Mroonga and I gave up on it.
* | | | | | Merge 10.3 into 10.4Marko Mäkelä2019-06-191-0/+3
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.2 into 10.3Marko Mäkelä2019-06-191-0/+3
| |\ \ \ \ \ | | |/ / / /
| | * | | | MDEV-19771 REPLACE on table with virtual_field can cause crashMichael Widenius2019-06-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes also MDEV-17837 Problem was that we did not ignore warnings from virtual fields when updated virtual fields for to-be-replaced row.
* | | | | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-191-1/+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 10.3 into 10.4Marko Mäkelä2019-05-051-12/+50
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.2 into 10.3Marko Mäkelä2019-04-271-12/+50
| |\ \ \ \ \ | | |/ / / /
| | * | | | MDEV-16240: Assertion `0' failed in row_sel_convert_mysql_key_to_innobasebb-10.2-MDEV-16240Oleksandr Byelkin2019-04-251-11/+49
| | | | | | | | | | | | | | | | | | | | | | | | Set table in row ID position mode before using this function.