3246 Vasil Dimov 2010-09-28 [merge]
Merge mysql-trunk-bugfixing -> mysql-trunk-innodb
modified:
client/CMakeLists.txt
include/CMakeLists.txt
include/Makefile.am
include/atomic/x86-gcc.h
mysql-test/r/sp-destruct.result
mysql-test/r/type_newdecimal.result
mysql-test/t/sp-destruct.test
mysql-test/t/type_newdecimal.test
mysql-test/valgrind.supp
packaging/WiX/mysql_server.wxs.in
scripts/CMakeLists.txt
scripts/make_win_bin_dist
sql/field.cc
sql/mdl.cc
sql/mdl.h
sql/sp.cc
sql/sql_base.cc
sql/sql_base.h
sql/sql_plugin.cc
sql/table.cc
storage/perfschema/pfs_engine_table.cc
3245 Vasil Dimov 2010-09-21 [merge]
Merge mysql-5.5-innodb -> mysql-trunk-innodb
(the version change in univ.i was reverted)
modified:
storage/innobase/btr/btr0btr.c
storage/innobase/btr/btr0cur.c
storage/innobase/btr/btr0pcur.c
storage/innobase/btr/btr0sea.c
storage/innobase/buf/buf0flu.c
storage/innobase/dict/dict0crea.c
storage/innobase/dict/dict0dict.c
storage/innobase/eval/eval0eval.c
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/i_s.cc
storage/innobase/ibuf/ibuf0ibuf.c
storage/innobase/include/ut0rnd.ic
storage/innobase/log/log0recv.c
storage/innobase/os/os0file.c
storage/innobase/que/que0que.c
storage/innobase/row/row0purge.c
storage/innobase/row/row0umod.c
storage/innobase/row/row0vers.c
storage/innobase/trx/trx0purge.c
storage/innobase/trx/trx0roll.c
storage/innobase/trx/trx0sys.c
storage/innobase/trx/trx0trx.c
storage/innobase/trx/trx0undo.c
=== modified file 'client/CMakeLists.txt'
--- a/client/CMakeLists.txt revid:vasil.dimov@stripped
+++ b/client/CMakeLists.txt revid:vasil.dimov@stripped
@@ -64,7 +64,10 @@ MYSQL_ADD_EXECUTABLE(mysqlslap mysqlslap
SET_SOURCE_FILES_PROPERTIES(mysqlslap.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
TARGET_LINK_LIBRARIES(mysqlslap mysqlclient)
-ADD_EXECUTABLE(echo echo.c)
+# "WIN32" also covers 64 bit. "echo" is used in some files below "mysql-test/".
+IF(WIN32)
+ MYSQL_ADD_EXECUTABLE(echo echo.c)
+ENDIF(WIN32)
SET_TARGET_PROPERTIES (mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysqlslap
PROPERTIES HAS_CXX TRUE)
=== modified file 'include/CMakeLists.txt'
--- a/include/CMakeLists.txt revid:vasil.dimov@stripped
+++ b/include/CMakeLists.txt revid:vasil.dimov@stripped
@@ -54,6 +54,7 @@ SET(HEADERS
keycache.h
m_ctype.h
my_attribute.h
+ my_compiler.h
${HEADERS_GEN_CONFIGURE}
)
=== modified file 'include/Makefile.am'
--- a/include/Makefile.am revid:vasil.dimov@stripped
+++ b/include/Makefile.am revid:vasil.dimov@stripped
@@ -32,8 +32,9 @@ pkginclude_HEADERS = $(HEADERS_ABI) my_d
decimal.h errmsg.h my_global.h my_net.h \
my_getopt.h sslopt-longopts.h my_dir.h \
sslopt-vars.h sslopt-case.h sql_common.h keycache.h \
- m_ctype.h my_attribute.h $(HEADERS_GEN_CONFIGURE) \
- $(HEADERS_GEN_MAKE) probes_mysql.h probes_mysql_nodtrace.h
+ m_ctype.h my_attribute.h my_compiler.h \
+ $(HEADERS_GEN_CONFIGURE) $(HEADERS_GEN_MAKE) \
+ probes_mysql.h probes_mysql_nodtrace.h
noinst_HEADERS = lf.h my_bit.h \
heap.h my_bitmap.h my_uctype.h password.h \
@@ -47,7 +48,7 @@ noinst_HEADERS = lf.h my_bit.h \
my_user.h my_atomic.h atomic/nolock.h \
atomic/rwlock.h atomic/x86-gcc.h atomic/generic-msvc.h \
atomic/gcc_builtins.h my_libwrap.h my_stacktrace.h \
- atomic/solaris.h mysql/innodb_priv.h my_compiler.h
+ atomic/solaris.h mysql/innodb_priv.h
pkgpsiinclude_HEADERS = mysql/psi/psi.h mysql/psi/mysql_thread.h \
mysql/psi/mysql_file.h \
=== modified file 'include/atomic/x86-gcc.h'
--- a/include/atomic/x86-gcc.h revid:vasil.dimov@stripped
+++ b/include/atomic/x86-gcc.h revid:vasil.dimov@stripped
@@ -111,9 +111,9 @@
On some platforms (e.g. Mac OS X and Solaris) the ebx register
is held as a pointer to the global offset table. Thus we're not
allowed to use the b-register on those platforms when compiling
- PIC code, to avoid this we push ebx and pop ebx and add a movl
- instruction to avoid having ebx in the interface of the assembler
- instruction.
+ PIC code, to avoid this we push ebx and pop ebx. The new value
+ is copied directly from memory to avoid problems with a implicit
+ manipulation of the stack pointer by the push.
cmpxchg8b works on both 32-bit platforms and 64-bit platforms but
the code here is only used on 32-bit platforms, on 64-bit
@@ -121,11 +121,13 @@
fine.
*/
#define make_atomic_cas_body64 \
- int32 ebx=(set & 0xFFFFFFFF), ecx=(set >> 32); \
- asm volatile ("push %%ebx; movl %3, %%ebx;" \
- LOCK_prefix "; cmpxchg8b %0; setz %2; pop %%ebx" \
- : "=m" (*a), "+A" (*cmp), "=c" (ret) \
- : "m" (ebx), "c" (ecx), "m" (*a) \
+ asm volatile ("push %%ebx;" \
+ "movl (%%ecx), %%ebx;" \
+ "movl 4(%%ecx), %%ecx;" \
+ LOCK_prefix "; cmpxchg8b %0;" \
+ "setz %2; pop %%ebx" \
+ : "=m" (*a), "+A" (*cmp), "=c" (ret) \
+ : "c" (&set), "m" (*a) \
: "memory", "esp")
#endif
=== modified file 'mysql-test/r/sp-destruct.result'
--- a/mysql-test/r/sp-destruct.result revid:vasil.dimov@stripped
+++ b/mysql-test/r/sp-destruct.result revid:vasil.dimov@stripped
@@ -134,3 +134,19 @@ Warning 1405 Failed to revoke all privil
# Restore the procs_priv table
RENAME TABLE procs_priv_backup TO mysql.procs_priv;
FLUSH TABLE mysql.procs_priv;
+#
+# Bug #56137 "Assertion `thd->lock == 0' failed on upgrading from
+# 5.1.50 to 5.5.6".
+#
+drop database if exists mysqltest;
+# Backup mysql.proc.
+flush table mysql.proc;
+create database mysqltest;
+# Corrupt mysql.proc to make it unusable by current version of server.
+alter table mysql.proc drop column type;
+# The below statement should not cause assertion failure.
+drop database mysqltest;
+Warnings:
+Error 1695 Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted
+# Restore mysql.proc.
+drop table mysql.proc;
=== modified file 'mysql-test/r/type_newdecimal.result'
--- a/mysql-test/r/type_newdecimal.result revid:vasil.dimov@stripped
+++ b/mysql-test/r/type_newdecimal.result revid:vasil.dimov@stripped
@@ -1908,4 +1908,16 @@ group by PAY.id + 1;
mult v_net_with_discount v_total
1.0000 27.18 27.180000
DROP TABLE currencies, payments, sub_tasks;
+#
+# BUG#52171: distinct aggregates on unsigned decimal fields trigger assertions
+#
+CREATE TABLE t1 (a DECIMAL(4,4) UNSIGNED);
+INSERT INTO t1 VALUES (0);
+SELECT AVG(DISTINCT a) FROM t1;
+AVG(DISTINCT a)
+0.00000000
+SELECT SUM(DISTINCT a) FROM t1;
+SUM(DISTINCT a)
+0.0000
+DROP TABLE t1;
End of 5.1 tests
=== modified file 'mysql-test/t/sp-destruct.test'
--- a/mysql-test/t/sp-destruct.test revid:vasil.dimov@stripped
+++ b/mysql-test/t/sp-destruct.test revid:vasil.dimov@stripped
@@ -222,3 +222,33 @@ SHOW WARNINGS;
--echo # Restore the procs_priv table
RENAME TABLE procs_priv_backup TO mysql.procs_priv;
FLUSH TABLE mysql.procs_priv;
+
+
+--echo #
+--echo # Bug #56137 "Assertion `thd->lock == 0' failed on upgrading from
+--echo # 5.1.50 to 5.5.6".
+--echo #
+--disable_warnings
+drop database if exists mysqltest;
+--enable_warnings
+--echo # Backup mysql.proc.
+flush table mysql.proc;
+let $MYSQLD_DATADIR= `select @@datadir`;
+--copy_file $MYSQLD_DATADIR/mysql/proc.frm $MYSQLTEST_VARDIR/tmp/proc.frm
+--copy_file $MYSQLD_DATADIR/mysql/proc.MYD $MYSQLTEST_VARDIR/tmp/proc.MYD
+--copy_file $MYSQLD_DATADIR/mysql/proc.MYI $MYSQLTEST_VARDIR/tmp/proc.MYI
+
+create database mysqltest;
+--echo # Corrupt mysql.proc to make it unusable by current version of server.
+alter table mysql.proc drop column type;
+--echo # The below statement should not cause assertion failure.
+drop database mysqltest;
+
+--echo # Restore mysql.proc.
+drop table mysql.proc;
+--copy_file $MYSQLTEST_VARDIR/tmp/proc.frm $MYSQLD_DATADIR/mysql/proc.frm
+--copy_file $MYSQLTEST_VARDIR/tmp/proc.MYD $MYSQLD_DATADIR/mysql/proc.MYD
+--copy_file $MYSQLTEST_VARDIR/tmp/proc.MYI $MYSQLD_DATADIR/mysql/proc.MYI
+--remove_file $MYSQLTEST_VARDIR/tmp/proc.frm
+--remove_file $MYSQLTEST_VARDIR/tmp/proc.MYD
+--remove_file $MYSQLTEST_VARDIR/tmp/proc.MYI
=== modified file 'mysql-test/t/type_newdecimal.test'
--- a/mysql-test/t/type_newdecimal.test revid:vasil.dimov@stripped
+++ b/mysql-test/t/type_newdecimal.test revid:vasil.dimov@stripped
@@ -1509,5 +1509,14 @@ group by PAY.id + 1;
DROP TABLE currencies, payments, sub_tasks;
+--echo #
+--echo # BUG#52171: distinct aggregates on unsigned decimal fields trigger assertions
+--echo #
+
+CREATE TABLE t1 (a DECIMAL(4,4) UNSIGNED);
+INSERT INTO t1 VALUES (0);
+SELECT AVG(DISTINCT a) FROM t1;
+SELECT SUM(DISTINCT a) FROM t1;
+DROP TABLE t1;
--echo End of 5.1 tests
=== modified file 'mysql-test/valgrind.supp'
--- a/mysql-test/valgrind.supp revid:vasil.dimov@stripped
+++ b/mysql-test/valgrind.supp revid:vasil.dimov@stripped
@@ -770,3 +770,13 @@
fun:lf_hash_insert
}
+{
+ missing shutdown_performance_schema 3
+ Memcheck:Leak
+ fun:malloc
+ fun:my_malloc
+ fun:initialize_bucket
+ fun:lf_hash_search
+ fun:_Z19find_or_create_fileP10PFS_threadP14PFS_file_classPKcj
+}
+
=== modified file 'packaging/WiX/mysql_server.wxs.in'
--- a/packaging/WiX/mysql_server.wxs.in revid:vasil.dimov@stripped
+++ b/packaging/WiX/mysql_server.wxs.in revid:vasil.dimov@stripped
@@ -21,7 +21,9 @@
<Media Id='1' Cabinet='product.cab' EmbedCab='yes' />
<!-- Upgrade -->
+
<Upgrade Id="49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3">
+ <?if '@PATCH@' != '0'?>
<UpgradeVersion
Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.0"
IncludeMinimum="yes"
@@ -29,6 +31,7 @@
Property="OLDERVERSIONBEINGUPGRADED"
MigrateFeatures="yes"
/>
+ <?endif?>
<UpgradeVersion
Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@"
OnlyDetect="yes"
=== modified file 'scripts/CMakeLists.txt'
--- a/scripts/CMakeLists.txt revid:vasil.dimov@stripped
+++ b/scripts/CMakeLists.txt revid:vasil.dimov@stripped
@@ -139,6 +139,7 @@ ELSE()
ENDIF()
SET(HOSTNAME "hostname")
+SET(MYSQLD_USER "mysql")
# Required for mysqlbug until autotools are deprecated, once done remove these
# and expand default cmake variables
=== modified file 'scripts/make_win_bin_dist'
--- a/scripts/make_win_bin_dist revid:vasil.dimov@stripped
+++ b/scripts/make_win_bin_dist revid:vasil.dimov@stripped
@@ -260,6 +260,7 @@ cp include/mysql.h \
include/keycache.h \
include/m_ctype.h \
include/my_attribute.h \
+ include/my_compiler.h \
include/mysqld_error.h \
include/sql_state.h \
include/mysqld_ername.h \
=== modified file 'sql/field.cc'
--- a/sql/field.cc revid:vasil.dimov@stripped
+++ b/sql/field.cc revid:vasil.dimov@stripped
@@ -9151,7 +9151,7 @@ void Create_field::init_for_tmp_table(en
case MYSQL_TYPE_NEWDECIMAL:
case MYSQL_TYPE_FLOAT:
case MYSQL_TYPE_DOUBLE:
- pack_flag= FIELDFLAG_DECIMAL | FIELDFLAG_NUMBER |
+ pack_flag= FIELDFLAG_NUMBER |
(decimals_arg & FIELDFLAG_MAX_DEC) << FIELDFLAG_DEC_SHIFT;
break;
@@ -9200,12 +9200,13 @@ void Create_field::init_for_tmp_table(en
(maybe_null ? FIELDFLAG_MAYBE_NULL : 0) |
(is_unsigned ? 0 : FIELDFLAG_DECIMAL);
- DBUG_PRINT("debug", ("pack_flag: %s%s%s%s%s, pack_type: %d",
+ DBUG_PRINT("debug", ("pack_flag: %s%s%s%s%s%s, pack_type: %d",
FLAGSTR(pack_flag, FIELDFLAG_BINARY),
FLAGSTR(pack_flag, FIELDFLAG_NUMBER),
FLAGSTR(pack_flag, FIELDFLAG_INTERVAL),
FLAGSTR(pack_flag, FIELDFLAG_GEOM),
FLAGSTR(pack_flag, FIELDFLAG_BLOB),
+ FLAGSTR(pack_flag, FIELDFLAG_DECIMAL),
f_packtype(pack_flag)));
DBUG_VOID_RETURN;
}
=== modified file 'sql/mdl.cc'
--- a/sql/mdl.cc revid:vasil.dimov@stripped
+++ b/sql/mdl.cc revid:vasil.dimov@stripped
@@ -124,7 +124,6 @@ public:
Deadlock_detection_visitor(MDL_context *start_node_arg)
: m_start_node(start_node_arg),
m_victim(NULL),
- m_current_search_depth(0),
m_found_deadlock(FALSE)
{}
virtual bool enter_node(MDL_context *node);
@@ -133,6 +132,8 @@ public:
virtual bool inspect_edge(MDL_context *dest);
MDL_context *get_victim() const { return m_victim; }
+
+ void abort_traversal(MDL_context *node);
private:
/**
Change the deadlock victim to a new one if it has lower deadlock
@@ -147,13 +148,6 @@ private:
MDL_context *m_start_node;
/** If a deadlock is found, the context that identifies the victim. */
MDL_context *m_victim;
- /** Set to the 0 at start. Increased whenever
- we descend into another MDL context (aka traverse to the next
- wait-for graph node). When MAX_SEARCH_DEPTH is reached, we
- assume that a deadlock is found, even if we have not found a
- loop.
- */
- uint m_current_search_depth;
/** TRUE if we found a deadlock. */
bool m_found_deadlock;
/**
@@ -187,7 +181,7 @@ private:
bool Deadlock_detection_visitor::enter_node(MDL_context *node)
{
- m_found_deadlock= ++m_current_search_depth >= MAX_SEARCH_DEPTH;
+ m_found_deadlock= m_current_search_depth >= MAX_SEARCH_DEPTH;
if (m_found_deadlock)
{
DBUG_ASSERT(! m_victim);
@@ -207,7 +201,6 @@ bool Deadlock_detection_visitor::enter_n
void Deadlock_detection_visitor::leave_node(MDL_context *node)
{
- --m_current_search_depth;
if (m_found_deadlock)
opt_change_victim_to(node);
}
@@ -252,6 +245,21 @@ Deadlock_detection_visitor::opt_change_v
/**
+ Abort traversal of a wait-for graph and report a deadlock.
+
+ @param node Node which we were about to visit when abort
+ was initiated.
+*/
+
+void Deadlock_detection_visitor::abort_traversal(MDL_context *node)
+{
+ DBUG_ASSERT(! m_victim);
+ m_found_deadlock= TRUE;
+ opt_change_victim_to(node);
+}
+
+
+/**
Get a bit corresponding to enum_mdl_type value in a granted/waiting bitmaps
and compatibility matrices.
*/
@@ -2056,8 +2064,13 @@ bool MDL_lock::visit_subgraph(MDL_ticket
are visiting it but this is OK: in the worst case we might do some
extra work and one more context might be chosen as a victim.
*/
+ ++gvisitor->m_current_search_depth;
+
if (gvisitor->enter_node(src_ctx))
+ {
+ --gvisitor->m_current_search_depth;
goto end;
+ }
/*
We do a breadth-first search first -- that is, inspect all
@@ -2114,6 +2127,7 @@ bool MDL_lock::visit_subgraph(MDL_ticket
end_leave_node:
gvisitor->leave_node(src_ctx);
+ --gvisitor->m_current_search_depth;
end:
mysql_prlock_unlock(&m_rwlock);
=== modified file 'sql/mdl.h'
--- a/sql/mdl.h revid:vasil.dimov@stripped
+++ b/sql/mdl.h revid:vasil.dimov@stripped
@@ -385,7 +385,10 @@ public:
virtual bool inspect_edge(MDL_context *dest) = 0;
virtual ~MDL_wait_for_graph_visitor();
- MDL_wait_for_graph_visitor() :m_lock_open_count(0) {}
+ MDL_wait_for_graph_visitor() :m_lock_open_count(0),
+ m_current_search_depth(0)
+ { }
+ virtual void abort_traversal(MDL_context *node) = 0;
public:
/**
XXX, hack: During deadlock search, we may need to
@@ -396,6 +399,17 @@ public:
LOCK_open since it has significant performance impacts.
*/
uint m_lock_open_count;
+ /**
+ Set to the 0 at start. Increased whenever
+ we descend into another MDL context (aka traverse to the next
+ wait-for graph node). When MAX_SEARCH_DEPTH is reached, we
+ assume that a deadlock is found, even if we have not found a
+ loop.
+
+ XXX: This member belongs to this class only temporarily until
+ bug #56405 is fixed.
+ */
+ uint m_current_search_depth;
};
/**
=== modified file 'sql/sp.cc'
--- a/sql/sp.cc revid:vasil.dimov@stripped
+++ b/sql/sp.cc revid:vasil.dimov@stripped
@@ -440,6 +440,7 @@ static TABLE *open_proc_table_for_update
{
TABLE_LIST table_list;
TABLE *table;
+ MDL_ticket *mdl_savepoint= thd->mdl_context.mdl_savepoint();
DBUG_ENTER("open_proc_table_for_update");
table_list.init_one_table("mysql", 5, "proc", 4, "proc", TL_WRITE);
@@ -450,6 +451,9 @@ static TABLE *open_proc_table_for_update
if (!proc_table_intact.check(table, &proc_table_def))
DBUG_RETURN(table);
+ close_thread_tables(thd);
+ thd->mdl_context.rollback_to_savepoint(mdl_savepoint);
+
DBUG_RETURN(NULL);
}
=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc revid:vasil.dimov@stripped
+++ b/sql/sql_base.cc revid:vasil.dimov@stripped
@@ -100,6 +100,8 @@ bool No_such_table_error_handler::safely
TABLE_SHAREs, refresh_version and the table id counter.
*/
mysql_mutex_t LOCK_open;
+mysql_mutex_t LOCK_dd_owns_lock_open;
+uint dd_owns_lock_open= 0;
#ifdef HAVE_PSI_INTERFACE
static PSI_mutex_key key_LOCK_open;
@@ -298,6 +300,7 @@ bool table_def_init(void)
init_tdc_psi_keys();
#endif
mysql_mutex_init(key_LOCK_open, &LOCK_open, MY_MUTEX_INIT_FAST);
+ mysql_mutex_init(NULL, &LOCK_dd_owns_lock_open, MY_MUTEX_INIT_FAST);
oldest_unused_share= &end_of_unused_share;
end_of_unused_share.prev= &oldest_unused_share;
@@ -341,6 +344,7 @@ void table_def_free(void)
table_def_inited= 0;
/* Free table definitions. */
my_hash_free(&table_def_cache);
+ mysql_mutex_destroy(&LOCK_dd_owns_lock_open);
mysql_mutex_destroy(&LOCK_open);
}
DBUG_VOID_RETURN;
=== modified file 'sql/sql_base.h'
--- a/sql/sql_base.h revid:vasil.dimov@stripped
+++ b/sql/sql_base.h revid:vasil.dimov@stripped
@@ -71,6 +71,8 @@ enum enum_tdc_remove_table_type {TDC_RT_
bool check_dup(const char *db, const char *name, TABLE_LIST *tables);
extern mysql_mutex_t LOCK_open;
+extern mysql_mutex_t LOCK_dd_owns_lock_open;
+extern uint dd_owns_lock_open;
bool table_cache_init(void);
void table_cache_free(void);
bool table_def_init(void);
=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc revid:vasil.dimov@stripped
+++ b/sql/sql_plugin.cc revid:vasil.dimov@stripped
@@ -519,7 +519,7 @@ static st_plugin_dl *plugin_dl_add(const
/* no op */;
cur= (struct st_mysql_plugin*)
- my_malloc(i*sizeof(struct st_mysql_plugin), MYF(MY_ZEROFILL|MY_WME));
+ my_malloc((i+1)*sizeof(struct st_mysql_plugin), MYF(MY_ZEROFILL|MY_WME));
if (!cur)
{
free_plugin_mem(&plugin_dl);
=== modified file 'sql/table.cc'
--- a/sql/table.cc revid:vasil.dimov@stripped
+++ b/sql/table.cc revid:vasil.dimov@stripped
@@ -3092,7 +3092,30 @@ bool TABLE_SHARE::visit_subgraph(Wait_fo
holding a write-lock on MDL_lock::m_rwlock.
*/
if (gvisitor->m_lock_open_count++ == 0)
+ {
+ /*
+ To circumvent bug #56405 "Deadlock in the MDL deadlock detector"
+ we don't try to lock LOCK_open mutex if some thread doing
+ deadlock detection already owns it and current search depth is
+ greater than 0. Instead we report a deadlock.
+
+ TODO/FIXME: The proper fix for this bug is to use rwlocks for
+ protection of table shares/instead of LOCK_open.
+ Unfortunately it requires more effort/has significant
+ performance effect.
+ */
+ mysql_mutex_lock(&LOCK_dd_owns_lock_open);
+ if (gvisitor->m_current_search_depth > 0 && dd_owns_lock_open > 0)
+ {
+ mysql_mutex_unlock(&LOCK_dd_owns_lock_open);
+ --gvisitor->m_lock_open_count;
+ gvisitor->abort_traversal(src_ctx);
+ return TRUE;
+ }
+ ++dd_owns_lock_open;
+ mysql_mutex_unlock(&LOCK_dd_owns_lock_open);
mysql_mutex_lock(&LOCK_open);
+ }
I_P_List_iterator <TABLE, TABLE_share> tables_it(used_tables);
@@ -3107,8 +3130,12 @@ bool TABLE_SHARE::visit_subgraph(Wait_fo
goto end;
}
+ ++gvisitor->m_current_search_depth;
if (gvisitor->enter_node(src_ctx))
+ {
+ --gvisitor->m_current_search_depth;
goto end;
+ }
while ((table= tables_it++))
{
@@ -3131,10 +3158,16 @@ bool TABLE_SHARE::visit_subgraph(Wait_fo
end_leave_node:
gvisitor->leave_node(src_ctx);
+ --gvisitor->m_current_search_depth;
end:
if (gvisitor->m_lock_open_count-- == 1)
+ {
mysql_mutex_unlock(&LOCK_open);
+ mysql_mutex_lock(&LOCK_dd_owns_lock_open);
+ --dd_owns_lock_open;
+ mysql_mutex_unlock(&LOCK_dd_owns_lock_open);
+ }
return result;
}
=== modified file 'storage/perfschema/pfs_engine_table.cc'
--- a/storage/perfschema/pfs_engine_table.cc revid:vasil.dimov@stripped
+++ b/storage/perfschema/pfs_engine_table.cc revid:vasil.dimov@stripped
@@ -223,6 +223,8 @@ int PFS_engine_table::read_row(TABLE *ta
Field **fields)
{
my_bitmap_map *org_bitmap;
+ Field *f;
+ Field **fields_reset;
/*
Make sure the table structure is as expected before mapping
@@ -240,6 +242,16 @@ int PFS_engine_table::read_row(TABLE *ta
/* We internally write to Fields to support the read interface */
org_bitmap= dbug_tmp_use_all_columns(table, table->write_set);
+
+ /*
+ Some callers of the storage engine interface do not honor the
+ f->is_null() flag, and will attempt to read the data itself.
+ A known offender is mysql_checksum_table().
+ For robustness, reset every field.
+ */
+ for (fields_reset= fields; (f= *fields_reset) ; fields_reset++)
+ f->reset();
+
int result= read_row_values(table, buf, fields, read_all);
dbug_tmp_restore_column_map(table->write_set, org_bitmap);
Attachment: [text/bzr-bundle] bzr/vasil.dimov@oracle.com-20100928064201-il7uj41c7iosx7we.bundle
| Thread |
|---|
| • bzr push into mysql-trunk-innodb branch (vasil.dimov:3245 to 3246) | vasil.dimov | 28 Sep |