3377 Marc Alff 2011-03-08
Bug#11830755 - UNIT TESTS PFS_INSTR AND PFS_INSTR_CLASS CRASH IN MUTEX CALLS ON WINDOWS
Before this fix, two performance schema unit tests crashed on windows.
The problem was a missing initialization to PFS_atomics,
which caused the crash only for platform not compiled with native atomics.
This fix adds the missing initialization in the unit tests.
No production code was changed, this is a unit test bug only.
modified:
storage/perfschema/unittest/pfs-t.cc
storage/perfschema/unittest/pfs_instr-oom-t.cc
storage/perfschema/unittest/pfs_instr-t.cc
storage/perfschema/unittest/pfs_instr_class-oom-t.cc
storage/perfschema/unittest/pfs_instr_class-t.cc
storage/perfschema/unittest/pfs_timer-t.cc
3376 Jon Olav Hauglid 2011-03-08
Bug #11755431 (former 47205)
MAP 'REPAIR TABLE' TO RECREATE +ANALYZE FOR ENGINES NOT
SUPPORTING NATIVE REPAIR
Executing 'mysqlcheck --check-upgrade --auto-repair ...' will first issue
'CHECK TABLE FOR UPGRADE' for all tables in the database in order to check if the
tables are compatible with the current version of MySQL. Any tables that are
found incompatible are then upgraded using 'REPAIR TABLE'.
The problem was that some engines (e.g. InnoDB) do not support 'REPAIR TABLE'.
This caused any such tables to be left incompatible. As a result such tables were
not properly fixed by the mysql_upgrade tool.
This patch fixes the problem by first changing 'CHECK TABLE FOR UPGRADE' to return
a different error message if the engine does not support REPAIR. Instead of
"Table upgrade required. Please do "REPAIR TABLE ..." it will report
"Table rebuild required. Please do "ALTER TABLE ... FORCE ..."
Second, the patch changes mysqlcheck to do 'ALTER TABLE ... FORCE' instead of
'REPAIR TABLE' in these cases.
This patch also fixes 'ALTER TABLE ... FORCE' to actually rebuild the table.
This change should be reflected in the documentation. Before this patch,
'ALTER TABLE ... FORCE' was unused (See Bug#11746162)
Test case added to mysqlcheck.test
@ client/mysqlcheck.c
Changed mysqlcheck to do 'ALTER TABLE ... FORCE' if
'CHECK TABLE FOR UPGRADE' reports ER_TABLE_NEEDS_REBUILD
and not ER_TABLE_NEEDS_UPGRADE.
@ mysql-test/r/mysqlcheck.result
Added regression test.
@ mysql-test/std_data/bug47205.frm
InnoDB 5.0 FRM which contains a varchar primary key using
utf8_general_ci. This is an incompatible FRM for 5.5.
@ mysql-test/t/mysqlcheck.test
Added regression test.
@ sql/handler.h
Added new HA_CAN_REPAIR flag.
@ sql/share/errmsg-utf8.txt
Added new error message ER_TABLE_NEEDS_REBUILD
@ sql/sql_admin.cc
Changed 'CHECK TABLE FOR UPDATE' to give ER_TABLE_NEEDS_REBUILD
instead of ER_TABLE_NEEDS_UPGRADE if the engine does not support
REPAIR (as indicated by the new HA_CAN_REPAIR flag).
@ sql/sql_lex.h
Remove unused ALTER_FORCE flag.
@ sql/sql_yacc.yy
Make sure ALTER TABLE ... FORCE recreates the table
by setting the ALTER_RECREATE flag as the ALTER_FORCE
flag was unused.
@ storage/archive/ha_archive.h
Added new HA_CAN_REPAIR flag to Archive
@ storage/csv/ha_tina.h
Added new HA_CAN_REPAIR flag to CSV
@ storage/federated/ha_federated.h
Added new HA_CAN_REPAIR flag to Federated
@ storage/myisam/ha_myisam.cc
Added new HA_CAN_REPAIR flag to MyISAM
added:
mysql-test/std_data/bug47205.frm
modified:
client/mysqlcheck.c
mysql-test/r/mysqlcheck.result
mysql-test/t/mysqlcheck.test
sql/handler.cc
sql/handler.h
sql/share/errmsg-utf8.txt
sql/sql_admin.cc
sql/sql_lex.h
sql/sql_yacc.yy
storage/archive/ha_archive.h
storage/csv/ha_tina.h
storage/federated/ha_federated.h
storage/myisam/ha_myisam.cc
=== modified file 'storage/perfschema/unittest/pfs-t.cc'
--- a/storage/perfschema/unittest/pfs-t.cc 2010-11-16 08:36:42 +0000
+++ b/storage/perfschema/unittest/pfs-t.cc 2011-03-08 12:42:00 +0000
@@ -1205,6 +1205,8 @@ void test_enabled()
void do_all_tests()
{
+ /* Using initialize_performance_schema(), no partial init needed. */
+
test_bootstrap();
test_bad_registration();
test_init_disabled();
=== modified file 'storage/perfschema/unittest/pfs_instr-oom-t.cc'
--- a/storage/perfschema/unittest/pfs_instr-oom-t.cc 2010-11-16 08:36:42 +0000
+++ b/storage/perfschema/unittest/pfs_instr-oom-t.cc 2011-03-08 12:42:00 +0000
@@ -199,7 +199,11 @@ void test_oom()
void do_all_tests()
{
+ PFS_atomic::init();
+
test_oom();
+
+ PFS_atomic::cleanup();
}
int main(int, char **)
=== modified file 'storage/perfschema/unittest/pfs_instr-t.cc'
--- a/storage/perfschema/unittest/pfs_instr-t.cc 2010-11-16 08:36:42 +0000
+++ b/storage/perfschema/unittest/pfs_instr-t.cc 2011-03-08 12:42:00 +0000
@@ -400,10 +400,14 @@ void test_per_thread_wait()
void do_all_tests()
{
+ PFS_atomic::init();
+
test_no_instruments();
test_no_instances();
test_with_instances();
test_per_thread_wait();
+
+ PFS_atomic::cleanup();
}
int main(int, char **)
=== modified file 'storage/perfschema/unittest/pfs_instr_class-oom-t.cc'
--- a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc 2010-11-16 08:36:42 +0000
+++ b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc 2011-03-08 12:42:00 +0000
@@ -47,7 +47,11 @@ void test_oom()
void do_all_tests()
{
+ PFS_atomic::init();
+
test_oom();
+
+ PFS_atomic::cleanup();
}
int main(int, char **)
=== modified file 'storage/perfschema/unittest/pfs_instr_class-t.cc'
--- a/storage/perfschema/unittest/pfs_instr_class-t.cc 2010-11-16 08:36:42 +0000
+++ b/storage/perfschema/unittest/pfs_instr_class-t.cc 2011-03-08 12:42:00 +0000
@@ -554,6 +554,8 @@ void test_instruments_reset()
void do_all_tests()
{
+ PFS_atomic::init();
+
test_no_registration();
test_mutex_registration();
test_rwlock_registration();
@@ -562,6 +564,8 @@ void do_all_tests()
test_file_registration();
test_table_registration();
test_instruments_reset();
+
+ PFS_atomic::cleanup();
}
int main(int, char **)
=== modified file 'storage/perfschema/unittest/pfs_timer-t.cc'
--- a/storage/perfschema/unittest/pfs_timer-t.cc 2010-07-15 23:44:45 +0000
+++ b/storage/perfschema/unittest/pfs_timer-t.cc 2011-03-08 12:42:00 +0000
@@ -105,7 +105,11 @@ void test_timers()
void do_all_tests()
{
+ PFS_atomic::init();
+
test_timers();
+
+ PFS_atomic::cleanup();
}
int main(int, char **)
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.5 branch (marc.alff:3376 to 3377) Bug#11830755 | Marc Alff | 8 Mar |