List:Commits« Previous MessageNext Message »
From:marko.makela Date:February 6 2012 9:09am
Subject:bzr push into mysql-trunk-wl5534-stage branch (marko.makela:3823 to 3824)
WL#5526
View as plain text  
 3824 Marko Mäkelä	2012-02-06
      WL#5526 non-functional clean-up after review comments from Sunny Bains
      
      dict_table_close(): Determine if indexes can be dropped only if !dict_locked.
      
      dict_table_check_for_dup_indexes(): Remove a goto label.
      
      online_retry_drop_indexes_with_trx(): New function, for reusing a
      transaction object for dropping incomplete indexes.
      
      row_log_online_op(), row_log_apply_op(): Replace 6 with DATA_TRX_ID_LEN.

    modified:
      storage/innobase/dict/dict0dict.cc
      storage/innobase/handler/handler0alter.cc
      storage/innobase/row/row0log.cc
 3823 Jon Olav Hauglid	2012-02-02 [merge]
      Merge from mysql-trunk to mysql-trunk-wl5534-stage
      Text conflict in mysql-test/suite/innodb/r/innodb_monitor.result
      Text conflict in mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result
      Text conflict in mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result
      Text conflict in mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result
      Text conflict in mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result
      Text conflict in sql/sql_table.cc
      Text conflict in storage/innobase/row/row0merge.cc

    removed:
      include/byteorder/
    added:
      mysql-test/include/function_defaults.inc
      mysql-test/include/function_defaults_notembedded.inc
      mysql-test/include/libdaemon_example.ini
      mysql-test/r/function_defaults.result
      mysql-test/r/function_defaults_notembedded.result
      mysql-test/std_data/onerow.xml
      mysql-test/suite/rpl/r/rpl_function_defaults.result
      mysql-test/suite/rpl/t/rpl_function_defaults.test
      mysql-test/t/function_defaults.test
      mysql-test/t/function_defaults_notembedded.test
      mysql-test/wl5874_updown
      sql/delayable_insert_operation.h
      unittest/gunit/copy_info-t.cc
      unittest/gunit/create_field-t.cc
      unittest/gunit/delayable_insert_operation-t.cc
      unittest/gunit/fake_table.h
      unittest/gunit/field_timestamp-t.cc
      unittest/gunit/item_func_now_local-t.cc
      unittest/gunit/mock_create_field.h
      unittest/gunit/mock_field_datetime.h
      unittest/gunit/mock_field_timestamp.h
      unittest/gunit/mock_field_timestampf.h
      unittest/gunit/sql_table-t.cc
    renamed:
      include/byteorder/big_endian.h => include/big_endian.h
      include/byteorder/byte_order_generic.h => include/byte_order_generic.h
      include/byteorder/byte_order_generic_x86.h => include/byte_order_generic_x86.h
      include/byteorder/byte_order_generic_x86_64.h => include/byte_order_generic_x86_64.h
      include/byteorder/little_endian.h => include/little_endian.h
    modified:
      client/mysql_plugin.c
      include/CMakeLists.txt
      include/my_bitmap.h
      include/my_byteorder.h
      include/myisam.h
      mysql-test/collections/default.daily
      mysql-test/collections/default.experimental
      mysql-test/collections/default.weekly
      mysql-test/include/icp_tests.inc
      mysql-test/include/order_by.inc
      mysql-test/r/create.result
      mysql-test/r/innodb_icp.result
      mysql-test/r/innodb_icp_all.result
      mysql-test/r/innodb_icp_none.result
      mysql-test/r/join_cache_nojb.result
      mysql-test/r/myisam.result
      mysql-test/r/myisam_icp.result
      mysql-test/r/myisam_icp_all.result
      mysql-test/r/myisam_icp_none.result
      mysql-test/r/mysql_plugin.result
      mysql-test/r/mysqldump.result
      mysql-test/r/optimizer_debug_sync.result
      mysql-test/r/order_by_all.result
      mysql-test/r/order_by_icp_mrr.result
      mysql-test/r/order_by_none.result
      mysql-test/r/type_temporal_fractional.result
      mysql-test/r/type_timestamp.result
      mysql-test/suite/engines/funcs/r/date_function.result
      mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result
      mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result
      mysql-test/suite/innodb/r/innodb-index.result
      mysql-test/suite/innodb/r/innodb_monitor.result
      mysql-test/suite/innodb/t/innodb-index.test
      mysql-test/suite/innodb/t/innodb_bug34300.test
      mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result
      mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result
      mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result
      mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result
      mysql-test/t/create.test
      mysql-test/t/myisam.test
      mysql-test/t/mysql_plugin.test
      mysql-test/t/mysqldump.test
      mysql-test/t/optimizer_debug_sync.test
      mysql-test/t/type_temporal_fractional.test
      mysql-test/t/type_timestamp.test
      mysys/my_bitmap.c
      sql/event_db_repository.cc
      sql/field.cc
      sql/field.h
      sql/field_conv.cc
      sql/ha_ndbcluster.cc
      sql/ha_partition.cc
      sql/item.cc
      sql/item.h
      sql/item_timefunc.cc
      sql/item_timefunc.h
      sql/log_event.cc
      sql/log_event_old.cc
      sql/rpl_info_table.cc
      sql/sp.cc
      sql/sp_head.cc
      sql/sql_base.cc
      sql/sql_class.cc
      sql/sql_class.h
      sql/sql_insert.cc
      sql/sql_insert.h
      sql/sql_load.cc
      sql/sql_parse.cc
      sql/sql_partition.cc
      sql/sql_select.cc
      sql/sql_show.cc
      sql/sql_table.cc
      sql/sql_table.h
      sql/sql_time.cc
      sql/sql_update.cc
      sql/table.cc
      sql/table.h
      sql/unireg.cc
      storage/archive/ha_archive.cc
      storage/csv/ha_tina.cc
      storage/example/ha_example.cc
      storage/federated/ha_federated.cc
      storage/heap/ha_heap.cc
      storage/innobase/btr/btr0btr.cc
      storage/innobase/btr/btr0sea.cc
      storage/innobase/buf/buf0buf.cc
      storage/innobase/buf/buf0dblwr.cc
      storage/innobase/fil/fil0fil.cc
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/ibuf/ibuf0ibuf.cc
      storage/innobase/include/btr0btr.ic
      storage/innobase/include/buf0buf.h
      storage/innobase/include/page0page.ic
      storage/innobase/include/univ.i
      storage/innobase/lock/lock0lock.cc
      storage/innobase/page/page0cur.cc
      storage/innobase/page/page0page.cc
      storage/innobase/row/row0sel.cc
      storage/innobase/srv/srv0mon.cc
      storage/myisam/ha_myisam.cc
      storage/myisam/ha_myisam.h
      storage/myisam/mi_check.c
      storage/myisam/myisamchk.c
      storage/myisam/myisamdef.h
      storage/myisam/sort.c
      storage/myisammrg/ha_myisammrg.cc
      unittest/gunit/CMakeLists.txt
