summaryrefslogtreecommitdiff
path: root/mysql-test/t/update.test
Commit message (Collapse)AuthorAgeFilesLines
* Create 'main' test directory and move 't' and 'r' thereMichael Widenius2018-03-291-656/+0
|
* Merge branch '5.5' into 10.0Sergei Golubchik2015-11-181-14/+46
|\
| * MDEV-8701 Crash on derived queryOleksandr Byelkin2015-11-061-0/+73
| | | | | | | | | | | | MDEV-8938 Server Crash on Update with joins Make unique table check after setup_fields of update because unique table can materialize table and we do not need field resolving after materialization.
* | MDEV-8701 Crash on derived queryOleksandr Byelkin2015-11-051-0/+41
| | | | | | | | Make unique table check after setup_fields of update because unique table can materialize table and we do not need field resolving after materialization.
* | Merge branch '5.5' into 10.0Sergei Golubchik2015-10-091-0/+15
|\ \ | |/
| * Merge remote-tracking branch 'mysql/5.5' into 5.5Sergei Golubchik2015-10-081-0/+15
| |\
| | * Bug #21143080: UPDATE ON VARCHAR AND TEXT COLUMNS PRODUCESreeharsha Ramanavarapu2015-07-161-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | INCORRECT RESULTS Issue: ----- Updating varchar and text fields in the same update statement can produce incorrect results. When a varchar field is assigned to the text field and the varchar field is then set to a different value, the text field's result contains the varchar field's new value. SOLUTION: --------- Currently the blob type does not allocate space for the string to be stored. Instead it contains a pointer to the varchar string. So when the varchar field is changed as part of the update statement, the value contained in the blob also changes. The fix would be to actually store the value by allocating space for the blob's string. We can avoid allocating this space when the varchar field is not being written into.
| | * Bug #54734 assert in Diagnostics_area::set_ok_statusJon Olav Hauglid2010-07-191-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This assert checks that the server does not try to send OK to the client if there has been some error during processing. This is done to make sure that the error is in fact sent to the client. The problem was that view errors during processing of WHERE conditions in UPDATE statements where not detected by the update code. It therefore tried to send OK to the client, triggering the assert. The bug was only noticeable in debug builds. This patch fixes the problem by making sure that the update code checks for errors during condition processing and acts accordingly.
| | * Bug#50545: Single table UPDATE IGNORE crashes on Martin Hansson2010-03-101-0/+16
| | | | | | | | | | | | | | | | | | | | | join view in sql_safe_updates mode. This bug was unexpectedly fixed along with bug number 49534. This patch contains only the test case.
| | * Bug #47919 assert in open_table during ALTER temporary tableJon Olav Hauglid2009-10-231-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This assertion would occur if UPDATE was used to update multiple tables containing an AUTO_INCREMENT column and if the inserted row had a user-supplied value for that column. The assertion could then be triggered by the next statement. The problem was only noticeable on debug builds of the server. The cause of the problem was that the code for multi update did not properly reset the TABLE->auto_increment_if_null flag after update. The flag is used to indicate that a non-null value of an auto_increment field has been provided by the user or retrieved from a current record. Open_tables() contains an assertion that tests this flag, and this was triggered in this case by ALTER TABLE. This patch fixes the problem by resetting the auto_increment_if_null field to FALSE once a row has been updated. This bug is similar to Bug#47274, but for multi update rather than INSERT DELAYED. Test case added to update.test.
| | * Bug #40745: Error during WHERE clause calculation in UPDATEGleb Shchepa2008-11-281-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | leads to an assertion failure Any run-time error in stored function (like recursive function call or update of table that is already updating by statement which invoked this stored function etc.) that was used in some expression of the single-table UPDATE statement caused an assertion failure. Multiple-table UPDATE (as well as INSERT and both single- and multiple-table DELETE) are not affected.
| | * Fix for bug #22364 "Inconsistent "matched rows" when executing UPDATE"kaa@polly.local2007-04-231-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | In multi_update::send_data(), the counter of matched rows was not correctly incremented, when during insertion of a new row to a temporay table it had to be converted from HEAP to MyISAM. This fix changes the logic to increment the counter of matched rows in the following cases: 1. If the error returned from write_row() is zero. 2. If the error returned from write_row() is non-zero, is neither HA_ERR_FOUND_DUPP_KEY nor HA_ERR_FOUND_DUPP_UNIQUE, and a call to create_myisam_from_heap() succeeds.
| | * Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-optevgen@moonbone.local2007-03-051-0/+8
| | |\ | | | | | | | | | | | | into moonbone.local:/mnt/gentoo64/work/clean-5.0-opt-mysql
| | | * Bug#25126: Wrongly resolved field leads to a crash.evgen@sunlight.local2007-03-041-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the ORDER BY clause gets fixed it's allowed to search in the current item_list in order to find aliased fields and expressions. This is ok for a SELECT but wrong for an UPDATE statement. If the ORDER BY clause will contain a non-existing field which is mentioned in the UPDATE set list then the server will crash due to using of non-existing (0x0) field. When an Item_field is getting fixed it's allowed to search item list for aliased expressions and fields only for selects.
| | * | Bug #24010: INSERT INTO ... SELECT fails on unique constraint with data mhansson/martin@linux-st28.site2007-02-221-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | it doesn't select. This bug was fixed along with bug #16861: User defined variable can have a wrong value if a tmp table was used. There the fix consisted of Item_func_set_user_var overloading the method Item::save_in_field. Consider the query from the test case: INSERT INTO foo( bar, baz ) SELECT bar, @newBaz := 1 + baz FROM foo WHERE quux <= 0.1; Here the assignment expression '@newBaz := 1 + baz' is represented by an Item_func_set_user_var. Its member method save_in_field, which writes the value of this assignment into the result field, writes the val_xxx() value, which is not updated at this point. In the fix introduced by the patch, the save_in_field method reads the actual variable value instead. See also comment for ChangeSet@1.2368.1.3, 2007-01-09 23:24:56+03:00, evgen@moonbone.local +4 -0 and comment for Item_func_set_user_var::save_in_field (item_func.cc)
| | * | Fix bug #24035.igor@olga.mysql.com2007-02-021-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This performance degradation for UPDATEs could be observed in the update statements for which the search key cannot be converted to any valid value of the type of the search column, like for a the condition int_fld=99999999999999999999999999, though it can be guaranteed here that there is no row with such a key value.
| | * | Merge mysql.com:/opt/local/work/mysql-4.1-rootkonstantin@mysql.com2006-02-021-0/+19
| | |\ \ | | | |/ | | | | | | | | into mysql.com:/opt/local/work/mysql-5.0-root
| | | * Mergesergefp@mysql.com2006-01-261-0/+11
| | | |\
| | | | * BUG#15935: In mysql_update, don't use full index scan when we could have ↵sergefp@mysql.com2006-01-251-0/+12
| | | | | | | | | | | | | | | | | | | | used quick select scan.
| | | * | Manually mergedevgen@moonbone.local2006-01-241-0/+8
| | | |\ \ | | | | |/ | | | |/|
| | | | * Fixed bug #16510: Updating field named like '*name' caused server crash.evgen@moonbone.local2006-01-231-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When setup_fields() function finds field named '*' it expands it to the list of all table fields. It does so by checking that the first char of field_name is '*', but it doesn't checks that the '* is the only char. Due to this, when updating table with a field named like '*name', such field is wrongly treated as '*' and expanded. This leads to making list of fields to update being longer than list of the new values. Later, the fill_record() function crashes by dereferencing null when there is left fields to update, but no more values. Added check in the setup_fields() function which ensures that the field expanding will be done only when '*' is the only char in the field name.
| | * | | Manually mergedevgen@moonbone.local2005-12-021-0/+17
| | |\ \ \ | | | |/ /
| | | * | Fix bug#15028 Multitable update returns different numbers of matched rowsevgen@moonbone.local2005-12-011-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | depending on table order multi_update::send_data() was counting updates, not updated rows. Thus if one record have several updates it will be counted several times in 'rows matched' but updated only once. multi_update::send_data() now counts only unique rows.
| | * | | Manually mergedevgen@moonbone.local2005-11-011-0/+9
| | |\ \ \ | | | |/ /
| | | * | Fix bug#14186 select datefield is null not updatedevgen@moonbone.local2005-10-281-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Date field was declared as not null, thus expression 'datefield is null' was always false. For SELECT special handling of such cases is used. There 'datefield is null' converted to 'datefield eq "0000-00-00"'. In mysql_update() before creation of select added remove_eq_conds() call. It makes some optimization of conds and in particular performs conversion from 'is null' to 'eq'. Also remove_eq_conds() makes some evaluation of conds and if it founds that conds is always false then update statement is not processed further. All this allows to perform some update statements process faster due to optimized conds, and not wasting resources if conds known to be false.
| | * | | Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1jani@ua141d10.elisa.omakaista.fi2005-10-271-4/+9
| | |\ \ \ | | | |/ / | | | | | | | | | | into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0-tmp
| | | * | Added more tests for new UPDATE ... ORDER BY ... LIMIT optimizationmonty@mysql.com2005-10-251-4/+9
| | | | |
| | * | | BUG#121915: Merge 4.1->5.0sergefp@mysql.com2005-10-191-0/+29
| | |\ \ \ | | | |/ /
| | | * | BUG#12915: Added single-table UPDATE/DELTE ... ORDER BY ... LIMITsergefp@mysql.com2005-09-301-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | optimization: now can use index to find records to update/delete when there is no WHERE clause.
| | * | | Manual mergeevgen@moonbone.local2005-09-221-0/+12
| | |\ \ \ | | | |/ /
| | | * | Fix bug #13180 thd->allow_sum_funcs wasn't reset before query processing.evgen@moonbone.local2005-09-221-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | thd->allow_sum_func was left 'true' after previous statement thus allowing sum funcs to be present in conditions. thd->allow_sum_func should be set to 0 for each query and each prepared statement reinitialization. This is done in lex_start() and reset_stmt_for_execute().
| | * | | Merge mysql.com:/home/my/mysql-4.1monty@mysql.com2005-07-281-0/+2
| | |\ \ \ | | | |/ / | | | | | | | | | | into mysql.com:/home/my/mysql-5.0
| | | * | Added end marker for tests to make future merges easiermonty@mysql.com2005-07-281-0/+2
| | | | |
| | * | | Merge moonbone.local:/work/mysql-4.1-bug-11868evgen@moonbone.local2005-07-181-0/+13
| | |\ \ \ | | | |/ / | | | | | | | | | | into moonbone.local:/work/mysql-5.0-bug-11482
| | | * | Fix bug#11868 NOT NULL ref optimization in subquery used in update must be evgen@moonbone.local2005-07-161-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | disabled if ref is built with a key from the updated table Problem was in add_not_null_conds() optimization function. It contains following code: JOIN_TAB *referred_tab= not_null_item->field->table->reginfo.join_tab; ... add_cond_and_fix(&referred_tab->select_cond, notnull); For UPDATE described in bug report referred_tab is 0 and dereferencing it crashes the server.
| | * | | bug#10466: Datatype "timestamp" displays "YYYYMMDDHHMMSS" irrespective of ↵msvensson@neptunus.(none)2005-06-201-2/+2
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | display sizes. - Print warning that says display width is not supported for datatype TIMESTAMP, if user tries to create a TIMESTAMP column with display width. - Use display width for TIMESTAMP only in type_timestamp test to make sure warning is displayed correctly.
| | * | Fix for BUG#9103: sergefp@mysql.com2005-04-181-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | Don't produce data truncation warnings from within cp_buffer_from_ref(). This function is only used to make index search tuples and data truncation that occurs here has no relation with truncated values being saved into tables.
| | * | Mergeramil@mysql.com2005-03-171-0/+10
| | |\ \ | | | |/
| | | * A fix (bug #8942: SUBSTRING_INDEX in UPDATE causes internal loop).ramil@mysql.com2005-03-171-0/+10
| | | |
| | | * Moved drop table statement to the end.timour@mysql.com2004-12-161-1/+1
| | | |
| | | * Test for BUG#6054. The bug itsel is fixed by the fix for #5837.timour@mysql.com2004-12-161-0/+9
| | | |
| | * | Bug#8057acurtis@pcgem.rdg.cyberkinetica.com2005-02-031-0/+9
| | | | | | | | | | | | | | | | | | | | Fix crash with LAST_INSERT_ID() in UPDATE, Tests included,
| | * | Test for BUG#6054. The bug itsel is fixed by the fix for #5837.timour@mysql.com2004-12-161-0/+9
| | | |
| | * | Merge with 4.0 for 4.1 releasemonty@mysql.com2004-10-061-0/+33
| | |\ \ | | | |/ | | | | | | | | | | | | | | | | | | | | Noteworthy: - New HANDLER code - New multi-update-grant-check code - Table lock code in ha_innodb.cc was not applied
| | | * Bug#5553 - Multi table UPDATE IGNORE fails on dup keyantony@ltantony.rdg.cyberkinetica.homeunix.net2004-09-171-0/+33
| | | | | | | | | | | | | | | | We don't want the update to abort when IGNORE is specified
| | * | Merge with 4.0monty@mysql.com2004-03-251-1/+0
| | |\ \ | | | |/
| | | * update.test:Sinisa@sinisa.nasamreza.org2004-03-151-1/+0
| | | | | | | | | | | | | | | | a fix for a test with latest change
| | * | for multy-delete command used same algorithm of table reference (alias)bell@sanja.is.com.ua2004-01-201-1/+1
| | | |
| | * | WorkLog#1323antony@ltantony.rdg.cyberkinetica.homeunix.net2003-12-101-2/+2
| | | | | | | | | | | | | | | | Deprecate the use of TYPE=... Preferred syntax is ENGINE=
| | * | Merge with 4.0.13monty@narttu.mysql.fi2003-05-191-5/+41
| | |\ \ | | | |/