From: Jorgen Loland
Date: February 21 2011 3:56pm
Subject: bzr push into mysql-trunk branch (jorgen.loland:3692 to 3693) Bug#11762751
Bug#11764529
List-Archive: http://lists.mysql.com/commits/131787
X-Bug: 11762751,11764529
Message-Id: <20110221155619.134514AD@atum21.norway.sun.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
3693 Jorgen Loland 2011-02-21 [merge]
BUG#11762751 and BUG#11764529 should have been pushed to 5.5.
Null-merging already pushed CS, but error message is moved in
errmsg-utf8 to same location as in 5.5 to maintain consistant
error numbers.
@ sql/share/errmsg-utf8.txt
New error message for multi-table update where the same table is updated multiple times.
modified:
sql/share/errmsg-utf8.txt
3692 Jorgen Loland 2011-02-21
BUG#11762751: UPDATE STATEMENT THROWS AN ERROR, BUT STILL
UPDATES THE TABLE ENTRIES (formerly 55385)
BUG#11764529: MULTI UPDATE+INNODB REPORTS ER_KEY_NOT_FOUND
IF A TABLE IS UPDATED TWICE (formerly 57373)
If multiple-table update updates a row through two aliases and
the first update physically moves the row, the second update will
fail to locate the row. This results in different errors
depending on storage engine:
* MyISAM: Got error 134 from storage engine
* InnoDB: Can't find record in 'tbl'
None of these errors accurately describe the problem.
Furthermore, since MyISAM is non-transactional, the update
executed first will be performed while the second will not.
In addition, for two equal multiple-table update statements,
one could succeed and the other fail based on whether or not
the record actually moved or not. This was inconsistent.
Two update operations may physically move a row:
1) Update of a column in a clustered primary key
2) Update of a column used to calculate which partition the
row belongs to
BUG#11764529 is about case 1) above, BUG#11762751 was about case 2).
The fix for these bugs is to return with an error if multiple-table
update is about to:
a) Update a table through multiple aliases, and
b) Perform an update that may physically more the row
in at least one of these aliases
This avoids
* partial updates as described for MyISAM above,
* provides the same error message that describes the actual problem
for all SEs
* inconsistent behavior where a statement fails or succeeds based on
e.g. the partitioning algorithm of the table.
@ mysql-test/r/multi_update.result
Add test for bug#57373
@ mysql-test/r/multi_update_innodb.result
Add test for bug#57373
@ mysql-test/r/partition.result
Add test for bug#55385
@ mysql-test/t/multi_update.test
Add test for BUG#57373
@ mysql-test/t/multi_update_innodb.test
Add test for BUG#57373
@ mysql-test/t/partition.test
Add test for bug#55385
@ sql/handler.cc
Translate handler error HA_ERR_RECORD_DELETED to server error
@ sql/share/errmsg-utf8.txt
New error message for multi-table update where the same table is updated multiple times.
@ sql/sql_update.cc
Add function unsafe_key_update()
added:
mysql-test/r/multi_update_innodb.result
mysql-test/t/multi_update_innodb.test
modified:
mysql-test/r/multi_update.result
mysql-test/r/partition.result
mysql-test/t/multi_update.test
mysql-test/t/partition.test
sql/handler.cc
sql/share/errmsg-utf8.txt
sql/sql_update.cc
=== modified file 'sql/share/errmsg-utf8.txt'
--- a/sql/share/errmsg-utf8.txt 2011-02-21 15:31:41 +0000
+++ b/sql/share/errmsg-utf8.txt 2011-02-21 15:55:58 +0000
@@ -6452,6 +6452,10 @@ ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE
ER_STMT_CACHE_FULL
eng "Multi-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage; increase this mysqld variable and try again"
+
+ER_MULTI_UPDATE_KEY_CONFLICT
+ eng "Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'."
+
ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX
eng "Option binlog_stmt_cache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting binlog_stmt_cache_size equal to max_binlog_stmt_cache_size."
@@ -6483,6 +6487,3 @@ ER_NO_SUCH_PARTITION
slo "Partition '%-.64s' doesn't exist"
spa "Particion '%-.64s' no existe"
swe "Det finns ingen partition som heter '%-.64s'"
-
-ER_MULTI_UPDATE_KEY_CONFLICT
- eng "Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'."
No bundle (reason: useless for push emails).