=== modified file 'storage/innobase/dict/dict0dict.cc'
--- a/storage/innobase/dict/dict0dict.cc	revid:jon.hauglid@oracle.com-20120202150454-2gf4u1f4zs5ucxdf
+++ b/storage/innobase/dict/dict0dict.cc	revid:marko.makela@stripped0120206090716-lz9mnwqvx94bznb1
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
 
 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
@@ -413,11 +413,12 @@ dict_table_try_drop_aborted(
 	}
 
 	if (table && table->n_ref_count == ref_count && table->drop_aborted) {
+		/* Silence a debug assertion in row_merge_drop_indexes(). */
 		ut_d(table->n_ref_count++);
 		row_merge_drop_indexes(trx, table, TRUE);
-		trx_commit_for_mysql(trx);
 		ut_d(table->n_ref_count--);
 		ut_ad(table->n_ref_count == ref_count);
+		trx_commit_for_mysql(trx);
 	}
 
 	row_mysql_unlock_data_dictionary(trx);
@@ -463,8 +464,6 @@ dict_table_close(
 					indexes after an aborted online
 					index creation */
 {
-	ibool		drop_aborted;
-
 	if (!dict_locked) {
 		mutex_enter(&dict_sys->mutex);
 	}
@@ -472,11 +471,6 @@ dict_table_close(
 	ut_ad(mutex_own(&dict_sys->mutex));
 	ut_a(table->n_ref_count > 0);
 
-	drop_aborted = try_drop
-		&& table->drop_aborted
-		&& table->n_ref_count == 1
-		&& dict_table_get_first_index(table);
-
 	--table->n_ref_count;
 
 	MONITOR_DEC(MONITOR_TABLE_REFERENCE);
@@ -492,7 +486,13 @@ dict_table_close(
 #endif /* UNIV_DEBUG */
 
 	if (!dict_locked) {
-		table_id_t	table_id = table->id;
+		table_id_t	table_id	= table->id;
+		ibool		drop_aborted;
+
+		drop_aborted = try_drop
+			&& table->drop_aborted
+			&& table->n_ref_count == 1
+			&& dict_table_get_first_index(table);
 
 		mutex_exit(&dict_sys->mutex);
 
@@ -1796,6 +1796,7 @@ dict_table_remove_from_cache_low(
 
 		trx_set_dict_operation(trx, TRX_DICT_OP_INDEX);
 
+		/* Silence a debug assertion in row_merge_drop_indexes(). */
 		ut_d(table->n_ref_count++);
 		row_merge_drop_indexes(trx, table, TRUE);
 		ut_d(table->n_ref_count--);
@@ -5821,14 +5822,13 @@ dict_table_check_for_dup_indexes(
 				switch (dict_index_get_online_status(index1)) {
 				case ONLINE_INDEX_COMPLETE:
 				case ONLINE_INDEX_CREATION:
+					ut_error;
 					break;
 				case ONLINE_INDEX_ABORTED:
 				case ONLINE_INDEX_ABORTED_DROPPED:
-					goto aborted_ok;
+					break;
 				}
-				ut_error;
-			aborted_ok:
-				break;
+				/* fall through */
 			case CHECK_PARTIAL_OK:
 				break;
 			}

=== modified file 'storage/innobase/handler/handler0alter.cc'
--- a/storage/innobase/handler/handler0alter.cc	revid:jon.hauglid@stripped
+++ b/storage/innobase/handler/handler0alter.cc	revid:marko.makela@stripped
@@ -733,6 +733,8 @@ innobase_fts_check_doc_id_index(
 	}
 
 	if (ha_alter_info) {
+		/* Check if a unique index with the name of
+		FTS_DOC_ID_INDEX_NAME is being created. */
 		for (uint i = 0; i < ha_alter_info->index_add_count; i++) {
 			const KEY& key = ha_alter_info->key_info_buffer[
 				ha_alter_info->index_add_buffer[i]];
@@ -1203,6 +1205,34 @@ online_retry_drop_indexes(
 #endif /* UNIV_DEBUG */
 }
 
+/********************************************************************//**
+Commit a dictionary transaction and drop any indexes that we were not
+able to free previously due to open table handles. */
+static __attribute__((nonnull))
+void
+online_retry_drop_indexes_with_trx(
+/*===============================*/
+	dict_table_t*	table,	/*!< in/out: table */
+	trx_t*		trx)	/*!< in/out: transaction */
+{
+	ut_ad(trx_state_eq(trx, TRX_STATE_NOT_STARTED));
+	ut_ad(trx->dict_operation_lock_mode == RW_X_LATCH);
+
+	/* Now that the dictionary is being locked, check if we can
+	drop any incompletely created indexes that may have been left
+	behind in rollback_inplace_alter_table() earlier. */
+	if (table->drop_aborted) {
+		/* Re-use the dictionary transaction object
+		to avoid some memory allocation overhead. */
+		ut_ad(trx_get_dict_operation(trx) == TRX_DICT_OP_TABLE);
+		trx->dict_operation = TRX_DICT_OP_INDEX;
+		trx->table_id = 0;
+		trx_start_if_not_started(trx);
+		online_retry_drop_indexes_low(table, trx);
+		trx_commit_for_mysql(trx);
+	}
+}
+
 /** Update internal structures with concurrent writes blocked,
 while preparing ALTER TABLE.
 
@@ -1362,21 +1392,7 @@ prepare_inplace_alter_table_dict(
 
 			ut_ad(user_table->n_ref_count == 1);
 
-			/* Now that the dictionary is being locked,
-			check if we can drop any incompletely created
-			indexes that may have been left behind in
-			rollback_inplace_alter_table() earlier. */
-			if (user_table->drop_aborted) {
-				/* Re-use the dictionary transaction object
-				to avoid some memory allocation overhead. */
-				ut_ad(trx_get_dict_operation(trx)
-				      == TRX_DICT_OP_TABLE);
-				trx->dict_operation = TRX_DICT_OP_INDEX;
-				trx->table_id = 0;
-				trx_start_if_not_started(trx);
-				online_retry_drop_indexes_low(user_table, trx);
-				trx_commit_for_mysql(trx);
-			}
+			online_retry_drop_indexes_with_trx(user_table, trx);
 
 			row_mysql_unlock_data_dictionary(trx);
 			mem_heap_free(heap);
@@ -1559,29 +1575,16 @@ error_handling:
 			row_merge_drop_table(trx, indexed_table);
 		}
 
+		trx_commit_for_mysql(trx);
 		ut_ad(user_table->n_ref_count == 1);
 
-		/* Now that the dictionary is being locked, check if we
-		can drop any incompletely created indexes that may have
-		been left behind in rollback_inplace_alter_table() earlier. */
-
-		if (user_table->drop_aborted) {
-			/* Commit the row_merge_drop_table() above. */
-			trx_commit_for_mysql(trx);
-			/* Re-use the dictionary transaction object
-			to avoid some memory allocation overhead. */
-			ut_ad(trx_get_dict_operation(trx) == TRX_DICT_OP_TABLE);
-			trx->dict_operation = TRX_DICT_OP_INDEX;
-			trx->table_id = 0;
-			trx_start_if_not_started(trx);
-			online_retry_drop_indexes_low(user_table, trx);
-		}
+		online_retry_drop_indexes_with_trx(user_table, trx);
 	} else {
 		ut_ad(indexed_table == user_table);
 		row_merge_drop_indexes(trx, user_table, TRUE);
+		trx_commit_for_mysql(trx);
 	}
 
-	trx_commit_for_mysql(trx);
 	ut_d(dict_table_check_for_dup_indexes(user_table, CHECK_ALL_COMPLETE));
 	ut_ad(!user_table->drop_aborted);
 	row_mysql_unlock_data_dictionary(trx);

=== modified file 'storage/innobase/row/row0log.cc'
--- a/storage/innobase/row/row0log.cc	revid:jon.hauglid@stripped
+++ b/storage/innobase/row/row0log.cc	revid:marko.makela@oracle.com-20120206090716-lz9mnwqvx94bznb1
@@ -161,7 +161,7 @@ op_ok:
 # error
 #endif
 	mach_write_to_6(b, trx_id);
-	b += 6;
+	b += DATA_TRX_ID_LEN;
 
 	if (extra_size < 0x80) {
 		*b++ = (byte) extra_size;
@@ -663,7 +663,7 @@ corrupted:
 # error
 #endif
 	trx_id = mach_read_from_6(mrec);
-	mrec += 6;
+	mrec += DATA_TRX_ID_LEN;
 
 	extra_size = *mrec++;
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-wl5534-stage branch (marko.makela:3823 to 3824)WL#5526marko.makela6 Feb