List:Commits« Previous MessageNext Message »
From:marko.makela Date:June 1 2010 2:04pm
Subject:bzr push into mysql-trunk-innodb branch (marko.makela:3132 to 3133)
View as plain text  
 3133 Marko Mäkelä	2010-06-01
      Merge a change from mysql-5.1-innodb:
      
        ------------------------------------------------------------
        revno: 3491
        revision-id: marko.makela@stripped335-ccthwwru23kn09qw
        parent: marko.makela@oracle.com-20100601120751-1uq7bbta5n7ts0qr
        committer: Marko Mäkelä <marko.makela@stripped>
        branch nick: 5.1-innodb
        timestamp: Tue 2010-06-01 16:43:35 +0300
        message:
          Bug#48197: Concurrent rw_lock_free may cause assertion failure
      
          rw_lock_t: Remove magic_n unless UNIV_DEBUG is defined.
          rw_lock_free(): Invalidate magic_n only after removing from rw_lock_list.

    modified:
      storage/innobase/include/sync0rw.h
      storage/innobase/sync/sync0rw.c
 3132 Alexander Nozdrin	2010-06-01 [merge]
      Auto-merge from mysql-trunk-bugfixing.
      
      Due to a BZR bug, that merge was done by the following command:
      bzr merge -r 'revid:tor.didriksen@stripped4248-6qtv0p1ugy6o1hjo..' <mysql-trunk-bugfixing path>

    removed:
      BUILD/compile-alpha-ccc
      BUILD/compile-alpha-cxx
      storage/myisam/ft_eval.c
      storage/myisam/ft_eval.h
      storage/myisam/ft_stem.c
      storage/myisam/ft_test1.c
      storage/myisam/ft_test1.h
      strings/ChangeLog
      strings/bcopy-duff.c
      strings/bzero.c
      strings/macros.asm
      strings/memcmp.c
      strings/memcpy.c
      strings/memset.c
      strings/ptr_cmp.asm
      strings/strcat.c
      strings/strchr.c
      strings/strcmp.c
      strings/strings.asm
      strings/strlen.c
      strings/strrchr.c
      strings/strxmov.asm
      strings/udiv.c
    added:
      mysql-test/extra/rpl_tests/rpl_record_compare.test
      mysql-test/r/bug46261.result
      mysql-test/std_data/binlog_savepoint.000001
      mysql-test/std_data/bug46565.ARZ
      mysql-test/std_data/bug46565.frm
      mysql-test/suite/parts/r/partition_debug_sync_innodb.result
      mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt
      mysql-test/suite/parts/t/partition_debug_sync_innodb.test
      mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result
      mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result
      mysql-test/suite/rpl/t/rpl_begin_commit_rollback-master.opt
      mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test
      mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test
      mysql-test/suite/sys_vars/r/secure_file_priv.result
      mysql-test/suite/sys_vars/r/skip_name_resolve_basic.result
      mysql-test/suite/sys_vars/t/secure_file_priv-master.opt
      mysql-test/suite/sys_vars/t/secure_file_priv.test
      mysql-test/suite/sys_vars/t/skip_name_resolve_basic-master.opt
      mysql-test/suite/sys_vars/t/skip_name_resolve_basic.test
      mysql-test/t/bug46261-master.opt
      mysql-test/t/bug46261.test
    renamed:
      mysys/my_messnc.c => mysys/my_mess.c
    modified:
      BUILD/Makefile.am
      Makefile.am
      client/mysql.cc
      client/mysqlbinlog.cc
      client/sql_string.cc
      cmake/os/FreeBSD.cmake
      configure.in
      include/my_global.h
      include/my_pthread.h
      include/my_sys.h
      include/mysql/plugin.h
      include/mysql/plugin.h.pp
      include/mysql_com.h
      libmysql/Makefile.shared
      mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test
      mysql-test/mysql-test-run.pl
      mysql-test/r/archive.result
      mysql-test/r/ctype_ucs.result
      mysql-test/r/delete.result
      mysql-test/r/error_simulation.result
      mysql-test/r/errors.result
      mysql-test/r/explain.result
      mysql-test/r/fulltext.result
      mysql-test/r/func_concat.result
      mysql-test/r/func_gconcat.result
      mysql-test/r/func_str.result
      mysql-test/r/gis-rtree.result
      mysql-test/r/grant.result
      mysql-test/r/group_by.result
      mysql-test/r/handler_myisam.result
      mysql-test/r/having.result
      mysql-test/r/innodb_mysql.result
      mysql-test/r/join.result
      mysql-test/r/join_outer.result
      mysql-test/r/loaddata.result
      mysql-test/r/log_state.result
      mysql-test/r/mdl_sync.result
      mysql-test/r/merge.result
      mysql-test/r/myisam.result
      mysql-test/r/mysqlbinlog.result
      mysql-test/r/mysqld--help-notwin.result
      mysql-test/r/mysqld--help-win.result
      mysql-test/r/mysqldump.result
      mysql-test/r/order_by.result
      mysql-test/r/outfile_loaddata.result
      mysql-test/r/partition.result
      mysql-test/r/ps.result
      mysql-test/r/query_cache_with_views.result
      mysql-test/r/range.result
      mysql-test/r/renamedb.result
      mysql-test/r/row.result
      mysql-test/r/skip_name_resolve.result
      mysql-test/r/subselect.result
      mysql-test/r/symlink.result
      mysql-test/r/trigger.result
      mysql-test/r/type_binary.result
      mysql-test/r/type_decimal.result
      mysql-test/r/upgrade.result
      mysql-test/r/variables.result
      mysql-test/r/variables_debug.result
      mysql-test/r/view.result
      mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
      mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
      mysql-test/suite/engines/README
      mysql-test/suite/engines/iuds/r/update_delete_calendar.result
      mysql-test/suite/engines/iuds/t/disabled.def
      mysql-test/suite/engines/iuds/t/insert_number.test
      mysql-test/suite/engines/iuds/t/update_delete_calendar.test
      mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result
      mysql-test/suite/rpl/r/rpl_do_grant.result
      mysql-test/suite/rpl/r/rpl_events.result
      mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
      mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_row_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
      mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test
      mysql-test/suite/rpl/t/rpl_do_grant.test
      mysql-test/suite/rpl/t/rpl_events.test
      mysql-test/suite/rpl/t/rpl_semi_sync.test
      mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test
      mysql-test/suite/rpl_ndb/my.cnf
      mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result
      mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test
      mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result
      mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result
      mysql-test/suite/sys_vars/t/secure_file_priv_basic.test
      mysql-test/t/archive.test
      mysql-test/t/ctype_ucs.test
      mysql-test/t/delete.test
      mysql-test/t/error_simulation.test
      mysql-test/t/errors.test
      mysql-test/t/explain.test
      mysql-test/t/fulltext.test
      mysql-test/t/func_concat.test
      mysql-test/t/func_gconcat.test
      mysql-test/t/func_str.test
      mysql-test/t/gis-rtree.test
      mysql-test/t/grant.test
      mysql-test/t/group_by.test
      mysql-test/t/handler_myisam.test
      mysql-test/t/having.test
      mysql-test/t/innodb_mysql.test
      mysql-test/t/join.test
      mysql-test/t/join_outer.test
      mysql-test/t/loaddata.test
      mysql-test/t/log_state.test
      mysql-test/t/mdl_sync.test
      mysql-test/t/merge.test
      mysql-test/t/mysqlbinlog.test
      mysql-test/t/mysqldump.test
      mysql-test/t/order_by.test
      mysql-test/t/outfile_loaddata.test
      mysql-test/t/partition.test
      mysql-test/t/ps.test
      mysql-test/t/query_cache_with_views.test
      mysql-test/t/range.test
      mysql-test/t/renamedb.test
      mysql-test/t/row.test
      mysql-test/t/skip_name_resolve.test
      mysql-test/t/subselect.test
      mysql-test/t/symlink.test
      mysql-test/t/trigger.test
      mysql-test/t/type_decimal.test
      mysql-test/t/upgrade.test
      mysql-test/t/variables.test
      mysql-test/t/variables_debug.test
      mysql-test/t/view.test
      mysys/CMakeLists.txt
      mysys/Makefile.am
      mysys/mf_loadpath.c
      mysys/mf_pack.c
      mysys/my_file.c
      mysys/my_getwd.c
      mysys/my_init.c
      mysys/my_pthread.c
      mysys/my_static.c
      plugin/daemon_example/daemon_example.cc
      plugin/semisync/semisync_master.cc
      scripts/mysqld_safe.sh
      scripts/mysqlhotcopy.sh
      sql-common/client.c
      sql/CMakeLists.txt
      sql/authors.h
      sql/events.cc
      sql/field.cc
      sql/field.h
      sql/field_conv.cc
      sql/ha_partition.cc
      sql/handler.cc
      sql/handler.h
      sql/init.cc
      sql/item.cc
      sql/item.h
      sql/item_cmpfunc.cc
      sql/item_cmpfunc.h
      sql/item_strfunc.cc
      sql/item_strfunc.h
      sql/item_subselect.cc
      sql/item_subselect.h
      sql/item_sum.cc
      sql/item_sum.h
      sql/key.cc
      sql/lock.cc
      sql/lock.h
      sql/log.cc
      sql/log.h
      sql/log_event.cc
      sql/log_event.h
      sql/log_event_old.cc
      sql/mysqld.cc
      sql/mysqld.h
      sql/net_serv.cc
      sql/opt_range.cc
      sql/opt_range.h
      sql/opt_sum.cc
      sql/partition_info.cc
      sql/protocol.cc
      sql/slave.cc
      sql/sp_head.cc
      sql/sp_head.h
      sql/sql_acl.cc
      sql/sql_base.cc
      sql/sql_base.h
      sql/sql_class.cc
      sql/sql_class.h
      sql/sql_connect.cc
      sql/sql_const.h
      sql/sql_delete.cc
      sql/sql_insert.cc
      sql/sql_lex.cc
      sql/sql_lex.h
      sql/sql_load.cc
      sql/sql_parse.cc
      sql/sql_partition.cc
      sql/sql_plugin.cc
      sql/sql_priv.h
      sql/sql_repl.cc
      sql/sql_select.cc
      sql/sql_show.cc
      sql/sql_string.cc
      sql/sql_table.cc
      sql/sql_table.h
      sql/sql_update.cc
      sql/sql_yacc.yy
      sql/sys_vars.cc
      sql/table.cc
      sql/table.h
      sql/thr_malloc.cc
      sql/thr_malloc.h
      storage/archive/ha_archive.cc
      storage/myisam/CMakeLists.txt
      storage/myisam/Makefile.am
      storage/myisam/ha_myisam.cc
      storage/myisam/mi_check.c
      storage/myisam/mi_delete_all.c
      storage/myisam/mi_delete_table.c
      storage/myisam/mi_dynrec.c
      storage/myisam/mi_extra.c
      storage/myisam/mi_open.c
      storage/myisam/mi_page.c
      storage/myisam/mi_rnext.c
      storage/myisam/mi_write.c
      storage/myisam/myisamdef.h
      storage/myisam/rt_index.c
      storage/myisam/rt_split.c
      storage/myisam/sort.c
      storage/myisammrg/myrg_queue.c
      support-files/mysql.spec.sh
      tests/mysql_client_test.c
      mysys/my_mess.c
