List:Commits« Previous MessageNext Message »
From:marko.makela Date:August 18 2010 11:40am
Subject:bzr push into mysql-5.5-innodb branch (marko.makela:3165 to 3166) Bug#55626
View as plain text  
 3166 Marko Mäkelä	2010-08-18
      Merge Bug#55626 fix from mysql-5.1-innodb:
      
      revno: 3545
      revision-id: marko.makela@strippedfrccfb4yw
      parent: vasil.dimov@stripped3934-1yl7zz2odikxauf8
      committer: Marko Mäkelä <marko.makela@stripped>
      branch nick: 5.1-innodb
      timestamp: Wed 2010-08-18 14:01:10 +0300
      message:
        Bug#55626: MIN and MAX reading a delete-marked record from secondary index
      
        Remove a bogus debug assertion that triggered the bug.
        Add assertions precisely where records must not be delete-marked.
        And a comment to clarify when the record is allowed to be delete-marked.

    modified:
      storage/innobase/row/row0sel.c
 3165 Vasil Dimov	2010-08-18 [merge]
      Merge mysql-5.5-bugfixing -> mysql-5.5-innodb

    removed:
      BUILD/compile-pentium-mysqlfs-debug
      mysql-test/suite/perfschema/r/ddl_ews_by_event_name.result
      mysql-test/suite/perfschema/r/ddl_processlist.result
      mysql-test/suite/perfschema/r/ddl_setup_objects.result
      mysql-test/suite/perfschema/r/dml_ews_by_event_name.result
      mysql-test/suite/perfschema/r/dml_processlist.result
      mysql-test/suite/perfschema/r/dml_setup_objects.result
      mysql-test/suite/perfschema/t/ddl_ews_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_processlist.test
      mysql-test/suite/perfschema/t/ddl_setup_objects.test
      mysql-test/suite/perfschema/t/dml_ews_by_event_name.test
      mysql-test/suite/perfschema/t/dml_processlist.test
      mysql-test/suite/perfschema/t/dml_setup_objects.test
      storage/perfschema/table_processlist.cc
      storage/perfschema/table_processlist.h
      storage/perfschema/table_setup_objects.cc
      storage/perfschema/table_setup_objects.h
    added:
      mysql-test/include/mysql_upgrade_preparation.inc
      mysql-test/r/merge_mmap.result
      mysql-test/r/mysql_upgrade_ssl.result
      mysql-test/suite/parts/inc/partition_crash.inc
      mysql-test/suite/parts/inc/partition_crash_add.inc
      mysql-test/suite/parts/inc/partition_crash_change.inc
      mysql-test/suite/parts/inc/partition_crash_drop.inc
      mysql-test/suite/parts/inc/partition_fail.inc
      mysql-test/suite/parts/inc/partition_fail_add.inc
      mysql-test/suite/parts/inc/partition_fail_change.inc
      mysql-test/suite/parts/inc/partition_fail_drop.inc
      mysql-test/suite/parts/inc/partition_mgm_crash.inc
      mysql-test/suite/parts/r/partition_debug_innodb.result
      mysql-test/suite/parts/r/partition_debug_myisam.result
      mysql-test/suite/parts/t/partition_debug_innodb-master.opt
      mysql-test/suite/parts/t/partition_debug_innodb.test
      mysql-test/suite/parts/t/partition_debug_myisam-master.opt
      mysql-test/suite/parts/t/partition_debug_myisam.test
      mysql-test/suite/perfschema/r/ddl_ews_global_by_event_name.result
      mysql-test/suite/perfschema/r/ddl_threads.result
      mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result
      mysql-test/suite/perfschema/r/dml_threads.result
      mysql-test/suite/perfschema/t/ddl_ews_global_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_threads.test
      mysql-test/suite/perfschema/t/dml_ews_global_by_event_name.test
      mysql-test/suite/perfschema/t/dml_threads.test
      mysql-test/suite/rpl/r/rpl_conditional_comments.result
      mysql-test/suite/rpl/t/rpl_conditional_comments.test
      mysql-test/t/merge_mmap-master.opt
      mysql-test/t/merge_mmap.test
      mysql-test/t/mysql_upgrade_ssl.test
      sql/sql_admin.cc
      sql/sql_admin.h
      sql/sql_alter.cc
      sql/sql_alter.h
      sql/sql_hset.h
      sql/sql_partition_admin.cc
      sql/sql_partition_admin.h
      storage/perfschema/table_ews_global_by_event_name.cc
      storage/perfschema/table_ews_global_by_event_name.h
      storage/perfschema/table_threads.cc
      storage/perfschema/table_threads.h
      unittest/strings/
      unittest/strings/Makefile.am
      unittest/strings/strings-t.c
    renamed:
      BUILD/choose_configure.sh => BUILD/cmake_configure.sh
    modified:
      .bzrignore
      BUILD/FINISH.sh
      BUILD/Makefile.am
      BUILD/SETUP.sh
      BUILD/autorun.sh
      BUILD/build_mccge.sh
      BUILD/check-cpu
      BUILD/compile-ndb-autotest
      BUILD/compile-pentium-debug
      BUILD/compile-pentium-debug-max
      BUILD/compile-pentium-debug-max-no-ndb
      BUILD/compile-pentium-debug-openssl
      BUILD/compile-pentium-debug-yassl
      BUILD/compile-pentium64-debug
      BUILD/compile-pentium64-debug-max
      CMakeLists.txt
      Makefile.am
      client/CMakeLists.txt
      client/mysql.cc
      client/mysql_upgrade.c
      client/mysqltest.cc
      cmake/abi_check.cmake
      cmake/configure.pl
      cmake/plugin.cmake
      cmd-line-utils/libedit/CMakeLists.txt
      cmd-line-utils/readline/CMakeLists.txt
      config/ac-macros/ha_ndbcluster.m4
      configure.in
      dbug/CMakeLists.txt
      extra/CMakeLists.txt
      extra/comp_err.c
      extra/yassl/CMakeLists.txt
      extra/yassl/src/yassl_imp.cpp
      extra/yassl/taocrypt/CMakeLists.txt
      include/CMakeLists.txt
      include/my_pthread.h
      include/mysql.h
      include/mysql.h.pp
      include/mysql/plugin.h.pp
      include/mysql/service_my_snprintf.h
      include/mysql/service_thd_alloc.h
      include/mysys_err.h
      include/thr_lock.h
      libmysql/CMakeLists.txt
      libmysqld/CMakeLists.txt
      libmysqld/Makefile.am
      libmysqld/examples/CMakeLists.txt
      libservices/CMakeLists.txt
      man/CMakeLists.txt
      mysql-test/CMakeLists.txt
      mysql-test/extra/rpl_tests/create_recursive_construct.inc
      mysql-test/include/handler.inc
      mysql-test/include/mix2.inc
      mysql-test/lib/My/Config.pm
      mysql-test/lib/My/ConfigFactory.pm
      mysql-test/lib/My/SafeProcess.pm
      mysql-test/lib/My/SafeProcess/CMakeLists.txt
      mysql-test/lib/mtr_cases.pm
      mysql-test/lib/mtr_report.pm
      mysql-test/lib/v1/mysql-test-run.pl
      mysql-test/mysql-test-run.pl
      mysql-test/r/alter_table.result
      mysql-test/r/csv.result
      mysql-test/r/func_group.result
      mysql-test/r/handler_innodb.result
      mysql-test/r/handler_myisam.result
      mysql-test/r/innodb_mysql_lock.result
      mysql-test/r/innodb_mysql_sync.result
      mysql-test/r/lowercase_table2.result
      mysql-test/r/mdl_sync.result
      mysql-test/r/merge.result
      mysql-test/r/mysqltest.result
      mysql-test/r/not_partition.result
      mysql-test/r/partition_debug_sync.result
      mysql-test/r/partition_disabled.result
      mysql-test/r/partition_innodb.result
      mysql-test/r/partition_truncate.result
      mysql-test/r/schema.result
      mysql-test/r/show_check.result
      mysql-test/r/signal.result
      mysql-test/r/signal_demo3.result
      mysql-test/r/sp-big.result
      mysql-test/r/sp-bugs.result
      mysql-test/r/sp-code.result
      mysql-test/r/sp-error.result
      mysql-test/r/sp.result
      mysql-test/r/sp_trans.result
      mysql-test/r/strict.result
      mysql-test/r/temp_table.result
      mysql-test/r/variables.result
      mysql-test/r/view.result
      mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result
      mysql-test/suite/binlog/r/binlog_unsafe.result
      mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test
      mysql-test/suite/binlog/t/binlog_unsafe.test
      mysql-test/suite/binlog/t/disabled.def
      mysql-test/suite/federated/federated_server.result
      mysql-test/suite/federated/federated_server.test
      mysql-test/suite/funcs_1/r/innodb_storedproc_02.result
      mysql-test/suite/funcs_1/r/innodb_storedproc_06.result
      mysql-test/suite/funcs_1/r/innodb_storedproc_10.result
      mysql-test/suite/funcs_1/r/innodb_trig_03.result
      mysql-test/suite/funcs_1/r/innodb_trig_03e.result
      mysql-test/suite/funcs_1/r/innodb_trig_0407.result
      mysql-test/suite/funcs_1/r/innodb_trig_08.result
      mysql-test/suite/funcs_1/r/memory_storedproc_02.result
      mysql-test/suite/funcs_1/r/memory_storedproc_06.result
      mysql-test/suite/funcs_1/r/memory_storedproc_10.result
      mysql-test/suite/funcs_1/r/memory_trig_03.result
      mysql-test/suite/funcs_1/r/memory_trig_03e.result
      mysql-test/suite/funcs_1/r/memory_trig_0407.result
      mysql-test/suite/funcs_1/r/memory_trig_08.result
      mysql-test/suite/funcs_1/r/myisam_storedproc_02.result
      mysql-test/suite/funcs_1/r/myisam_storedproc_06.result
      mysql-test/suite/funcs_1/r/myisam_storedproc_10.result
      mysql-test/suite/funcs_1/r/myisam_trig_03.result
      mysql-test/suite/funcs_1/r/myisam_trig_03e.result
      mysql-test/suite/funcs_1/r/myisam_trig_0407.result
      mysql-test/suite/funcs_1/r/myisam_trig_08.result
      mysql-test/suite/funcs_1/r/ndb_storedproc_06.result
      mysql-test/suite/funcs_1/r/ndb_storedproc_10.result
      mysql-test/suite/funcs_1/r/ndb_trig_03.result
      mysql-test/suite/funcs_1/r/ndb_trig_03e.result
      mysql-test/suite/funcs_1/r/ndb_trig_0407.result
      mysql-test/suite/funcs_1/r/ndb_trig_08.result
      mysql-test/suite/funcs_1/r/storedproc.result
      mysql-test/suite/funcs_1/storedproc/storedproc_06.inc
      mysql-test/suite/funcs_1/storedproc/storedproc_10.inc
      mysql-test/suite/funcs_1/triggers/triggers_03.inc
      mysql-test/suite/funcs_1/triggers/triggers_03e_columns.inc
      mysql-test/suite/funcs_1/triggers/triggers_03e_db_level.inc
      mysql-test/suite/funcs_1/triggers/triggers_03e_db_table_mix.inc
      mysql-test/suite/funcs_1/triggers/triggers_03e_definer.inc
      mysql-test/suite/funcs_1/triggers/triggers_03e_global_db_mix.inc
      mysql-test/suite/funcs_1/triggers/triggers_03e_prepare.inc
      mysql-test/suite/funcs_1/triggers/triggers_03e_table_level.inc
      mysql-test/suite/funcs_1/triggers/triggers_03e_transaction.inc
      mysql-test/suite/funcs_1/triggers/triggers_0407.inc
      mysql-test/suite/funcs_1/triggers/triggers_08.inc
      mysql-test/suite/innodb/t/innodb_mysql.test
      mysql-test/suite/ndb/r/ndb_cursor.result
      mysql-test/suite/ndb/t/disabled.def
      mysql-test/suite/parts/inc/partition_mgm.inc
      mysql-test/suite/parts/r/partition_debug_sync_innodb.result
      mysql-test/suite/parts/r/partition_mgm_lc0_archive.result
      mysql-test/suite/parts/r/partition_mgm_lc1_archive.result
      mysql-test/suite/parts/r/partition_mgm_lc2_archive.result
      mysql-test/suite/parts/r/partition_special_innodb.result
      mysql-test/suite/parts/r/partition_special_myisam.result
      mysql-test/suite/parts/t/partition_debug_sync_innodb.test
      mysql-test/suite/parts/t/partition_special_innodb-master.opt
      mysql-test/suite/parts/t/partition_special_innodb.test
      mysql-test/suite/parts/t/partition_special_myisam.test
      mysql-test/suite/perfschema/include/setup_helper.inc
      mysql-test/suite/perfschema/include/start_server_common.inc
      mysql-test/suite/perfschema/r/aggregate.result
      mysql-test/suite/perfschema/r/func_file_io.result
      mysql-test/suite/perfschema/r/information_schema.result
      mysql-test/suite/perfschema/r/misc.result
      mysql-test/suite/perfschema/r/no_threads.result
      mysql-test/suite/perfschema/r/pfs_upgrade.result
      mysql-test/suite/perfschema/r/schema.result
      mysql-test/suite/perfschema/r/selects.result
      mysql-test/suite/perfschema/r/server_init.result
      mysql-test/suite/perfschema/r/start_server_no_cond_class.result
      mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
      mysql-test/suite/perfschema/r/start_server_no_file_class.result
      mysql-test/suite/perfschema/r/start_server_no_file_inst.result
      mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
      mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
      mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
      mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
      mysql-test/suite/perfschema/r/start_server_no_thread_class.result
      mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
      mysql-test/suite/perfschema/r/start_server_off.result
      mysql-test/suite/perfschema/r/start_server_on.result
      mysql-test/suite/perfschema/t/aggregate.test
      mysql-test/suite/perfschema/t/func_file_io.test
      mysql-test/suite/perfschema/t/misc.test
      mysql-test/suite/perfschema/t/no_threads.test
      mysql-test/suite/perfschema/t/schema.test
      mysql-test/suite/perfschema/t/selects.test
      mysql-test/suite/perfschema/t/server_init.test
      mysql-test/suite/perfschema/t/start_server_no_thread_class.test
      mysql-test/suite/perfschema/t/start_server_no_thread_inst.test
      mysql-test/suite/perfschema/t/thread_cache.test
      mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result
      mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result
      mysql-test/suite/rpl/r/rpl_packet.result
      mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result
      mysql-test/suite/rpl/r/rpl_row_sp005.result
      mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
      mysql-test/suite/rpl/r/rpl_row_trig003.result
      mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result
      mysql-test/suite/rpl/t/rpl_packet.test
      mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result
      mysql-test/suite/rpl_ndb/t/disabled.def
      mysql-test/t/alter_table.test
      mysql-test/t/csv.test
      mysql-test/t/func_group.test
      mysql-test/t/innodb_mysql_lock.test
      mysql-test/t/innodb_mysql_sync.test
      mysql-test/t/mdl_sync.test
      mysql-test/t/merge-big.test
      mysql-test/t/merge.test
      mysql-test/t/mysql_upgrade.test
      mysql-test/t/mysqltest.test
      mysql-test/t/not_partition.test
      mysql-test/t/partition_debug_sync.test
      mysql-test/t/partition_innodb.test
      mysql-test/t/partition_truncate.test
      mysql-test/t/schema.test
      mysql-test/t/show_check.test
      mysql-test/t/signal.test
      mysql-test/t/sp-code.test
      mysql-test/t/sp-error.test
      mysql-test/t/sp.test
      mysql-test/t/temp_table.test
      mysql-test/t/variables.test
      mysys/CMakeLists.txt
      mysys/errors.c
      mysys/mf_iocache.c
      mysys/my_copy.c
      mysys/my_redel.c
      mysys/thr_lock.c
      plugin/audit_null/CMakeLists.txt
      plugin/audit_null/audit_null.c
      plugin/daemon_example/CMakeLists.txt
      plugin/fulltext/CMakeLists.txt
      plugin/semisync/CMakeLists.txt
      regex/CMakeLists.txt
      regex/engine.c
      scripts/CMakeLists.txt
      scripts/mysql_config.sh
      scripts/mysql_system_tables.sql
      sql-bench/CMakeLists.txt
      sql/CMakeLists.txt
      sql/Makefile.am
      sql/datadict.cc
      sql/datadict.h
      sql/event_data_objects.cc
      sql/event_db_repository.cc
      sql/event_db_repository.h
      sql/events.cc
      sql/examples/CMakeLists.txt
      sql/field.cc
      sql/ha_ndbcluster.cc
      sql/ha_ndbcluster_binlog.cc
      sql/ha_ndbcluster_cond.cc
      sql/handler.cc
      sql/handler.h
      sql/item.cc
      sql/item.h
      sql/lock.cc
      sql/lock.h
      sql/log.cc
      sql/log_event.cc
      sql/mdl.cc
      sql/mdl.h
      sql/mysqld.cc
      sql/mysqld.h
      sql/partition_info.cc
      sql/protocol.cc
      sql/rpl_rli.cc
      sql/set_var.cc
      sql/share/CMakeLists.txt
      sql/slave.cc
      sql/sp.cc
      sql/sp_head.cc
      sql/sp_head.h
      sql/sp_pcontext.h
      sql/sp_rcontext.cc
      sql/sp_rcontext.h
      sql/spatial.cc
      sql/sql_acl.cc
      sql/sql_base.cc
      sql/sql_base.h
      sql/sql_cache.cc
      sql/sql_class.cc
      sql/sql_class.h
      sql/sql_cursor.cc
      sql/sql_cursor.h
      sql/sql_db.cc
      sql/sql_db.h
      sql/sql_delete.cc
      sql/sql_do.cc
      sql/sql_error.cc
      sql/sql_error.h
      sql/sql_handler.cc
      sql/sql_help.cc
      sql/sql_insert.cc
      sql/sql_lex.cc
      sql/sql_lex.h
      sql/sql_load.cc
      sql/sql_parse.cc
      sql/sql_parse.h
      sql/sql_partition.cc
      sql/sql_partition.h
      sql/sql_plugin.cc
      sql/sql_prepare.cc
      sql/sql_priv.h
      sql/sql_rename.cc
      sql/sql_repl.cc
      sql/sql_select.cc
      sql/sql_select.h
      sql/sql_servers.cc
      sql/sql_show.cc
      sql/sql_signal.cc
      sql/sql_table.cc
      sql/sql_table.h
      sql/sql_trigger.cc
      sql/sql_truncate.cc
      sql/sql_truncate.h
      sql/sql_udf.cc
      sql/sql_union.cc
      sql/sql_update.cc
      sql/sql_view.cc
      sql/sql_yacc.yy
      sql/sys_vars.cc
      sql/table.cc
      sql/table.h
      sql/transaction.cc
      sql/tztime.cc
      sql/udf_example.c
      storage/archive/CMakeLists.txt
      storage/blackhole/CMakeLists.txt
      storage/csv/CMakeLists.txt
      storage/csv/ha_tina.cc
      storage/example/CMakeLists.txt
      storage/example/ha_example.cc
      storage/federated/CMakeLists.txt
      storage/heap/CMakeLists.txt
      storage/ibmdb2i/CMakeLists.txt
      storage/innobase/CMakeLists.txt
      storage/myisam/CMakeLists.txt
      storage/myisam/mi_locking.c
      storage/myisam/mi_statrec.c
      storage/myisam/rt_split.c
      storage/myisammrg/CMakeLists.txt
      storage/myisammrg/ha_myisammrg.cc
      storage/myisammrg/myrg_open.c
      storage/perfschema/CMakeLists.txt
      storage/perfschema/Makefile.am
      storage/perfschema/pfs.cc
      storage/perfschema/pfs_engine_table.cc
      storage/perfschema/pfs_events_waits.cc
      storage/perfschema/pfs_events_waits.h
      storage/perfschema/table_events_waits.cc
      storage/perfschema/table_events_waits_summary.cc
      storage/perfschema/table_events_waits_summary.h
      strings/CMakeLists.txt
      strings/ctype-big5.c
      strings/ctype-cp932.c
      strings/ctype-euc_kr.c
      strings/ctype-eucjpms.c
      strings/ctype-gb2312.c
      strings/ctype-gbk.c
      strings/ctype-mb.c
      strings/ctype-sjis.c
      strings/ctype-ujis.c
      strings/decimal.c
      support-files/CMakeLists.txt
      support-files/mysql.spec.sh
      tests/CMakeLists.txt
      unittest/Makefile.am
      unittest/examples/CMakeLists.txt
      unittest/mysys/CMakeLists.txt
      unittest/mytap/CMakeLists.txt
      vio/CMakeLists.txt
      zlib/CMakeLists.txt
