List:Commits« Previous MessageNext Message »
From:Marc Alff Date:May 7 2012 7:39am
Subject:bzr push into mysql-trunk-pfs-tuning branch (marc.alff:3503 to 3504)
View as plain text  
 3504 Marc Alff	2012-05-07 [merge]
      Merge mysql-trunk --> mysql-trunk-pfs-tuning
      Attempt to fix unit test build break on windows

    modified:
      mysql-test/suite/innodb/r/innodb_stats_drop_locked.result
      storage/innobase/dict/dict0stats.cc
      storage/perfschema/unittest/pfs_benchmark_helper.cc
 3503 Marc Alff	2012-05-04 [merge]
      Merge mysql-trunk --> mysql-trunk-pfs-tuning

    modified:
      sql/mysqld.cc
      sql/mysqld.h
=== modified file 'mysql-test/suite/innodb/r/innodb_stats_drop_locked.result'
--- a/mysql-test/suite/innodb/r/innodb_stats_drop_locked.result	2012-04-24 06:21:11 +0000
+++ b/mysql-test/suite/innodb/r/innodb_stats_drop_locked.result	2012-05-04 13:27:05 +0000
@@ -19,7 +19,7 @@ innodb_stats_drop_locked
 innodb_stats_drop_locked
 ALTER TABLE innodb_stats_drop_locked DROP INDEX c_key;
 Warnings:
-Warning	1205	Unable to delete statistics for index c_key from mysql.innodb_index_stats because the rows are locked. They can be deleted later using DELETE FROM mysql.innodb_index_stats WHERE database_name = 'test' AND table_name = 'innodb_stats_drop_locked' AND index_name = 'c_key';
+Warning	1205	Unable to delete statistics for index c_key from mysql.innodb_index_stats because the rows are locked: Lock wait timeout. They can be deleted later using DELETE FROM mysql.innodb_index_stats WHERE database_name = 'test' AND table_name = 'innodb_stats_drop_locked' AND index_name = 'c_key';
 SHOW CREATE TABLE innodb_stats_drop_locked;
 Table	Create Table
 innodb_stats_drop_locked	CREATE TABLE `innodb_stats_drop_locked` (
@@ -27,7 +27,7 @@ innodb_stats_drop_locked	CREATE TABLE `i
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 STATS_PERSISTENT=1
 DROP TABLE innodb_stats_drop_locked;
 Warnings:
-Warning	1205	Unable to delete statistics for table test.innodb_stats_drop_locked from mysql.innodb_table_stats or mysql.innodb_index_stats because the rows are locked. They can be deleted later using DELETE FROM mysql.innodb_index_stats WHERE database_name = 'test' AND table_name = 'innodb_stats_drop_locked'; DELETE FROM mysql.innodb_table_stats WHERE database_name = 'test' AND table_name = 'innodb_stats_drop_locked';
+Warning	1205	Unable to delete statistics for table test.innodb_stats_drop_locked from mysql.innodb_table_stats or mysql.innodb_index_stats because the rows are locked: Lock wait timeout. They can be deleted later using DELETE FROM mysql.innodb_index_stats WHERE database_name = 'test' AND table_name = 'innodb_stats_drop_locked'; DELETE FROM mysql.innodb_table_stats WHERE database_name = 'test' AND table_name = 'innodb_stats_drop_locked';
 SHOW TABLES;
 Tables_in_test
 COMMIT;

=== modified file 'storage/innobase/dict/dict0stats.cc'
--- a/storage/innobase/dict/dict0stats.cc	2012-05-04 06:46:01 +0000
+++ b/storage/innobase/dict/dict0stats.cc	2012-05-04 16:41:23 +0000
@@ -2751,7 +2751,7 @@ dict_stats_delete_index_stats(
 
 		ut_snprintf(errstr, errstr_sz,
 			    "Unable to delete statistics for index %s "
-			    "from %s%s. They can be deleted later using "
+			    "from %s%s: %s. They can be deleted later using "
 			    "DELETE FROM %s WHERE "
 			    "database_name = '%s' AND "
 			    "table_name = '%s' AND "
@@ -2761,6 +2761,7 @@ dict_stats_delete_index_stats(
 			    (ret == DB_LOCK_WAIT_TIMEOUT
 			     ? " because the rows are locked"
 			     : ""),
+			    ut_strerr(ret),
 			    INDEX_STATS_NAME_PRINT,
 			    database_name,
 			    table_name,
@@ -2850,8 +2851,22 @@ dict_stats_delete_table_stats(
 
 	ret = que_eval_sql(pinfo,
 			   "PROCEDURE DROP_TABLE_STATS () IS\n"
+			   "dummy CHAR;\n"
 			   "BEGIN\n"
 
+			   /* Lock TABLE_STATS_NAME first to avoid deadlock
+			   with dict_stats_save() which locks the two tables
+			   in order TABLE_STATS_NAME,INDEX_STATS_NAME. The
+			   foreign key imposes that order during INSERT/UPDATE
+			   and the reverse order during DELETE. */
+
+			   "SELECT database_name INTO dummy\n"
+			   "FROM \"" TABLE_STATS_NAME "\"\n"
+			   "WHERE\n"
+			   "database_name = :database_name AND\n"
+			   "table_name = :table_name\n"
+			   "FOR UPDATE;\n"
+
 			   "DELETE FROM \"" INDEX_STATS_NAME "\" WHERE\n"
 			   "database_name = :database_name AND\n"
 			   "table_name = :table_name;\n"
@@ -2870,7 +2885,7 @@ dict_stats_delete_table_stats(
 
 		ut_snprintf(errstr, errstr_sz,
 			    "Unable to delete statistics for table %s.%s "
-			    "from %s or %s%s. "
+			    "from %s or %s%s: %s. "
 			    "They can be deleted later using "
 
 			    "DELETE FROM %s WHERE "
@@ -2888,6 +2903,8 @@ dict_stats_delete_table_stats(
 			     ? " because the rows are locked"
 			     : ""),
 
+			    ut_strerr(ret),
+
 			    INDEX_STATS_NAME_PRINT,
 			    database_name, table_name_strip,
 

=== modified file 'storage/perfschema/unittest/pfs_benchmark_helper.cc'
--- a/storage/perfschema/unittest/pfs_benchmark_helper.cc	2012-01-06 07:38:20 +0000
+++ b/storage/perfschema/unittest/pfs_benchmark_helper.cc	2012-05-07 07:38:35 +0000
@@ -25,12 +25,12 @@ unsigned long long get_work_done()
 /*
   See include/my_pthread.h
 */
-void EnterCriticalSection(LPCRITICAL_SECTION)
+__declspec(dllexport) void __stdcall EnterCriticalSection(LPCRITICAL_SECTION)
 {
   return;
 }
 
-void LeaveCriticalSection(LPCRITICAL_SECTION)
+__declspec(dllexport) void __stdcall LeaveCriticalSection(LPCRITICAL_SECTION)
 {
   return;
 }

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-pfs-tuning branch (marc.alff:3503 to 3504) Marc Alff8 May