summaryrefslogtreecommitdiff
path: root/mysql-test/r/update.result
Commit message (Collapse)AuthorAgeFilesLines
* Remove end . from error messages to get them consistentMonty2016-10-051-2/+2
| | | | Fixed a few failing tests
* Merge branch '10.1' into 10.2Sergei Golubchik2016-09-091-0/+11
|\
| * Added new status variables to make it easier to debug certain problems:Monty2016-08-211-0/+11
| | | | | | | | | | | | - Handler_read_retry - Update_scan - Delete_scan
* | MDEV-6720 - enable connection log in mysqltest by defaultSergey Vojtovich2016-03-311-0/+4
|/
* Merge branch '5.5' into 10.0Sergei Golubchik2015-11-181-24/+48
|\
| * MDEV-8701 Crash on derived queryOleksandr Byelkin2015-11-061-0/+59
| | | | | | | | | | | | 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/+35
| | | | | | | | 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#52312 lost Handler_read_last status variableMarc Alff2010-08-251-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this fix, the ha_read_last_count status variable was defined and updated internally, for never exposed as a system variable. This fix exposes the system variable as "Handler_read_last", for completness of the Handler_read_* system variables interface. Adjusted tests results accordingly.
| | * manual merge from mysql-5.1-bugteamJon Olav Hauglid2010-07-191-0/+14
| | |\
| | | * Bug #54734 assert in Diagnostics_area::set_ok_statusJon Olav Hauglid2010-07-191-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #30584: delete with order by and limit clauses does notGleb Shchepa2010-06-231-2/+2
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | use limit efficiently Bug #36569: UPDATE ... WHERE ... ORDER BY... always does a filesort even if not required Also two bugs reported after QA review (before the commit of bugs above to public trees, no documentation needed): Bug #53737: Performance regressions after applying patch for bug 36569 Bug #53742: UPDATEs have no effect after applying patch for bug 36569 Execution of single-table UPDATE and DELETE statements did not use the same optimizer as was used in the compilation of SELECT statements. Instead, it had an optimizer of its own that did not take into account that you can omit sorting by retrieving rows using an index. Extra optimization has been added: when applicable, single-table UPDATE/DELETE statements use an existing index instead of filesort. A corresponding SELECT query would do the former. Also handling of the DESC ordering expression has been added when reverse index scan is applicable. From now on most single table UPDATE and DELETE statements show the same disk access patterns as the corresponding SELECT query. We verify this by comparing the result of SHOW STATUS LIKE 'Sort% Currently the get_index_for_order function a) checks quick select index (if any) for compatibility with the ORDER expression list or b) chooses the cheapest available compatible index, but only if the index scan is cheaper than filesort. Second way is implemented by the new test_if_cheaper_ordering function (extracted part the test_if_skip_sort_order()).
| | * Bug#50545: Single table UPDATE IGNORE crashes on Martin Hansson2010-03-101-0/+13
| | | | | | | | | | | | | | | | | | | | | 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/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * Merge polly.local:/home/kaa/src/maint/bug22364/my50-bug22364kaa@polly.local2007-04-271-0/+35
| | |\ | | | | | | | | | | | | into polly.local:/home/kaa/src/maint/bug22364/my51-bug22364
| | | * Fix for bug #22364 "Inconsistent "matched rows" when executing UPDATE"kaa@polly.local2007-04-231-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 mysql.com:/home/hf/work/mrg/mysql-5.0-optholyfoot/hf@hfmain.(none)2007-03-081-0/+4
| | |\ \ | | | |/ | | | | | | | | into mysql.com:/home/hf/work/mrg/mysql-5.1-opt
| | | * Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-optevgen@moonbone.local2007-03-051-0/+4
| | | |\ | | | | | | | | | | | | | | | 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/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | | after merge fixgluh@mysql.com/eagle.(none)2007-02-261-1/+1
| | | | |
| | * | | Merge mysql.com:/home/gluh/MySQL/Merge/5.0-optgluh@eagle.(none)2007-02-261-1/+20
| | |\ \ \ | | | |/ / | | | | | | | | | | into mysql.com:/home/gluh/MySQL/Merge/5.1-opt
| | | * | Bug #24010: INSERT INTO ... SELECT fails on unique constraint with data mhansson/martin@linux-st28.site2007-02-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
| | * | | Post-merge fix.igor@olga.mysql.com2007-02-131-3/+3
| | |/ /
| | * | Fix bug #24035.igor@olga.mysql.com2007-02-021-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+15
| | | |\
| | | | * BUG#15935: In mysql_update, don't use full index scan when we could have ↵sergefp@mysql.com2006-01-251-0/+15
| | | | | | | | | | | | | | | | | | | | used quick select scan.
| | | * | Manually mergedevgen@moonbone.local2006-01-241-0/+4
| | | |\ \ | | | | |/ | | | |/|
| | | | * Fixed bug #16510: Updating field named like '*name' caused server crash.evgen@moonbone.local2006-01-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+13
| | |\ \ \ | | | |/ /
| | | * | Fix bug#15028 Multitable update returns different numbers of matched rowsevgen@moonbone.local2005-12-011-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+8
| | |\ \ \ | | | |/ /
| | | * | Fix bug#14186 select datefield is null not updatedevgen@moonbone.local2005-10-281-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-8/+23
| | |\ \ \ | | | |/ / | | | | | | | | | | 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-8/+23
| | | | |
| | * | | BUG#121915: Merge 4.1->5.0sergefp@mysql.com2005-10-191-0/+59
| | |\ \ \ | | | |/ /
| | | * | BUG#12915: Added single-table UPDATE/DELTE ... ORDER BY ... LIMITsergefp@mysql.com2005-09-301-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | 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 moonbone.local:/work/mysql-4.1-bug-11868evgen@moonbone.local2005-07-181-0/+11
| | |\ \ \ | | | |/ / | | | | | | | | | | 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/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+14
| | | | | | | | | | | | | | | | | | | | | | | | 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/+7
| | |\ \ | | | |/
| | | * A fix (bug #8942: SUBSTRING_INDEX in UPDATE causes internal loop).ramil@mysql.com2005-03-171-0/+7
| | | |
| | | * Fix testantony@ltantony.rdg.cyberkinetica.homeunix.net2004-12-181-1/+0
| | | |
| | | * Moved drop table statement to the end.timour@mysql.com2004-12-161-0/+1
| | | |