=== modified file 'storage/innobase/row/row0sel.c'
--- a/storage/innobase/row/row0sel.c	revid:vasil.dimov@stripped6-tvx5p96ts3919o4v
+++ b/storage/innobase/row/row0sel.c	revid:marko.makela@strippedxb6
@@ -2682,7 +2682,6 @@ row_sel_store_mysql_rec(
 	ut_ad(prebuilt->mysql_template);
 	ut_ad(prebuilt->default_rec);
 	ut_ad(rec_offs_validate(rec, NULL, offsets));
-	ut_ad(!rec_get_deleted_flag(rec, rec_offs_comp(offsets)));
 
 	if (UNIV_LIKELY_NULL(prebuilt->blob_heap)) {
 		mem_heap_free(prebuilt->blob_heap);
@@ -3603,6 +3602,7 @@ row_search_for_mysql(
 				row_sel_try_search_shortcut_for_mysql().
 				The latch will not be released until
 				mtr_commit(&mtr). */
+				ut_ad(!rec_get_deleted_flag(rec, comp));
 
 				if (!row_sel_store_mysql_rec(buf, prebuilt,
 							     rec, offsets)) {
@@ -4230,7 +4230,7 @@ no_gap_lock:
 
 				rec = old_vers;
 			}
-		} else if (!lock_sec_rec_cons_read_sees(rec, trx->read_view)) {
+		} else {
 			/* We are looking into a non-clustered index,
 			and to get the right version of the record we
 			have to look also into the clustered index: this
@@ -4238,8 +4238,12 @@ no_gap_lock:
 			information via the clustered index record. */
 
 			ut_ad(index != clust_index);
+			ut_ad(!dict_index_is_clust(index));
 
-			goto requires_clust_rec;
+			if (!lock_sec_rec_cons_read_sees(
+				    rec, trx->read_view)) {
+				goto requires_clust_rec;
+			}
 		}
 	}
 
@@ -4362,8 +4366,13 @@ requires_clust_rec:
 						  ULINT_UNDEFINED, &heap);
 			result_rec = rec;
 		}
+
+		/* result_rec can legitimately be delete-marked
+		now that it has been established that it points to a
+		clustered index record that exists in the read view. */
 	} else {
 		result_rec = rec;
+		ut_ad(!rec_get_deleted_flag(rec, comp));
 	}
 
 	/* We found a qualifying record 'result_rec'. At this point,

Attachment: [text/bzr-bundle] bzr/marko.makela@oracle.com-20100818114002-6iftfqr4n5h13xb6.bundle
Thread
bzr push into mysql-5.5-innodb branch (marko.makela:3165 to 3166) Bug#55626marko.makela18 Aug