=== modified file 'storage/innobase/include/sync0rw.h'
--- a/storage/innobase/include/sync0rw.h	revid:alik@stripped01-y9qv7igo16nw0umn
+++ b/storage/innobase/include/sync0rw.h	revid:marko.makela@stripped0ljl5tx9
@@ -622,11 +622,12 @@ struct rw_lock_struct {
 	unsigned	cline:14;	/*!< Line where created */
 	unsigned	last_s_line:14;	/*!< Line number where last time s-locked */
 	unsigned	last_x_line:14;	/*!< Line number where last time x-locked */
+#ifdef UNIV_DEBUG
 	ulint	magic_n;	/*!< RW_LOCK_MAGIC_N */
-};
-
 /** Value of rw_lock_struct::magic_n */
 #define	RW_LOCK_MAGIC_N	22643
+#endif /* UNIV_DEBUG */
+};
 
 #ifdef UNIV_SYNC_DEBUG
 /** The structure for storing debug info of an rw-lock */

=== modified file 'storage/innobase/sync/sync0rw.c'
--- a/storage/innobase/sync/sync0rw.c	revid:alik@strippedv7igo16nw0umn
+++ b/storage/innobase/sync/sync0rw.c	revid:marko.makela@stripped
@@ -278,7 +278,7 @@ rw_lock_create_func(
 	lock->level = level;
 #endif /* UNIV_SYNC_DEBUG */
 
-	lock->magic_n = RW_LOCK_MAGIC_N;
+	ut_d(lock->magic_n = RW_LOCK_MAGIC_N);
 
 	lock->cfile_name = cfile_name;
 	lock->cline = (unsigned int) cline;
@@ -293,10 +293,8 @@ rw_lock_create_func(
 
 	mutex_enter(&rw_lock_list_mutex);
 
-	if (UT_LIST_GET_LEN(rw_lock_list) > 0) {
-		ut_a(UT_LIST_GET_FIRST(rw_lock_list)->magic_n
-		     == RW_LOCK_MAGIC_N);
-	}
+	ut_ad(UT_LIST_GET_FIRST(rw_lock_list) == NULL
+	      || UT_LIST_GET_FIRST(rw_lock_list)->magic_n == RW_LOCK_MAGIC_N);
 
 	UT_LIST_ADD_FIRST(list, rw_lock_list, lock);
 
@@ -316,8 +314,6 @@ rw_lock_free_func(
 	ut_ad(rw_lock_validate(lock));
 	ut_a(lock->lock_word == X_LOCK_DECR);
 
-	lock->magic_n = 0;
-
 #ifndef INNODB_RW_LOCKS_USE_ATOMICS
 	mutex_free(rw_lock_get_mutex(lock));
 #endif /* INNODB_RW_LOCKS_USE_ATOMICS */
@@ -327,16 +323,16 @@ rw_lock_free_func(
 
 	os_event_free(lock->wait_ex_event);
 
-	if (UT_LIST_GET_PREV(list, lock)) {
-		ut_a(UT_LIST_GET_PREV(list, lock)->magic_n == RW_LOCK_MAGIC_N);
-	}
-	if (UT_LIST_GET_NEXT(list, lock)) {
-		ut_a(UT_LIST_GET_NEXT(list, lock)->magic_n == RW_LOCK_MAGIC_N);
-	}
+	ut_ad(UT_LIST_GET_PREV(list, lock) == NULL
+	      || UT_LIST_GET_PREV(list, lock)->magic_n == RW_LOCK_MAGIC_N);
+	ut_ad(UT_LIST_GET_NEXT(list, lock) == NULL
+	      || UT_LIST_GET_NEXT(list, lock)->magic_n == RW_LOCK_MAGIC_N);
 
 	UT_LIST_REMOVE(list, rw_lock_list, lock);
 
 	mutex_exit(&rw_lock_list_mutex);
+
+	ut_d(lock->magic_n = 0);
 }
 
 #ifdef UNIV_DEBUG
@@ -358,7 +354,7 @@ rw_lock_validate(
 	waiters = rw_lock_get_waiters(lock);
 	lock_word = lock->lock_word;
 
-	ut_a(lock->magic_n == RW_LOCK_MAGIC_N);
+	ut_ad(lock->magic_n == RW_LOCK_MAGIC_N);
 	ut_a(waiters == 0 || waiters == 1);
 	ut_a(lock_word > -X_LOCK_DECR ||(-lock_word) % X_LOCK_DECR == 0);
 

Attachment: [text/bzr-bundle] bzr/marko.makela@oracle.com-20100601140355-u3kxl0yl0ljl5tx9.bundle
Thread
bzr push into mysql-trunk-innodb branch (marko.makela:3132 to 3133) marko.makela1 Jun