3227 Vasil Dimov 2010-10-01
Fix a potential bug when using __sync_lock_test_and_set()
This is a manual merge from mysql-5.1-innodb of:
revision-id: vasil.dimov@stripped
committer: Vasil Dimov <vasil.dimov@stripped>
timestamp: Thu 2010-09-30 13:26:18 +0300
message:
Fix a potential bug when using __sync_lock_test_and_set()
TYPE __sync_lock_test_and_set (TYPE *ptr, TYPE value, ...)
it is not documented what happens if the two arguments are of different
type like it was before: the first one was lock_word_t (byte) and the
second one was 1 or 0 (int).
Approved by: Marko (via IRC)
modified:
storage/innobase/include/os0sync.h
3226 Vasil Dimov 2010-10-01
Fix Bug#56340 innodb updates index stats too frequently after non-index updates
This is a manual merge from mysql-5.1-innodb of:
revno: 3618
revision-id: vasil.dimov@stripped
parent: vasil.dimov@stripped
committer: Vasil Dimov <vasil.dimov@stripped>
branch nick: mysql-5.1-innodb
timestamp: Thu 2010-09-30 15:48:44 +0300
message:
Fix Bug#56340 innodb updates index stats too frequently after non-index updates
This is a simple optimization issue. All stats are related to only indexed
columns, index size or number of rows in the whole table. UPDATEs that touch
only non-indexed columns cannot affect stats and we can avoid calling the
function row_update_statistics_if_needed() which may result in unnecessary I/O.
Approved by: Marko (rb://466)
In addition to the above message: we know that
row_update_cascade_for_mysql() (the other place where
row_update_statistics_if_needed is called) always updates indexed
columns (FK-related), so there is no need to add this cond there.
modified:
storage/innobase/row/row0mysql.c
3225 Vasil Dimov 2010-09-28
Manually merge a GCC warning fix from 5.1 to 5.5:
------------------------------------------------------------
revno: 3615
revision-id: vasil.dimov@stripped
parent: vasil.dimov@stripped
committer: Vasil Dimov <vasil.dimov@stripped>
branch nick: mysql-5.1-innodb
timestamp: Tue 2010-09-28 11:12:34 +0300
message:
Silence a GCC warning about reaching the end of non-void func
Spotted by: Marko
modified:
storage/innobase/handler/i_s.cc
=== modified file 'storage/innobase/include/os0sync.h'
--- a/storage/innobase/include/os0sync.h revid:vasil.dimov@stripped
+++ b/storage/innobase/include/os0sync.h revid:vasil.dimov@stripped
@@ -289,7 +289,7 @@ amount of increment. */
Returns the old value of *ptr, atomically sets *ptr to new_val */
# define os_atomic_test_and_set_byte(ptr, new_val) \
- __sync_lock_test_and_set(ptr, new_val)
+ __sync_lock_test_and_set(ptr, (byte) new_val)
#elif defined(HAVE_IB_SOLARIS_ATOMICS)
=== modified file 'storage/innobase/row/row0mysql.c'
--- a/storage/innobase/row/row0mysql.c revid:vasil.dimov@stripped
+++ b/storage/innobase/row/row0mysql.c revid:vasil.dimov@stripped
@@ -1481,7 +1481,12 @@ run_again:
srv_n_rows_updated++;
}
- row_update_statistics_if_needed(prebuilt->table);
+ /* We update table statistics only if it is a DELETE or UPDATE
+ that changes indexed columns, UPDATEs that change only non-indexed
+ columns would not affect statistics. */
+ if (node->is_delete || !(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
+ row_update_statistics_if_needed(prebuilt->table);
+ }
trx->op_info = "";
Attachment: [text/bzr-bundle] bzr/vasil.dimov@oracle.com-20101001115100-94b30mpyzrpxpa1z.bundle
| Thread |
|---|
| • bzr push into mysql-5.5-innodb branch (vasil.dimov:3225 to 3227) | vasil.dimov | 1 Oct |