List:Commits« Previous MessageNext Message »
From:Konstantin Osipov Date:August 12 2010 3:31pm
Subject:bzr push into mysql-5.5-bugfixing branch (kostja:3101 to 3102) WL#5000
View as plain text  
 3102 Konstantin Osipov	2010-08-12
      A follow up patch for WL#5000: add a test case
      and a comment for the case when a connection
      issuing FLUSH TABLES <list> WITH READ LOCK
      has an open handler.

    modified:
      mysql-test/r/flush.result
      mysql-test/t/flush.test
      sql/sql_parse.cc
 3101 Konstantin Osipov	2010-08-12 [merge]
      Commit on behalf of Dmitry Lenev.
      Merge his patch for Bug#52044 into 5.5, and apply 
      review comments.

    modified:
      mysql-test/include/handler.inc
      mysql-test/r/flush.result
      mysql-test/r/mdl_sync.result
      mysql-test/suite/perfschema/r/dml_setup_instruments.result
      mysql-test/suite/perfschema/r/server_init.result
      mysql-test/t/flush.test
      mysql-test/t/kill.test
      mysql-test/t/lock_multi.test
      mysql-test/t/mdl_sync.test
      mysys/thr_rwlock.c
      sql/ha_ndbcluster.cc
      sql/ha_ndbcluster_binlog.cc
      sql/lock.cc
      sql/mdl.cc
      sql/mdl.h
      sql/mysqld.cc
      sql/mysqld.h
      sql/sql_base.cc
      sql/sql_base.h
      sql/sql_handler.cc
      sql/sql_insert.cc
      sql/sql_parse.cc
      sql/sql_show.cc
      sql/sql_yacc.yy
      sql/sys_vars.cc
      sql/table.cc
      sql/table.h
=== modified file 'mysql-test/r/flush.result'
--- a/mysql-test/r/flush.result	2010-08-12 13:50:23 +0000
+++ b/mysql-test/r/flush.result	2010-08-12 15:29:41 +0000
@@ -279,3 +279,28 @@ drop temporary table v1;
 unlock tables;
 drop view v2, v3;
 drop table t1, v1;
+# 
+# FLUSH TABLES <list> WITH READ LOCK and HANDLER
+# 
+drop table if exists t1;
+create table t1 (a int, key a (a));
+insert into t1 (a) values (1), (2), (3);
+handler t1 open;
+handler t1 read a next;
+a
+1
+handler t1 read a next;
+a
+2
+flush tables t1 with read lock;
+handler t1 read a next;
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
+unlock tables;
+#
+# Sic: lost handler position.
+#
+handler t1 read a next;
+a
+1
+handler t1 close;
+drop table t1;

=== modified file 'mysql-test/t/flush.test'
--- a/mysql-test/t/flush.test	2010-08-12 13:50:23 +0000
+++ b/mysql-test/t/flush.test	2010-08-12 15:29:41 +0000
@@ -407,3 +407,26 @@ drop temporary table v1;
 unlock tables;
 drop view v2, v3;
 drop table t1, v1;
+
+
+--echo # 
+--echo # FLUSH TABLES <list> WITH READ LOCK and HANDLER
+--echo # 
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int, key a (a));
+insert into t1 (a) values (1), (2), (3);
+handler t1 open;
+handler t1 read a next;
+handler t1 read a next;
+flush tables t1 with read lock;
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
+handler t1 read a next;
+unlock tables;
+--echo #
+--echo # Sic: lost handler position.
+--echo #
+handler t1 read a next;
+handler t1 close;
+drop table t1;

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2010-08-12 13:50:23 +0000
+++ b/sql/sql_parse.cc	2010-08-12 15:29:41 +0000
@@ -1750,6 +1750,17 @@ int prepare_schema_table(THD *thd, LEX *
   If a temporary table with such name exists, it's ignored:
   if there is a base table, it's used, otherwise ER_NO_SUCH_TABLE
   is returned.
+
+  Implicit commit
+  ---------------
+  This statement causes an implicit commit before and
+  after it.
+
+  HANDLER SQL
+  -----------
+  If this connection has HANDLERs open against
+  some of the tables being FLUSHed, these handlers
+  are implicitly flushed (lose their position).
 */
 
 static bool flush_tables_with_read_lock(THD *thd, TABLE_LIST *all_tables)


Attachment: [text/bzr-bundle] bzr/kostja@sun.com-20100812152941-v1yixzxh4rolrxyh.bundle
Thread
bzr push into mysql-5.5-bugfixing branch (kostja:3101 to 3102) WL#5000Konstantin Osipov12 Aug